Converting 7.0 window to CS3 panel using UILayout

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
knubile
Posts: 8
Joined: May 18th, 2006, 10:25 pm

Edit: I just realized the issue is the new addUI method added by UILayout.
It doesn't seem to work when run from the ScriptUI Panels from the windows menu.
/Edit

I have an AE7 script that creates a window, adds a variety of UI elements to it and shows the window.

This script works as is in CS3 if I launch it, but fails if I put it in the ScriptUI Panels folder to try to make it a dockable panel.

It fails at the following line.

Code: Select all

 win.checkboxCreateMap = win.panelCreateCheckBoxes.addUI('checkbox', 'Map');
The win object is declared like this as per Adobe's recommendation.

Code: Select all

var win = thisObj instanceof Panel ? this : new Window('palette', 'Options',[300,100,750,433]); 
If its a panel it uses "this". If its run as a script, it generates a new window.

It complains that the "addUI" method doesn't exist.

I looked in the documentation and "add" is the name of the method(is this new?), so I changed it to add.

Now it complains my parameters are incorrect.

How can I change my ui building method to work as both a window and a dockable panel?

I can't get it to work as a panel at all.

Any help would be great.
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

hi knubile,

i've never used UILayout.jsx, but add() has always been the method for adding controls to a Window object. addUI() looks like something specific to UILayout's own layout manager. you might need an update from UILayout's author (Peter Torpey?) to get it to work in CS3 with dockable panels.

note that CS3 adds support for defining a UI via resource string, so stuff like alignment and auto-resizeability are much simpler now. (all of the recent updates on my redefinery.com site use it.) if you're using a UI layout helper script like UILayout, you'll need to get it updated, unless you want to code "closer to the metal."

:jeff
Post Reply