Posts: 576
Threads: 97
Joined: Aug 2007
Hey, i have this in my dialog to do these things after OK was pressed, it seems to skip over the if(...=...) even if it is checked......can anyone help me? here is that part of the dialog.
,case IDOK DT_Ok hDlg
,,str y.getwintext(id(7 hDlg))
,,if(o3NL=1)
,,,out "5 times"
,,if(o4Oma=1)
,,,out "21 times"
,,if(o5=1)
,,,out "15 times"
,,if(o6PL=1)
,,,out "12 times"
,,but+ id(44 "Times New")
,,str t.getwintext(id(5 hDlg))
,,y.setwintext(id(44 hDlg))
,,t.setwintext(id(41 hDlg))
Posts: 473
Threads: 33
Joined: Aug 2007
If you post whole dialog I can fix it for you. Somewhat hard for me to understand exactly what you've done wrong with what you've supplied. I think I know the problem but just to be sure it would be easier if you showed the whole dialog.
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
here is my whole dialog hope this helps! thanks!
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 4 5 6 7"
str o3NL o4Oma o5 o6PL e7
o3NL=1
if(!ShowDialog("Help_Dialog" &Help_Dialog &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 126 108 "My Help Dialog"
;1 Button 0x54030001 0x4 8 90 48 14 "Open1"
;2 Button 0x54030000 0x4 72 90 48 14 "CLOSE"
;3 Button 0x54032009 0x0 4 54 48 13 "Open2"
;4 Button 0x54002009 0x0 76 54 48 13 "CLOSE"
;5 Button 0x54002009 0x0 4 70 48 13 "Open3"
;6 Button 0x54002009 0x0 76 70 48 13 "CLOSE"
;7 Edit 0x54030080 0x200 14 12 96 14 "Open4"
;8 Button 0x54032000 0x0 36 28 48 14 "CLOSE"
;9 Static 0x54000000 0x0 4 2 70 10 "Open5"
;10 Button 0x54020007 0x0 2 44 124 42 "CLOSE"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 8
,,_s.getclip
,,_s.setsel(0 id(7 hDlg))
,case IDOK DT_Ok hDlg
,,str y.getwintext(id(7 hDlg))
,,if(o3NL=1)
,,,out "5 times"
,,if(o4Oma=1)
,,,out "21 times"
,,if(o5=1)
,,,out "15 times"
,,if(o6PL=1)
,,,out "12 times"
,,but+ id(44 "Times New")
,,str t.getwintext(id(5 hDlg))
,,y.setwintext(id(44 hDlg))
,,t.setwintext(id(41 hDlg))
,case IDCANCEL DT_Cancel hDlg
ret 1
Posts: 473
Threads: 33
Joined: Aug 2007
I'm trying to fix this up for you but I don't see where you get id's 44 & 41?
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
you can delete them, i just got the from another dialog and put hDlg on accident other dialogs name is "Repair PC" if that helps....but if u just delete those lines you can fix it thanks!
Posts: 473
Threads: 33
Joined: Aug 2007
Here see if this is what you wanted.
Macro ( Trigger )
str controls = "3 4 5 6 7"
str o3NL o4Oma o5 o6PL e7
o3NL=1
if(!ShowDialog("Help_Dialog" &Help_Dialog &controls)) ret
if(o3NL=1)
,out "5 times"
if(o4Oma=1)
,out "21 times"
if(o5=1)
,out "15 times"
if(o6PL=1)
,out "12 times"
out e7;;this is not necessary
Function ( Help_Dialog )
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 126 108 "My Help Dialog"
;1 Button 0x54030001 0x4 8 90 48 14 "Open1"
;2 Button 0x54030000 0x4 72 90 48 14 "CLOSE"
;3 Button 0x54032009 0x0 4 54 48 13 "Open2"
;4 Button 0x54002009 0x0 76 54 48 13 "CLOSE"
;5 Button 0x54002009 0x0 4 70 48 13 "Open3"
;6 Button 0x54002009 0x0 76 70 48 13 "CLOSE"
;7 Edit 0x54030080 0x200 14 12 96 14 "Open4"
;8 Button 0x54032000 0x0 36 28 48 14 "CLOSE"
;9 Static 0x54000000 0x0 4 2 70 10 "Open5"
;10 Button 0x54020007 0x0 2 44 124 42 "CLOSE"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 8
,,_s.getclip
,,_s.setsel(0 id(7 hDlg))
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
thanks, but i have done that already im trying to find out if i can get it to work right in the dialog instead of having to trigger another function from the dialog! thanks
Posts: 473
Threads: 33
Joined: Aug 2007
You mean do it all without a trigger?
Function ( Help_Dialog )
\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 126 108 "My Help Dialog"
;1 Button 0x54030001 0x4 8 90 48 14 "Open1"
;2 Button 0x54030000 0x4 72 90 48 14 "CLOSE"
;3 Button 0x54032009 0x0 4 54 48 13 "Open2"
;4 Button 0x54002009 0x0 76 54 48 13 "CLOSE"
;5 Button 0x54002009 0x0 4 70 48 13 "Open3"
;6 Button 0x54002009 0x0 76 70 48 13 "CLOSE"
;7 Edit 0x54030080 0x200 14 12 96 14 "Open4"
;8 Button 0x54032000 0x0 36 28 48 14 "CLOSE"
;9 Static 0x54000000 0x0 4 2 70 10 "Open5"
;10 Button 0x54020007 0x0 2 44 124 42 "CLOSE"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
str controls = "3 4 5 6 7"
str o3NL o4Oma o5 o6PL e7
o3NL=1
if(!ShowDialog(dd 0 &controls 0 2)) ret
if(o3NL=1)
,out "5 times"
if(o4Oma=1)
,out "21 times"
if(o5=1)
,out "15 times"
if(o6PL=1)
,out "12 times"
out e7;;this is not necessary
Taking on Quick Macros one day at a time
Posts: 12,072
Threads: 140
Joined: Dec 2002
These variables can be used only when the dialog is closed, ie after ShowDialog returns. While the dialog is open, use this:
if(but(3 hDlg))
,out "5 times"
...
Posts: 576
Threads: 97
Joined: Aug 2007
thanks gint that worked perfect
is there a way to put a limit on the number of characters aloud entered in an edit box on a dialog?
Posts: 473
Threads: 33
Joined: Aug 2007
Do you mean to have your dialog set up so that if a box is checked to do a specific action?
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Nevermind did a little research and found it Thanks Though!
|