Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6890 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Is it possible to write a script that changes the title of the window to the name of the layout without having to assign said script to every button on every layout? Conceptually, I am thinking of something that monitors what layout is being viewed and says "Ok, you've switched to layout X. Let me set the window title to X." Assigning such a script, manually, to every button that takes the user to a different layout is going to be like reading War & Peace in this instance, and is thus something I would like to avoid.

Thanks for reading!

Posted

Not if you do the scripted layout switching properly. Think Object Oriented.

All you need is one (1) script that switches layout. That scripts includes setting the window name. All your other scripts call that layout-switchting script instead of "goto layout"...

Posted

Not if you do the scripted layout switching properly. Think Object Oriented.

All you need is one (1) script that switches layout. That scripts includes setting the window name. All your other scripts call that layout-switchting script instead of "goto layout"...

I understand what you are proposing. However, at the moment, all of my buttons that take me to layouts are not scripts, they are simply buttons configured to Go to Layout with the desired layout specified. Hence, while what you are proposing makes sense, it means going back to every button and changing it from a simple one-action button to a script. What I've described in the previous sentence is what I would like to avoid. Is it possible to avoid it and achieve the desired result? If not, so be it.

Thanks for your response!

Posted

Just to note your button would still perform only 1 action, perform script. But I get your point, If you had 10 layouts that each held 10 buttons, 1 to go to each layout, then you would need to change the definitions of 100 buttons to Perform Script and as far as I can tell also add the Layout Name as a script parameter.

If space is not a big issue why not just add the layout name at the top of each layout manually? Another option might be to create a calculation for each table... LayoutName = Get(LayoutName) and put that field on each layout.

Posted

I'd do the work anyway. It will allow for more flexibility later (like if you want to check if the user had the necessary rights to go to that layout, or if you want to save some data before they move off,...).

Sooner or later you'll be forced to go this way I think.

Posted

Wim is right. If you script your layout changes (I do, but I know that many don't), this is easily accomplished. In fact, I have a generic Set Window script that opens a new window (if necessary), goes to the appropriate layout, checks the status bar, changes the title, sizes the window and centers it. I store the layout settings (such as whether to show the status bar, the Title for the layout, etc.) in a separate Layouts table.

Scripting your interface like this give you immense flexibility, and is easy once you get in the habit of using it. The more you script and manage, the easier it is if you ever want to publish this on the Web.

David

This topic is 6890 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.