Runtime Revolution
 
Articles Other News

Tabbed Property Editing in Galaxy

by Jerry Daniels

Property editing and script editing in Galaxy are really just two sides of the same coin. In fact, their user interfaces are similar enough that they use the same window and you can switch between them with a control+enter (scripts) or a control+shift+enter (properties). Both of these editors have Mozilla/Safari-like tabs, which, in the case of properties, can be used to get your editing done faster and with less anguish. Tabs are, of course, your friends.

A Tab Never Forgets

The Galaxy property editor approaches the concept of properties differently. Although you can quickly look at a particular property, see its value and change it quickly, it goes beyond the idea of just "inspecting" a property quickly. It is also a full-blown editor. This means you can see a lot or a little--a small set or properties with their values or many, many properties and their values. Before we start talking about using multiple tabs, lets chat about what you can do with just one tab and the data it shows.

Galaxy Properties showing selected properties and values for a button using its folders.

Properties are organized into folders which can be expanded or collapsed. Each property has its value showing as a link which can be clicked. Values that are multi-line or over 100 chars are truncated and have a "..." at their end. When a property value link is clicked, the interface for its editing is chosen based on the nature of the property itself.

TIP: Option-click (alt-click in Windows) a disclosure triangle next to a folder anywhere in Galaxy and it will perform its action on all folders in its list. E.g., option-clicking an open folder closes all folders.

Properties with "true" or "false" as their values simply toggle between those two values when you click them without any modifier keys. Properties possessing a finite number of values popup a menu of choices from which to choose. Color-oriented properties show a color picker, and properties with icons or patterns associated with them show an image picker. Lastly, properties with text content bring up a text editing dialog which, believe it or not, comes in quite handy when you start multi-tab editing.

Editing a value that is text in the text value editor dialog

Galaxy Properties saves these folder "views" for you constantly so whenever you edit the properties of an object later, it "remembers" what folder(s) you had open and what property you were editing. Updating the visible property values is another task Galaxy Properties does constantly. Just clicking a tab to view the properties of its associated object refreshes all values in the event they have been changed in scripts or in the message box. Changing a property value will also force all visible property values to be re-evaluated. For example, if you change the textColor of a button, its foregroundColor color will also reflect that change. In this way Galaxy Properties not only remembers your last view of an object's properties but also makes certain they're accurate and up-to-date.

Editing the backgroundColor value of a button using the color picker

You Decide What the Folders Are and What's in them

It is impossible to satisfy everyone with regard to which properties belong in which folders and in what order the folders should appear. Or is it? We decided to make a Folder editor so you, the user, can decide where to put what properties and in what order. If you get confused and want to start over, just click the "Restore to Default" button.

Choosing "Edit the Property Folders" from the Galaxy Properties action menu will produce the Property Folder Editor

In its default setting, the Property Folder Editor has every property for every object in a folder. There are place-holder folders for custom properties, global properties and global variables. When an object displays its properties, it fills these folder in with the appropriate property names and values. In the case of custom properties, there is a custom property folder for each custom property set. This makes the setting of custom property values very slick indeed.

Custom property folders are named after the array notation form of the custom property sets of an object

Part of our property editing philosophy is to facilitate the use of properties in scripts. By showing custom properties as you see above, you get a clear sense of how custom property array notation works. By using only real property names in other folders in the editor, you also get a leg up on learning how to use them in scripts.

Comparing the Property Values of Two Objects

Have you ever had two buttons that, for some reason, just don't behave the same? You think there's some difference between their properties that might be causing this, but you're not sure if that's the case, and what the offending properties and their values might be. Stop wondering and check this out...

Comparing the values of two objects using "nothing but tabs"

Here's how easy comparing values of two objects is to do:

  1. Edit the properties of button one (btn "refresh" in our example).
  2. Initiate this editing using any method of inspection or editing you like including Galaxy no-click inspection.
  3. Edit the properties of button two (btn "add bookmark")
  4. Shift-click on a non-active tab

That's all we did to get to this point. Any values that differ are shown in red. It becomes obvious here that button number two has its traversalOn property turned off. Here's the rule of thumb to sync a property: clicking the red value will transform it into the blue value after you OK this dialog...

Galaxy Properties' Compare Values Dialog phrasing the decision of the moment rather eloquently

Once you start comparing values, any opening of folders continues the comparisons. I bet you're thinking you can't compare a button to a stack, right? Wrong. Thanks to Troy Rollins, who beat on me to do this, you can compare the properties of any object to any other. The values that aren't capable of comparison show up as "[n/a]."

How to stop comparing values? Just click a tab or click the close link at the top of the property list.

Multi-Tab Editing Saves Time, Toil & Trouble

Here's how I like to do this: select the controls whose properties you'd like to set and then click the "Props" link on the Galaxy Bar. After doing this, you have a tab for each selected object. In this example, we want these objects to have the identical value for "top." This will align their tops, obviously. While this is not as cool as Scott Rossi's tm|align tool (www.tactilemedia.com), it's still pretty cool, and you can do it at home with the kids around.

Using the property value editor, you can apply a property value to all tabs

I bet you're wondering: "What if one of the tabs doesn't have that property?" Good question. If a tab's object doesn't have a property that's being set en masse like this, it won't get set. It gets skipped. What if a tab is there and you don't want it set to the value? Better close it then. Even with Galaxy you still have to use your brain occasionally.

Here's the question you should be asking: "How do I get a boolean value, for instance, to appear in this handy little dialog so I can set it for all tabs?" This brings us to tip number two:

TIP: Option-click (alt-click in Windows) any property value link and it will appear in the Property Value Editor with the "Apply to all tabs" check box.

Performance, Performance, Performance

People say, "Hey, there's a lot going on here with Galaxy, won't that slow things down in the IDE? Do I have enough memory?" We are now shipping v1.0.3 of Galaxy. Here's what we've done to become even leaner and meaner, performance-wise:

  1. All efforts to update tabs, property folders, or the edit states--as a result of renaming, deleting or creating objects in your scripts--is done asynchronously so that only the unique messages get executed after your scripts have run.
  2. Even the largest version of Galaxy is well under 5 MB. Even if everything is in memory twice due to buffering, that's barely 9 MB. Memory these days is in the Gigabyte range. You have enough memory.
  3. We don't run any externals so there's little chance of our standard transcript code causing a memory leak or the like.
  4. If you suspect Galaxy is causing some sort of mischief, there is a "Remove Galaxy" button in the preferences that produces a palette for removing or re-launching Galaxy.
  5. This is second generation of these components as they were done in Constellation and its Gadgets. We have cut the code involved by half. Our UI and code are solving even more problems with less lines of code and less effort from users.

Download Galaxy Free and see what you think.

©2005 Runtime Revolution Ltd, 15-19 York Place, Edinburgh, Scotland, UK, EH1 3EB.
Questions? Email info@runrev.com for answers.