Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog - check rather than ok executes if statement
#1
Hi,

I created the dialog below based on another example in the forum.
My two questions are:
I would like it to be visible on top all the time within my application - like a dashboard in the corner of the screen
I would like it to act on the user checking any of the boxes without having an OK button - just the actual clicking on the box will cause the "if" statements to execute. In my case, they will be acting to dis+/dis- particular folders of macros (which I know how to do).

If that is possible, I will remove the OK button from the dialog controls.

Thanks!!,
Stuart

Code:
Copy      Help
\Dialog_Editor

str controls = "3 4 5 6"
str c3Mou c4Aut c5Aut c6Aut

c6Aut=1


if(!ShowDialog("" 0 &controls)) ret

if(c3Mou=1) out "1 checked"
if(c4Aut=1) out "2 checked"
if(c5Aut=1) out "3 checked"
if(c6Aut=1) out "4 checked"

;BEGIN DIALOG
;0 "" 0x44 0x0 0 0 133 65 "RadFusion Options"
;1 Button 0x54030001 0x4 38 28 48 14 "OK"
;3 Button 0x54012003 0x0 4 2 60 14 "1"
;4 Button 0x54012003 0x0 64 2 62 14 "2"
;5 Button 0x54012003 0x0 4 14 54 12 "3"
;6 Button 0x54012003 0x0 64 14 58 12 "4"
;END DIALOG
;DIALOG EDITOR: "" 0x2020008 "" ""
#2
First. use ont "Window" for making it ontop of other windows

Second. use a smart dialog then for case's do wut u want!
#3
Something like this for the dialog i suggest...
Function ( Dialog2 ) Trigger ( F5 )
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

;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 0x54012003 0x0 34 16 48 12 "Check"
;END DIALOG
;DIALOG EDITOR: "" 0x2020103 "" "" ""


str controls = "3"
str c3Che
if(!ShowDialog("Dialog2" &Dialog2 &controls)) 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
sel wParam
,case 3
,,out "Checked"
,case IDOK
,DT_Ok hDlg ;;*
,case IDCANCEL DT_Cancel hDlg ;;*
ret 1

;* - not necessary in QM >= 2.1.9
#4
Thanks for the tips and example. I will give it a try.

Stuart
#5

Inside the dialog, click on styles and then WS_EX_TOPMOST, and like QM EXPERT said, use a smart dialog, then you can set up your cases so that you dialog will react as soon as one of the boxes are checked rather then when you click OK. Heres an example.


EDIT** Sorry, didn't see an example already supplied.

Function ( Stupomer ) Trigger ( F3 )
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

;BEGIN DIALOG
;0 "" 0x90C80044 0x108 0 0 145 116 "Dialog"
;1 Button 0x54030001 0x4 8 86 48 14 "Close"
;3 Button 0x54012003 0x0 8 6 48 12 "1"
;4 Button 0x54012003 0x0 8 26 48 12 "2"
;5 Button 0x54012003 0x0 8 46 48 12 "3"
;6 Button 0x54012003 0x0 8 66 48 12 "4"
;END DIALOG
;DIALOG EDITOR: "" 0x2020102 "" "" ""


str controls = "3 4 5 6"
str c3 c4 c5 c6
if(!ShowDialog("Stupomer" &Stupomer &controls)) ret

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,,out "1"
,case 4
,,out "2"
,case 5
,,out "3"
,case 6
,,out "4"
,case IDOK
,case IDCANCEL
ret 1
Taking on Quick Macros one day at a time


Forum Jump:


Users browsing this thread: 1 Guest(s)