bright-gpu-74537
04/02/2023, 4:22 PMbright-gpu-74537
04/02/2023, 4:23 PMbright-gpu-74537
04/02/2023, 4:25 PMbright-gpu-74537
04/02/2023, 4:25 PMbright-gpu-74537
04/02/2023, 4:26 PMicy-zebra-52882
04/02/2023, 4:28 PMicy-zebra-52882
04/02/2023, 4:28 PMxml
@:bind(openFileMenuItem, MenuEvent.MENU_SELECTED)
private function openTextFile(e:haxe.ui.events.UIEvent) {
trace('Attempting to open file dialogue');
Dialogs.openTextFile(LocaleManager.instance.lookupString("menu.file.openFile"),[{extension: ".txt", label: LocaleManager.instance.lookupString("menu.file.textFile")}],
(info) -> {
try {
inputTextfield.text = info.text;
} catch (e) {
errorLabel.text = e.message;
}
});
}
bright-gpu-74537
04/02/2023, 4:29 PMicy-zebra-52882
04/02/2023, 4:31 PMevent.menuItem.id == myMenuItem.id
?bright-gpu-74537
04/02/2023, 4:31 PMswitch (event.menuItem.id)
or something, then call a functionbright-gpu-74537
04/02/2023, 4:32 PMicy-zebra-52882
04/02/2023, 4:33 PMicy-zebra-52882
04/02/2023, 4:33 PMbright-gpu-74537
04/02/2023, 4:36 PMicy-zebra-52882
04/02/2023, 4:37 PMhaxe
switch(e.menuItem.id) {
case myMenuItem.id: { ... }
}
because it's not an allowed switch patternicy-zebra-52882
04/02/2023, 4:38 PMbright-gpu-74537
04/02/2023, 4:38 PMmyMenuItem.id
?icy-zebra-52882
04/02/2023, 4:38 PMbright-gpu-74537
04/02/2023, 4:38 PMhaxe
switch(e.menuItem.id) {
case "id1":
case "id2":
...
}
icy-zebra-52882
04/02/2023, 4:39 PMbright-gpu-74537
04/02/2023, 4:39 PMicy-zebra-52882
04/02/2023, 4:39 PMicy-zebra-52882
04/02/2023, 4:40 PMbright-gpu-74537
04/02/2023, 4:40 PMicy-zebra-52882
04/02/2023, 4:44 PMicy-zebra-52882
04/02/2023, 4:44 PMicy-zebra-52882
04/02/2023, 4:45 PMbright-gpu-74537
04/02/2023, 4:46 PMicy-zebra-52882
04/02/2023, 4:48 PMicy-zebra-52882
04/02/2023, 4:49 PM