Posts: 121
Threads: 33
Joined: Jun 2007
A few dialog questions:
1. How to make a button respond only to double-click and not single?
2. How to trigger action upon click (or better, double-click) of a bmp in dialog, or do I need to convert to button with bmp on it?
3. I have a User Config function/dialog that I want to be opened (if desired by user) from within the Main Macro/Data Entry dialog.
The trouble is that once changes have been made in the User Config, the Main Macro (caller) must be restarted in order to reload a slew of INI values etc. Is calling the UserConfig with "mac- UserConfig" and then have the last line of UserConfig run "mac- MainMacro" the the best way to do this? Or should I just try to re-declare, re-read all the info without ever ending anything?
Thanks for your help!
Posts: 11,937
Threads: 138
Joined: Dec 2002
1. Difficult.
2. Add SS_NOTIFY style. Then you can use the control like a button.
3.
Don't use mac. Call ShowDialog for the dialog2 from the dialog1. Then close dialog1 and run the function that shows it.
,if(!ShowDialog("dialog2" ...)) ret
,clo hDlg
,mac "dialog1"
It is probably the easiest of all possible ways.
Posts: 121
Threads: 33
Joined: Jun 2007
2. I tried a few examples without any luck. Can you please give small example of ss_notify use in dialog?
\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 Static 0x5400100E 0x20000 32 16 140 74 ""
END DIALOG
DIALOG EDITOR: "" 0x2030001 "" "" ""
out
str controls = "3"
str sb3 = "$windows$\Greenstone.bmp"
if(!ShowDialog("DlgSS3" &DlgSS3 &controls)) ret
ret
messages
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
messages2
sel wParam
case STN_CLICKED<<16|3
case IDOK
case IDCANCEL
ret 1
3.Ahhh, thank you. Much better method.
Posts: 121
Threads: 33
Joined: Jun 2007
2. I tried a few examples without any luck. Can you please give small example of ss_notify use in dialog?
Function
DlgSS3
\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 Static 0x5400100E 0x20000 32 16 140 74 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""
out
str controls = "3"
str sb3 = "$windows$\Greenstone.bmp"
if(!ShowDialog("DlgSS3" &DlgSS3 &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case STN_CLICKED<<16|3
,case IDOK
,case IDCANCEL
ret 1
3.Ahhh, thank you. Much better method.
Posts: 11,937
Threads: 138
Joined: Dec 2002
SS_NOTIFY style was not added
Function
DlgSS3
\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 Static 0x5400110E 0x20000 32 16 140 74 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030003 "" "" ""
out
str controls = "3"
str sb3 = "$windows$\Greenstone.bmp"
if(!ShowDialog("DlgSS3" &DlgSS3 &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case STN_CLICKED<<16|3
,mes 1
,
,case IDOK
,case IDCANCEL
ret 1
Posts: 121
Threads: 33
Joined: Jun 2007
Quote:SS_NOTIFY style was not added
1. I don't see where you added this, or how I will know how to do in the future. Obviously you added an action (mes 1) after case which I forgot to put in in my original,
but what else changed that equals "adding SS_NOTIFY style" and how?
I see that these two lines changed from:
3 Static 0x
5400100E 0x20000 32 16 140 74 ""
END DIALOG
DIALOG EDITOR: "" 0x
2030001 "" "" ""
To:
3 Static 0x
5400110E 0x20000 32 16 140 74 ""
END DIALOG
DIALOG EDITOR: "" 0x
2030003 "" "" ""
Is this why it works now?
2. I forgot to ask in original post, is it possible to add a modifier key to a button click in a dialog (e.g., CTL or ALT Click)?
Posts: 11,937
Threads: 138
Joined: Dec 2002
1. in dialog editor
2. use ifk or GetMod
Posts: 121
Threads: 33
Joined: Jun 2007
I'm an idiot. I was thinking "Events", as in button click.
Thanks.
Posts: 1,006
Threads: 330
Joined: Mar 2007
I have lots of double and triple clicks for my dialog buttons and toolbar items --
just add the following to the first line of the function being called and change the mes statements to whatever function or macro you want...
Function
SingleDoubleTripleQuadClick
wait 0.3 ML; err mes "single click"; ret;; if no click in 0.3 sec then user intended single click
wait 0.3 ML; err mes "double click"; ret ;; if no click in 0.3 sec then user intended double click
wait 0.3 ML; err mes "triple click"; ret ;; if no click in 0.3 sec then user intended triple click
mes "quadruple click"
make sure that you have it set as "Allow only single instance" in function properties and it should work great.
Stuart
Posts: 1,006
Threads: 330
Joined: Mar 2007
Hi,
I was wondering if there was something like
but for a richedit or regular edit box in a dialog. I have a scrolling readonly richedit text box which is in a small dialog. So the user has to scroll a lot to get through the entire text. I want that if the user clicks on the text box, it will get larger. I could easily do this with an additional button, but it would be cleaner if the user just clickon the text to toggle the size.
Thanks,
Stuart
Posts: 11,937
Threads: 138
Joined: Dec 2002
case WM_SETCURSOR
To see what messages your dialog receives, use __OutWinMsg in dialog function:
;messages
__OutWinMsg message wParam lParam
sel message
or Spy++.
Posts: 1,006
Threads: 330
Joined: Mar 2007
phenomenal!!!
A great way to learn how to really really understand dialogs!
THanks, STuart