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
It must be smart dialog.

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

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

;BEGIN DIALOG
;0 "" 0x44 0x0 0 0 133 65 "RadFusion Options"
;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: "" 0x2020104 "" "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,if(but(lParam)) out 1
,case 4
,if(but(lParam)) out 2
,case 5
,if(but(lParam)) out 3
,case 6
,if(but(lParam)) out 4
,case IDOK
,case IDCANCEL
ret 1
#3
Hi Gintaras,
Thanks so much. That was perfect.

Two more quick questions:

How do you fix the dialog in place and make it so that it doesn't show up in the application toolbar at the bottom of the screen. Just kind of always there after launched until shut off by some other macro.
Thanks,
Stuart
#4
With ShowDialog use x 1, y -1. And add DS_CENTER style.
#5
Hi,
I am trying to make a dialog like a fixed Toolbar i.e.

fixed in place - user can't move it around

stays on top of app at all times, always visible

doesn't register as an additional window/app in the app strip at the bottom of screen (i.e. open dialog)

Is this possible without having a separate ont statement triggered by the appearance of the dialog window

Thanks so much,

Stuart
#6
1. fixed in place - remove WS_CAPTION style

2. fixed in place but moveable with right button, like toolbars - there is a topic in the forum that shows how to do it

3. stays on top - add WS_EX_TOPMOST or DS_SYSMODAL style

4. stays on top of certain window - pass that window handle to ShowDialog, 4-th argument

5. on top of certain window, always visible - 3 and 4

6. remove taskbar button - 4 or add WS_EX_TOOLWINDOW style

7. add taskbar button if missing (you did'n ask that) - add WS_EX_APPWINDOW style
#7
Hi Gintaras,
I could have never figured out all those styles by myself.
I really appreciate it!
Happy Holidays!
Stuart
#8
Hi Gintaras,
I got everything almost like I want it except the user can still move around the dialog by left click and dragging it. How can I get it fixed. I have already removed WS_CAPTION style.

Thanks,
Stuart
#9
Forgot it, also remove WS_BORDER.
#10
Hi Gintaras,
I already removed the WS_Border.

The part that is movable is the top title part of the frame - perhaps I can set the location so that part is above the viewing window but that limits where I can place it.

Stuart
#11
This is simplest dialog without WS_CAPTION and WS_BORDER. It does not have caption and cannot be moved.

Code:
Copy      Help
\Dialog_Editor

if(!ShowDialog("Dialog34" 0)) ret

;BEGIN DIALOG
;0 "" 0x90480A44 0x100 0 0 223 151 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2020104 "" "" ""
#12
Hi Gintaras,
Believe it or not, I came to the same discovery - Popup window style with a thick frame is what I needed.

Thanks again,
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)