Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog Radio Buttons
#1
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.

Code:
Copy      Help
,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))
#2

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
#3
here is my whole dialog hope this helps! thanks!

Code:
Copy      Help
;\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
#4

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
#5
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!
#6

Here see if this is what you wanted.



Macro ( Trigger )
Code:
Copy      Help
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 )
Code:
Copy      Help
;\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
#7
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
#8

You mean do it all without a trigger?




Function ( Help_Dialog )
Code:
Copy      Help
\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
#9
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"
...
#10
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?
#11

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
#12
Nevermind did a little research and found it Thanks Though!


Forum Jump:


Users browsing this thread: 1 Guest(s)