• R/O
  • SSH

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得windowscocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Haxe bindings for koreader


Commit MetaInfo

修訂300cc3491f26bb20f56cb12a86acc88f50d091f3 (tree)
時間2022-03-05 22:44:55
作者Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fast...>
CommiterJaime Marquínez Ferrándiz

Log Message

Add ButtonDialogTitle

Change Summary

差異

diff -r 1d4e7e1afd1f -r 300cc3491f26 demo/haxeplug/HaxePlugin.hx
--- a/demo/haxeplug/HaxePlugin.hx Thu Mar 03 23:27:15 2022 +0100
+++ b/demo/haxeplug/HaxePlugin.hx Sat Mar 05 14:44:55 2022 +0100
@@ -7,6 +7,7 @@
77 import koreader.ui.UIManager;
88 import koreader.ui.widget.Button;
99 import koreader.ui.widget.ButtonDialog;
10+import koreader.ui.widget.ButtonDialogTitle;
1011 import koreader.ui.widget.ConfirmBox;
1112 import koreader.ui.widget.container.CenterContainer;
1213 import koreader.ui.widget.container.FrameContainer;
@@ -83,6 +84,10 @@
8384 callback: displayButtonDialog,
8485 }),
8586 Button.create({
87+ text: "Button dialog with title",
88+ callback: displayButtonDialogTitle,
89+ }),
90+ Button.create({
8691 text: "Close",
8792 callback: function close() {
8893 UIManager.close(mainWindow, Partial);
@@ -155,4 +160,19 @@
155160 ]],
156161 }));
157162 }
163+
164+ public static function displayButtonDialogTitle() {
165+ var callback = () -> UIManager.show(InfoMessage.create({text: "Pressed"}));
166+ var callbackClose = () -> UIManager.show(InfoMessage.create({text: "Closed"}));
167+ UIManager.show(ButtonDialogTitle.create({
168+ title: "Title of dialog",
169+ tap_close_callback: callbackClose,
170+ buttons: [[
171+ { text: "Button 1", callback: callback, enabled: false},
172+ { text: "Button 2", callback: callback},
173+ ], [
174+ {text: "Button 3", callback: callback},
175+ ]],
176+ }));
177+ }
158178 }
\ No newline at end of file
diff -r 1d4e7e1afd1f -r 300cc3491f26 src/koreader/ui/widget/ButtonDialogTitle.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/ui/widget/ButtonDialogTitle.lua.hx Sat Mar 05 14:44:55 2022 +0100
@@ -0,0 +1,22 @@
1+package koreader.ui.widget;
2+
3+import koreader.ui.widget.Button.ButtonParams;
4+import koreader.hxutils.LuaArray;
5+import koreader.ui.widget.container.InputContainer;
6+
7+@:luaRequire("ui/widget/buttondialogtitle")
8+@:build(KoreaderMacros.setupKoreaderExternClass())
9+extern class ButtonDialogTitle extends InputContainer {
10+ @:native("new")
11+ @:constructor
12+ private function create(params: ButtonDialogTitleParams) : ButtonDialog;
13+}
14+
15+typedef ButtonDialogTitleParams = {
16+ > InputContainerParams,
17+ ?buttons : LuaArray<LuaArray<ButtonParams>>,
18+ ?title : String,
19+ ?use_info_style : Bool,
20+ ?tap_close_callback: () -> Void,
21+ ?dismissable : Bool,
22+}
\ No newline at end of file