dropdown dialog box ?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1415
Joined: Sun Nov 03, 2002 3:19 am

dropdown dialog box ?

Post by Dorian (MJT support) » Wed Dec 29, 2004 2:58 am

Hi people,

This is my first foray into dialogs, and I am finding them extremely confusing. I looked at the sample scripts, but just can't get my head round this. How do I make my dt dialog box below contain all values from 1-31, and then allow the user to choose one value? These will ultimately be sent via email, or written to an online logfile somewhere.

this is what I have so far :

Dialog>Dialog1
Caption=Free Birth Chart Calculator Tool
Top=112
Width=449
Left=16
Height=250
Label=Name,16,16
Label=Date of Birth,16,64
Edit=nm,16,32,121,
ComboBox=dt,16,80,145,1
Button=Submit,360,184,75,25,0
EndDialog>Dialog1

Show>Dialog1
wait>5

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1415
Joined: Sun Nov 03, 2002 3:19 am

Post by Dorian (MJT support) » Wed Dec 29, 2004 4:08 am

OK, I figured out from some examples on this forum to use %CRLF%. I now have a partial form which looks roughly like what I want. But when I use messagemodal to show me the selected items it gives me a list of everything in the drop down box. The %nm% variable just shows as %nm%, as it seems it's not assigining it whatever I put in the form field. What I am doing wrong? I know it's something simple due to my lack of understanding :

Dialog>Dialog1
Caption=Free Birth Chart Calculator Tool
Top=112
Width=449
Left=16
Height=250
Label=Your name,16,16
Label=Date,16,64
Label=Month,72,64
Label=Year,232,64
Edit=nm,16,32,121,
ComboBox=dt,16,80,40,1%CRLF%2%CRLF%3%CRLF%4%CRLF%5%CRLF%6%CRLF%7%CRLF%8%CRLF%9%CRLF%10%CRLF%11%CRLF%12%CRLF%13%CRLF%14%CRLF%15%CRLF%16%CRLF%17%CRLF%18%CRLF%19%CRLF%20%CRLF%21%CRLF%22%CRLF%23%CRLF%24%CRLF%25%CRLF%26%CRLF%27%CRLF%28%CRLF%29%CRLF%30%CRLF%31
Button=Submit,360,184,75,25,1
ComboBox=mn,72,80,145,January%CRLF%February%CRLF%March%CRLF%April%CRLF%May%CRLF%June%CRLF%July%CRLF%August%CRLF%September%CRLF%October%CRLF%November%CRLF%December
ComboBox=yr1,232,80,45,19%CRLF%20
ComboBox=yr2,272,80,45,01%CRLF%02%CRLF%03%CRLF%04%CRLF%05%CRLF%06%CRLF%07%CRLF%08%CRLF%09%CRLF%10%CRLF%11%CRLF%12%CRLF%13%CRLF%14%CRLF%15%CRLF%16%CRLF%17%CRLF%18%CRLF%19%CRLF%20%CRLF%21%CRLF%22%CRLF%23%CRLF%24%CRLF%25%CRLF%26%CRLF%27%CRLF%28%CRLF%29%CRLF%30%CRLF%31%CRLF%32%CRLF%33%CRLF%34%CRLF%35%CRLF%36%CRLF%37%CRLF%38%CRLF%39%CRLF%40%CRLF%41%CRLF%42%CRLF%43%CRLF%44%CRLF%45%CRLF%46%CRLF%47%CRLF%48%CRLF%49%CRLF%50%CRLF%51%CRLF%52%CRLF%53%CRLF%54%CRLF%55%CRLF%56%CRLF%57%CRLF%58%CRLF%59%CRLF%60%CRLF%61%CRLF%62%CRLF%63%CRLF%64%CRLF%65%CRLF%66%CRLF%67%CRLF%68%CRLF%69%CRLF%70%CRLF%71%CRLF%72%CRLF%73%CRLF%74%CRLF%75%CRLF%76%CRLF%77%CRLF%78%CRLF%79%CRLF%80%CRLF%81%CRLF%82%CRLF%83%CRLF%84%CRLF%85%CRLF%86%CRLF%87%CRLF%88%CRLF%89%CRLF%90%CRLF%91%CRLF%92%CRLF%93%CRLF%94%CRLF%95%CRLF%96%CRLF%97%CRLF%98%CRLF%99
EndDialog>Dialog1


Show>Dialog1

// stops the box popping up and disappearing immediately
wait>15

messagemodal>%Dialog1.nm%%CRLF%%Dialog1.dt%%Dialog1.mn%%CRLF%%Dialog1.yr1%%Dialog1.yr2%

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1415
Joined: Sun Nov 03, 2002 3:19 am

Post by Dorian (MJT support) » Wed Dec 29, 2004 4:49 am

aaah, i think i figured it out. this seems to work now.



Dialog>Dialog1
Caption=Free Birth Chart Calculator Tool
Top=112
Width=449
Left=16
Height=250
Edit=nm,16,32,121,
ComboBox=dt,16,80,40,1%CRLF%2%CRLF%3%CRLF%4%CRLF%5%CRLF%6%CRLF%7%CRLF%8%CRLF%9%CRLF%10%CRLF%11%CRLF%12%CRLF%13%CRLF%14%CRLF%15%CRLF%16%CRLF%17%CRLF%18%CRLF%19%CRLF%20%CRLF%21%CRLF%22%CRLF%23%CRLF%24%CRLF%25%CRLF%26%CRLF%27%CRLF%28%CRLF%29%CRLF%30%CRLF%31
ComboBox=mn,72,80,145,January%CRLF%February%CRLF%March%CRLF%April%CRLF%May%CRLF%June%CRLF%July%CRLF%August%CRLF%September%CRLF%October%CRLF%November%CRLF%December
ComboBox=yr1,232,80,45,19%CRLF%20
ComboBox=yr2,272,80,45,01%CRLF%02%CRLF%03%CRLF%04%CRLF%05%CRLF%06%CRLF%07%CRLF%08%CRLF%09%CRLF%10%CRLF%11%CRLF%12%CRLF%13%CRLF%14%CRLF%15%CRLF%16%CRLF%17%CRLF%18%CRLF%19%CRLF%20%CRLF%21%CRLF%22%CRLF%23%CRLF%24%CRLF%25%CRLF%26%CRLF%27%CRLF%28%CRLF%29%CRLF%30%CRLF%31%CRLF%32%CRLF%33%CRLF%34%CRLF%35%CRLF%36%CRLF%37%CRLF%38%CRLF%39%CRLF%40%CRLF%41%CRLF%42%CRLF%43%CRLF%44%CRLF%45%CRLF%46%CRLF%47%CRLF%48%CRLF%49%CRLF%50%CRLF%51%CRLF%52%CRLF%53%CRLF%54%CRLF%55%CRLF%56%CRLF%57%CRLF%58%CRLF%59%CRLF%60%CRLF%61%CRLF%62%CRLF%63%CRLF%64%CRLF%65%CRLF%66%CRLF%67%CRLF%68%CRLF%69%CRLF%70%CRLF%71%CRLF%72%CRLF%73%CRLF%74%CRLF%75%CRLF%76%CRLF%77%CRLF%78%CRLF%79%CRLF%80%CRLF%81%CRLF%82%CRLF%83%CRLF%84%CRLF%85%CRLF%86%CRLF%87%CRLF%88%CRLF%89%CRLF%90%CRLF%91%CRLF%92%CRLF%93%CRLF%94%CRLF%95%CRLF%96%CRLF%97%CRLF%98%CRLF%99
Label=Your name,16,16
Label=Date,16,64
Label=Month,72,64
Button=OK,21,128,75,25,1
Button=Cancel,117,128,75,25,2
Label=Year,232,64
EndDialog>Dialog1



Label>ShowWindow
Show>Dialog1,Button
Goto>%Button%






label>1
messagemodal>%Dialog1.nm%%CRLF%%Dialog1.dt% %Dialog1.mn% %Dialog1.yr1%%Dialog1.yr2%
goto>end

label>2
message>You cancelled out


label>end

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Dec 29, 2004 2:39 pm

Remember to make a Label Destination for those unplanned instances when someone closes the dialog window without making a proper set of choices.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1415
Joined: Sun Nov 03, 2002 3:19 am

Post by Dorian (MJT support) » Wed Dec 29, 2004 3:48 pm

That's a good idea, thanks Bob. I'll add those before I continue with the script.

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Wed Dec 29, 2004 9:51 pm

The difference you encountered (and obviously figured out) is the modal and non-modal dialog windows. The difference isn't in the "Dialog>" section, but rather the Show> section.

Show>MyWindow
"Non-Modal" (the window will be displayed, and the script will continue immediately)

Show>MyWindow,showres
"Modal" (the window will be created, and the script will only continue once you have closed the window or clicked on a button. The variable %showres% will contain the value of which button you took, or the action... X'ing the window is typically value 2.)

By the nature of this action, there are differences in how other commands will perform, depending of if the window is modal or non-modal. (For example: ResetDialogAction, and using/updating entries for combos, lists, etc.) I'll be playing with these differences some more in the near future and will request some help or change/updates from Marcus, including some additional components (or existing component abilities).

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts