01-22-2014, 07:00 PM
your missing ShowDialog statement
example...
if(!ShowDialog("Function2" &Function2)) ret
function2 is the name of dialog function change to whatever your dialog function name is
Function Function2
code above works but!!!! if user clicks ok or cancel dialog closes but function continues to run cause of the for loop your using
example...
if(!ShowDialog("Function2" &Function2)) ret
function2 is the name of dialog function change to whatever your dialog function name is
Function Function2
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
def PBM_SETRANGE (WM_USER+1)
def PBM_SETPOS (WM_USER+2)
def PBM_DELTAPOS (WM_USER+3)
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 217 47 "Fire Giant Timer"
;1 Button 0x54030001 0x4 108 28 48 14 "OK"
;2 Button 0x54030000 0x4 162 28 48 14 "Cancel"
;3 msctls_progress32 0x54000000 0x4 8 10 136 12 ""
;4 Button 0x54032000 0x4 8 28 48 14 "Start"
;5 Static 0x54000000 0x0 160 10 48 12 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""
if(!ShowDialog("Function2" &Function2)) ret
ret
;messages
sel message
,case WM_INITDIALOG DT_Init(hDlg lParam); ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
int ctrlid=wParam&0xFFFF; message=wParam>>16
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
,case 4 ;;Start
,opt waitmsg 1
,int i; str s
,i=0
,int hpb=id(3 hDlg)
,for i 0 100
,,SendMessage hpb PBM_SETPOS i 0
,,s.format("%i %%" i); s.setwintext(id(5 hDlg))
,,3.0
,,if i=95
,,,run "$desktop$\FG.wav"
,,,lef
,,SendMessage hpb PBM_SETPOS 0 0
,,s="Completed"; s.setwintext(id(5 hDlg))
;Default range is 100. To change, SendMessage hpb PBM_SETRANGE 0 max<<16|min
;PBM_DELTAPOS can be used insted of PBM_SETPOS to set increment instead of absolute value.
ret 1