Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to display input parameters from dialog while the macro is still running
#1
Hi.
I'm doing a dialog as follows and when clicking OK a macro will run based on input parameters from that dialog. I want that after clicking OK there will be a window that displays the selected basic information while the macro runs and displays so until the macro stops. Can anyone help me with how I can do that? I tried another dialog but it looks like dialog will stop the macro
Thank you.
Code:
Copy      Help
 
 \Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
InvalidateRect hDlg 0 1

 BEGIN DIALOG
 0 "" 0x90C80AC8 0x8 0 0 224 135 "TEST"
 4 Edit 0x54032000 0x200 74 40 32 14 ""
 6 Edit 0x54030080 0x200 74 8 96 14 ""
 7 Static 0x54000000 0x0 20 10 48 10 "ID"
 8 Static 0x54000000 0x0 20 26 48 10 "Pass"
 3 Edit 0x54030020 0x200 74 24 96 14 ""
 9 Static 0x54000000 0x0 20 42 48 10 "PIN"
 10 Edit 0x54032000 0x200 110 40 32 14 ""
 11 Edit 0x54032000 0x200 146 40 32 14 ""
 12 Edit 0x54032000 0x200 182 40 32 14 ""
 5 ComboBox 0x54230243 0x0 74 58 96 213 ""
 13 Static 0x54000000 0x0 84 84 48 10 "ON"
 2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
 END DIALOG
 DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
 messages
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
 messages2
sel wParam
case IDOK
case IDCANCEL
ret 1
#2
can easily use another dialog .Just need to run other dialog in a new thread
example with main dialog a secondary to show after main closes

Function DialogExample1
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "TEST" "4"
;3 Static 0x54000000 0x0 20 10 48 10 "ID"
;4 Edit 0x54030080 0x200 74 8 96 14 ""
;5 Static 0x54000000 0x0 20 26 48 10 "Pass"
;6 Edit 0x54030020 0x200 74 24 96 14 ""
;7 Static 0x54000000 0x0 20 42 48 10 "PIN"
;8 Edit 0x54032000 0x200 74 40 32 14 ""
;9 Edit 0x54032000 0x200 110 40 32 14 ""
;10 Edit 0x54032000 0x200 146 40 32 14 ""
;11 Edit 0x54032000 0x200 182 40 32 14 ""
;12 ComboBox 0x54230243 0x0 74 58 96 213 "
;13 Static 0x54000000 0x0 84 84 48 10 "ON"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""


str controls = "4 6 8 9 10 11 12"
str e4 e6 e8 e9 e10 e11 cb12Pas
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
out e4
out e6
str Pin= F"{e8} , {e9} , {e10} , {e11}"
out Pin
out cb12Pas
;call second dialog  to display basic info
int hthread=mac("sub.Dialog2" "" e4 Pin)
;Code to run after First dialog closes goes here
;; this is just a quick example
int i
rep 10
,out i
,i+1
,1

;;when above code ends close display dialog
shutdown -6 0 "" hthread




#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 IDOK
,case IDCANCEL
ret 1


#sub Dialog2
function# ~ID ~pin

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 64 "Dialog" "4"
;3 Static 0x54000000 0x0 16 24 48 12 "ID"
;4 Edit 0x54030880 0x200 73 24 96 12 ""
;5 Static 0x54000000 0x4 16 41 48 13 "Pin"
;6 Edit 0x54030880 0x200 73 41 96 13 ""
;7 Static 0x54000001 0x0 24 2 170 14 "Some Message Here"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""

str controls = "4 6"
str e4 e6
e4=ID
e6=pin
if(!ShowDialog(dd &sub.DlgProc2 &controls)) ret

ret 1


#sub DlgProc2
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
thank you very much


Forum Jump:


Users browsing this thread: 1 Guest(s)