Some hack you just found and want to tell to others

Extending the UIPainter ?

Postby cgittinger » 4. Dec 2008, 12:20

Here is a question I got via mail from Jakub Reznicek in Prague:


I'm a doing a little project in SmallTalk/X and I've created a component for GUI. Now I'd like to add it into the Widget Gallery in GUI Painter but I do not know where to start - can you give me a hint please?

I've found some classes that might be somehow connected with UIPainter but nothing helped, for example:
Interface-UIPainter
UIPainterView
group&ungroup
groupSelectionWithLayout

and there are some widgets that I see in the gallery but If I change it, nothing happens.

Thanks a lot in advance, Jakub Reznicek, student CTU Prague
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05

Re: Extending the UIPainter ?

Postby cgittinger » 4. Dec 2008, 12:21

Hello Jakub,

look at the
Code: Select all
UISelectionPanel::UserDefinedGallery
class.
You should invoke the public interface: "
Code: Select all
addUserSpecHolder:aValueHolder label:aLabelString
" from your application (or some installer).
This adds a complete page to the gallery (see a sample caller in
Code: Select all
FileBrowserV2UISpecifications >> setup
).
An alternative is to edit the existing default gallery directly, for example by adding another spec to the "user defined gallery" protocol.
You may have a chicken-egg problem, because you would like to use the UIPainter to edit those specs, but you cannot add your new widgets yet.
So what we do is to add an empty view first, using the UIPainter, then edit the spec manually in the browser and replace the spec-class-name by the new widget.

I hope that helped, best regards,
Claus
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05

Re: Extending the UIPainter ?

Postby cgittinger » 15. Jan 2009, 14:15

By the way, something that might be very inspiring for some of you:

we do have a customer (Werner - are you reading this ?) who created an Editor for Factory-Control and Process-Monitoring GUIs (the stuff you see in the plants, with blinking valves, pipes, switches and so on).

He subclassed the GUI Painter, added many, many pages containing 100's of new widgets, icons and symbols. Most of his widgets are not inheriting from View, but from VisualComponent (which is more lightweight).

His widgets support valueholders to control almost any aspect of the look and feel (size, position, rotation, colors etc.). He also has a "special" valueHolder class, whose instances are directly connected to his factory-process variables. This allows for factory engineers to very easily create their own GUIs. In minutes, they drag&drop fancy process-visualizations.
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05

Re: Extending the UIPainter ?

Postby cgittinger » 7. Mar 2009, 10:57

...and, you will also find a modified UIPainter in our "expecco" product (pro version). There, you can create UIs and use them as steps of an activity diagram. In this setup, we have changed the UI-editor to connect widget value-holders to input- and output pins of an activity diagrams action-step.
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05


Return to Tips and Tricks

Users browsing this forum: No registered users and 1 guest

Design by GB