Window Controller

Overview Using Installing Details

Window Controller is driven via a script that takes multiple parameters. To pass these parameters I use a set of custom functions. You need three: Option, Get Option, and Parameter. You may as well copy Set Option and Result, although they're not used. If you use another way to pass multiple parameters (e.g. the one from SixFriedRice), go on and replace these functions. Only Option and Parameter functions are used by scripts; the Get Option is called by Parameter.

Copy custom functions

  1. Option( key, value )

  2. Get Option( options, key )

  3. Set Option( options, changed options )

  4. Parameter( key )

  5. Result( key )

  6. Pressed( key code )

  7. Set Contains( set, subset )

  8. Get Original Window Name( window name )

  9. Get Window Suffix( window name )

Copy value lists

  1. Window Size Unit

  2. Window Size Zoom

  3. Window Size Status Toolbar

  4. Window Size Status View

  5. Window Size Options

  6. Alignment ID, Name; use the following settings:

  7. Alignment Reference

  8. Alignment Horizontal Proxy

  9. Alignment Horizontal Point

  10. Alignment Vertical Proxy

  11. Alignment Vertical Point

Window Size Name and Alignment Name are used only in the demo file and are not necessary for the controller itself.

Copy tables

  1. Copy Window Size, Window Alignment and Window Settings tables. These are data tables, they don't depend on anything from external tables.

  2. Add a new TO for Window Alignment and call it Default Alignment. Establish a relationship from Window Size::Alignment ID to Default Alignment::ID:

You probably have a single-record table in your applicaiton already. If not, add one; I typically call it System. In order not to break anything we'll copy fields one by one.

  1. Copy and paste User, Item, and Window fields into the System table

  2. Establish a relationship from System::Window to Window Size::Name

  3. Establish a relationship from System::User, System::Window and System::Item to Window Settings::User, Window Settings::Window and Window Settings::Item.

  4. Copy and paste the Alignment field.

  5. Establish a relationship from System::Alignment to Window Alignment::Name

  6. Copy and paste remaining fields: Window Controller, Width, Heihgt, Top, Left, Status Area, Zoom.

Copy layouts

  1. Make sure you have layouts System, Window Size, Window Alignment and Window Settings. If you used your own table as System you might need to rename an existing layout; you can rename it back after you paste scripts. Note that layout names are case sensitive.

  2. Switch the Window Size layout into list view and set layout parts to: header: 41 px; body: 106 px; trailing grand summary: 19 px.

  3. Switch the Window Alignment layout into list view and set layout parts to: header: 41 px; body: 121 px; trailing grand summary: 19 px.

  4. Add an empty layout Demo, Test. Link it to Window Size table. Make it blank, small and use some background you like.

Copy scripts

Copy layout elements

  1. Copy and paste layout elements from the Window Size layout. Delete the Demo tab.

  2. Copy and paste layout elements from the Window Alignment layout. Delete the Demo tab.

You should be ready to use the controller. The demo file also has a customized menu, but you cannot easily copy it. The menu doesn't contain anything specific, only renamed New Record, Duplicate Record, Delete Record and browse commands commands. The only custom command is Test, but it has a button.

blog comments powered by Disqus