Script UI Helpers

All things .jsx

Moderator: Paul Tuersley

Post Reply
vidpat
Posts: 86
Joined: October 21st, 2004, 12:36 am
Location: Phoenix, AZ
Contact:

There seems to be some interest in facilitating the building of UIs. I wrote the following scripts to overcome some of the limitations of Adobe's script UI implementation. Below you will find a brief description of each script. I make modifications to them as needed, so they are still rough and should be considered under development. Please see the file itself for more detailed comments and usage. I hope these are of use.

UILayout.jsx

Description:
A rudimentary layout manager for Adobe JavaScript UIs.

Usage:
Include this file in your script.
Using this layout manager, you needn't concern yourself with specifying
meaningful bounds for UI components as they are added.
Prior to calling show() (or center()) on the Window object to layout, call
layoutUI() passing a reference to the Window object. This will lay out
the component and its children.
This script adds properties to several standard UI components that offer
control over the layout.

Download UILayout.jsx


UIChooser.jsx

Description:
Implementation of a combobox-like chooser with available UI components.

Usage:
Include this file in your script.
When building a dialog Window, create an instance of ChooserUI passing a
reference to a Button in the Window. The Button text will indicate the
current choice. When clicked, a list of choices will appear allowing the
user to make a selection from the supplied choices.

Download UIChooser.jsx
Last edited by vidpat on April 28th, 2005, 11:41 pm, edited 1 time in total.
vidpat
Posts: 86
Joined: October 21st, 2004, 12:36 am
Location: Phoenix, AZ
Contact:

A while back I updated UILayout to provide more features and a more pleasing layout. The new and improved code should be compatible with any code using the previously available version.

New features include flow breaks and text layout that fits to the string length. Since there is no way to access the system font metrics, the script makes some assumptions about the dialog font. It has been tested on WinXP with standard appearance settings. Thus, it may need to be adjusted for other platforms and configurations. If you find that you need to change values to work on your configuration, please let me know and I'll update the script for future versions to use these values when appropriate.

I haven't tested this version as rigorously as the previous one. Please feel free to report any bugs, et cetera.

I refer you to the script's comments for usage, information on new features (denoted with "** As of 1.3"), and modifications you can make to the LM's defaults.

Download UILayout_13.jsx
knubile
Posts: 8
Joined: May 18th, 2006, 10:25 pm

I can confirm this script works as is in CS3 when executed the usual way.

Can anyone confirm if they have managed to get this to work when trying to use it to layout a dockable panel(installed in ScriptUI Panels folder)?

I get no errors. My panel loads, but they're not laid out. All up against the left edge.
Post Reply