No subject

Stefan Matthias Aust sma at 3plus4.de
Thu Feb 24 20:34:05 UTC 2000


[Some time ago, I wrote this text but never finished it or really started
working on this.  But because of the recent discusion about UIs, I decided
to post it anyway.  Comments are welcome]

Some random thoughts about GUIs. Currently, Squeak features two different
ways of creating a graphical user interface: MVC and Morphic. IMHO both are
still not ready for developing modern GUI applications. I'd even say that
both system have design flaws that make it difficult if not impossible to
evolve the frameworks towards that goal. The polling of MVC is just one
example here.  Therefore I propose a different approach that combines the
good aspects of both systems and also adds proven concepts from other UI
frameworks.

The new UI framework should be small, fast, easy to understand, simple to
extend and still powerful.

Everything in this UI is based on lightweight base objects called UiParts.
They're very similar to Morphs but with less functionality. A part cannot
contain other parts, a UiBox can. Everything is contained in a UiScreen, a
subclass of UiBox.

Each part has a deployment mode and a design mode. In design mode, you can
manipulate UIs created from parts as in Morphic. You can globally disable
the design mode and otherwise toggle it by window.

Each box has a UiLayouter that arranges parts placed in that box. By
putting boxes into boxes you can create even the most complex layout. The
layouter will also shrink and grow parts and honors preferred sizes.

Each part can have a custom popup menu, a balloon help text and provides a
standard set of events. The standard way of creating UI applications is to
wire (although non-graphical by Smalltalk messages) these events to custom
methods.

UiLabel - a static part that combines a text and/or an image. It can wrap
multi-line text if needed. 
UiButton - an abstract class for all kinds of buttons. Buttons feature
different labels for different button states.
UiActionButton - this button issues a command if pressed.
UiToggleButton - this button changes state if pressed. Different version
are for check boxes and radio buttons.
UiInputBox - displays a text - either one or multiple lines - and allows
the user to edit this text. 
UiScrollBox - displays a clipped view of the embedded part and scrollbars
to change that view.
UiListBox - displays a vertical list of other objects and allows the user
to select one or more objects. A cell renderer object will provide a part
view for each object.
UiGridBox - displays a tabular set of other objects and allows the user to
select one or more objects. A cell renderer object will provide a part view
for each object.
UiTreeBox - displays a hierarchical list of other objects and allows the
user to select one or more objects. The user can also expand and collapse
entries. A cell renderer object will provide a part view for each object.
UiTabbedBox - displays a set of tabs from which the user can choose one to
display one of a set of embedded parts.
UiMenuBar, UiMenuButton, UiMenuBox, UiMenuItem - support for hierarchical
popup menus and pull down menus. Selecting a menu item issues a command.
UiWindow - an abstract class for all kinds of windows, overlapping regions
on the screen.
UiPopupWindow - a transient window that automatically closes if needed.
UiFramedWindow - a typical window with border, frames and handles.

Each component shown so far gets its data from a model. Changing the models
automatically updates the UI. Events are used to bind custom actions to
user interactions. Typical events are: #mouseDown, #mouseUp, #mouseClicked,
#keyTyped, #mouseEntered, #mouseExited, #gotFocus, and #lostFocus. Events
are dispatched from a central event source to every window and from every
window to the active part. This two-step approach will allow multiple host
windows eventually.


bye
--
Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf.





More information about the Squeak-dev mailing list