Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deselecting options in a dialog
#1
Is there a way to deselect all options in a dialog at the same time?

Function Dialog9
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3 4 5 6 7 8"
str o3Opt o4Opt o5Opt o6Opt o7Opt o8Opt
if(!ShowDialog("Dialog9" &Dialog9 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032009 0x0 8 10 48 12 "Option first"
;4 Button 0x54002009 0x0 8 28 48 13 "Option next"
;5 Button 0x54032009 0x0 72 10 48 12 "Option first"
;6 Button 0x54002009 0x0 72 28 48 13 "Option next"
;7 Button 0x54032009 0x0 132 10 48 12 "Option first"
;8 Button 0x54002009 0x0 132 28 48 13 "Option next"
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""

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


Or do I have to deselect each one?

Macro
Code:
Copy      Help
but- id(3 win("Dialog" "#32770"))
but- id(4 win("Dialog" "#32770"))
but- id(5 win("Dialog" "#32770"))
but- id(6 win("Dialog" "#32770"))
but- id(7 win("Dialog" "#32770"))
but- id(8 win("Dialog" "#32770"))
#2
Somewhere in System you'll find function TO_Check. I use it for checking/unchecking multiple checkboxes. You can clone it and use in macros. Don't use TO_Check because it may be changed or removed in the future.

Macro
Code:
Copy      Help
TO_Check2 win("Dialog" "#32770") "3 4 5 6 7 8" 0

This will check 3, 4, 5 and uncheck 6, 7, 8.
Macro
Code:
Copy      Help
TO_Check2 win("Dialog" "#32770") "3 4 5 -6 -7 -8" 1

This will check 3, 4, 5, and notify the dialog function.
Macro
Code:
Copy      Help
TO_Check2 win("Dialog" "#32770") "3 4 5" 1 1
#3
I have a question about the flags “0” and the “1” and the notify the dialog function. What does this mean?
#4
0 uncheck, 1 check
notify - send WM_COMMAND message to the dialog. If it is QM smart dialog and has code that is executed when checking/unchecking the checkbox, the code will be executed.
#5
That is exactly what I needed.
Thank You


Forum Jump:


Users browsing this thread: 1 Guest(s)