09-01-2015, 05:35 PM
Example for "simple" dialog.
Function Dialog191
Example for "smart" dialog. The button closes the dialog.
Function Dialog192
Example for "smart" dialog. The button launches another macro and does not close the dialog.
Function Dialog193
Function Dialog191
\Dialog_Editor
;run "notepad" ;;enable these disabled green lines if really need Notepad
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 8 8 48 14 "Hello"
;4 Button 0x54032000 0x0 8 28 48 14 "Goodbye"
;END DIALOG
;DIALOG EDITOR: "" 0x2040302 "*" "" "" ""
int button=ShowDialog(dd 0 0)
sel button
,case 3
,out "Hello"
,;act "Notepad"; key "Hello"
,;...
,
,case 4
,out "Goodbye"
,;act "Notepad"; key "Goodbye"
,;...
Example for "smart" dialog. The button closes the dialog.
Function Dialog192
\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 8 8 48 14 "Hello"
;4 Button 0x54032000 0x0 8 28 48 14 "Goodbye"
;END DIALOG
;DIALOG EDITOR: "" 0 "*" "" "" ""
int button=ShowDialog(dd &sub.DlgProc 0)
;out button
sel button
,case 3
,out "Hello"
,;...
,
,case 4
,out "Goodbye"
,;...
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case [3,4] DT_Ok(hDlg wParam)
,case IDOK
,case IDCANCEL
ret 1
Example for "smart" dialog. The button launches another macro and does not close the dialog.
Function Dialog193
\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 8 8 48 14 "Hello"
;4 Button 0x54032000 0x0 8 28 48 14 "Goodbye"
;END DIALOG
;DIALOG EDITOR: "" 0 "*" "" "" ""
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,mac "Hello macro"
,
,case 4
,mac "Goodbye macro"
,
,case IDOK
,case IDCANCEL
ret 1