Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MultiMacro Dialog Problems
#1
Hi,
I am having trouble with Dialogs.
I would like to have dialog show up with several macro option buttons. When macro button is pressed, dialog should close automatically. However, this didn't work, so I had to add


Code:
Copy      Help
clo win("Dialog Name" "#32770")

to each selection, like this....

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

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 134 153 "Window Layout"
;3 Button 0x54032000 0x0 0 0 66 52 "1"
;4 Button 0x54032000 0x0 0 52 68 56 "4"
;5 Button 0x54032000 0x0 66 0 68 52 "2"
;6 Button 0x54032000 0x0 68 52 66 56 "6"
;7 Button 0x54032000 0x0 0 108 68 45 "Current Only"
;8 Button 0x54032000 0x0 68 108 66 45 "Current+Prior"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3
,,mac "1-on-1"
,,clo win("Window Layout" "#32770")
,case 5
,,mac "2-on-1"
,,clo win("Window Layout" "#32770")
,case 4
,,mac "4-on-1"
,,clo win("Window Layout" "#32770")
,case 6
,,mac "6-on-1"
,,clo win("Window Layout" "#32770")
,case 7
,,mac "1 Across"
,,clo win("Window Layout" "#32770")
,case 8
,,mac "1 Each"
,,clo win("Window Layout" "#32770")
ret 1

This works but I think that I am still doing something wrong.

Secondly,
how do I keep Dialog on top OR Close Dialog if no user input after 3 seconds. Currently, if user clicks outside of screen, dialog goes to background - user doesn't know it is there and must Alt-Tab to get it backup (main application usually hides Taskbar). Since Dialog is still waiting for input, no new macro can be run!

Finally, (thanks so much Gintaras!!!), is it possible to pass Left click upon RELEASE of trigger for dialog so that it will select the dialog choice under the cursor at that time
like we talked about in Radial Gesturing Post

http://www.quickmacros.com/forum/showthr...p?tid=1927

Stuart
#2
Hi Gintaras,
I forgot in last post to thank you again for all your help!!!
Stuart
#3
From QM Help, "Dialogs" topic:
Quote:ShowDialog for modal dialog returns 1 on OK, 0 on Cancel. When you click some other push-button in dialog that does not have custom dialog procedure (that is, is not a "smart" dialog), it closes the dialog, and ShowDialog returns button id.

Code:
Copy      Help
int button=ShowDialog("" 0)
out button

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 134 153 "Window Layout"
;3 Button 0x54032000 0x0 0 0 66 52 "1"
;4 Button 0x54032000 0x0 0 52 68 56 "4"
;5 Button 0x54032000 0x0 66 0 68 52 "2"
;6 Button 0x54032000 0x0 68 52 66 56 "6"
;7 Button 0x54032000 0x0 0 108 68 45 "Current Only"
;8 Button 0x54032000 0x0 68 108 66 45 "Current+Prior"
;END DIALOG
;DIALOG EDITOR: "" 0x2020100 "" ""
#4
I read the Qm Help and also on the internet. I think I understand a bit more about Modal/Modeless and about Smart Dialogs but am confused about the syntax.

For example, I would like to have my dialog run a macro, like in the answer to the post below:


http://www.quickmacros.com/forum/showthr...p?tid=1935

However, when I run the dialog in the post, the macro won't run untl you close the dialog with OK - whereas what I want is that as soon as you hit the button (e.g. control 3), the macro will run and the dialog will close. I thought that is what a modal dialog is supposed to be. Maybe it is not working because it is a Smart dialog. But then if I use a nonsmart dialog, like in the example in this thread, then how do I get the returned object number - say 3 to cause a specific macro to run.
I also am confused about how to keep the macro on top.

When I made a macro modeless, I was able to use a macro with an ont statement which had a window trigger that was the Dialog window Name/Handle. It seems like this is a roundabout way of going about things.

I am sorry I am so confused. These dialogs seem to be the hardest thing for me to understand. I just want it to work like a menu or toolbar (i.e. macro runs and menu closes) - but with the big buttons like above.


Thank,
Stuart
#5
Quote:But then if I use a nonsmart dialog, like in the example in this thread, then how do I get the returned object number - say 3 to cause a specific macro to run.

sel button
,case 3 mac "..."
...


Forum Jump:


Users browsing this thread: 4 Guest(s)