bright-gpu-74537
01/14/2023, 12:06 PMvar d = new CustomDialog(); d.show();
refined-greece-48002
01/14/2023, 12:06 PMrefined-greece-48002
01/14/2023, 12:06 PMbright-gpu-74537
01/14/2023, 12:07 PMrefined-greece-48002
01/14/2023, 12:07 PMrefined-greece-48002
01/14/2023, 12:07 PMbright-gpu-74537
01/14/2023, 12:08 PMdialog.hide()
refined-greece-48002
01/14/2023, 12:08 PMrefined-greece-48002
01/14/2023, 12:08 PMbright-gpu-74537
01/14/2023, 12:08 PMdialog.destroyOnClose = false
refined-greece-48002
01/14/2023, 12:08 PMbright-gpu-74537
01/14/2023, 12:09 PMdialog.hideDialog(DialogButton.X)
... this is useful if you have a validation override that will stop the dialog from closingbright-gpu-74537
01/14/2023, 12:10 PMdialog.hide
is basically just dialog.hideDialog(DialogButton.CLOSE)
bright-gpu-74537
01/14/2023, 12:12 PM@:xml
in custom components (at the top of the class), for dialogs (which tend to be pretty small xml wise) i find it really useful, eg:bright-gpu-74537
01/14/2023, 12:13 PMhaxe
@:xml('
<dialog id="dlg" width="30%" height="30%" visible="false">
<button id="btn"/>
</dialog>
')
class CustomDialog extends Dialog {
}
bright-gpu-74537
01/14/2023, 12:13 PMrefined-greece-48002
01/14/2023, 12:13 PMbright-gpu-74537
01/14/2023, 12:14 PMbright-gpu-74537
01/14/2023, 12:14 PMrefined-greece-48002
01/14/2023, 12:14 PMbright-gpu-74537
01/14/2023, 12:15 PMdialog.xml
in the same dir as your class and just use @:build(haxe.ui.macros.ComponentMacros.build("dialog.xml"))
refined-greece-48002
01/14/2023, 12:15 PMbright-gpu-74537
01/14/2023, 12:15 PMbright-gpu-74537
01/14/2023, 12:16 PMrefined-greece-48002
01/14/2023, 12:16 PMbright-gpu-74537
01/14/2023, 12:17 PM@:build(haxe.ui.macros.ComponentMacros.build("..."))
should probably be @:build(haxe.ui.ComponentBuilder.build("..."))
btw, doesnt make a difference at the moment (its just an alias) but it is the preferred method (in case the other does get removed)refined-greece-48002
01/14/2023, 12:18 PMbright-gpu-74537
01/14/2023, 12:19 PMhaxe.ui.ComponentBuilder
and haxe.ui.RuntimeComponentBuilder
bright-gpu-74537
01/14/2023, 12:19 PMrefined-greece-48002
01/14/2023, 2:23 PM