adjustable dialog

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
conjure
Pro Scripter
Posts: 64
Joined: Thu Jan 12, 2012 3:05 pm

adjustable dialog

Post by conjure » Wed Mar 16, 2016 1:30 pm

Is it possible to make an adjustable dialog?
In my example i have to exit the script and start it again if i need to show another similar dialog where it changes the Width,Height,Labels and Images.

Code: Select all

gosub>d3
srt>d2
Dialog>SplashScreen
   Caption=SplashScreen
   Width=600
   Height=75
   Top=up
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   Label=var1,60,0,true
   Label=var2,60,20,true
   Image=%Capture%,0,0,100,100,name
   Image=%Capture2%,0,20,100,100,name2
   

EndDialog>SplashScreen

  
END>d2
srt>d3
Dialog>SplashScreen
   Caption=SplashScreen
   Width=600
   Height=95
   Top=up
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   
   
   Label=var1,60,0,true
   Label=var2,60,20,true
   Label=var3,60,40,true
   Image=%Capture%,0,0,100,100,name
   Image=%Capture2%,0,20,100,100,name2
   Image=%Capture3%,0,40,100,100,name3

EndDialog>SplashScreen
END>d3

User avatar
JRL
Automation Wizard
Posts: 3531
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: adjustable dialog

Post by JRL » Wed Mar 16, 2016 2:02 pm

I see that you're using the dialog format that is from Macro Scheduler version 11 or earlier. Version 12 was released in 2010 and has a dialog format that is much easier to work with and much easier to make changes with though there is a learning curve if you are already used to the older format.

That said. The easiest way to deal with changing dialogs in the old format is to create multiple dialogs, a unique dialog for each situation, rather than having one that dynamically changes. Significant points for what you appear to want to do are:

- A "dialog block" is all the code between Dialog>Name and EndDialog>Name
- Each dialog block must have a unique name.
- The dialog block Name is case sensitive within the dialog block but not when called in the script.
- You can only call each dialog block one time in the script. So in your sample each subroutine can only be called once.
- You can Show>name and CloseDialog>name as often as you'd like.
- The "Caption" of the dialog blocks can all be the same, so the name that displays in the title bar can be the same.

If you insist on having dialogs that change dynamically, I'm sure that I've posted examples on the forum. Just search for JRL and Dialog and be prepared to do a lot of reading.

conjure
Pro Scripter
Posts: 64
Joined: Thu Jan 12, 2012 3:05 pm

Re: adjustable dialog

Post by conjure » Wed Mar 16, 2016 6:56 pm

Thank you JRL for your time and your answer.
I will read your posts.

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