II. GUI Basics
Chapter 6. Widgets - Using Widgets to Create Interfaces
Splitter
The Splitter widget divides a viewable panel into two panes.
The skeleton for creating a splitter is:
As you can see "pane1" will become the left view, pane2 will become the right view.
The splitter will have by default a vertical seperator. If you wished to split
the panes horizontally then you would set the attribute, setVertical="false"
Outlook View using Splitter widget
How would I go about creating the 3 pane look as seen in Microsoft Outlook.
The 3 panes are the "folder" pane, the "message" pane and the "preview" pane.
The first pane "folder" will be placed on the left view.
All we need to set is the width of the widget.
Instead of the ..Widget setName="folder" setWidth="80".., we
will replace it with the xml snippet below. Now for simplicity
we did not enclose the Listbox within a View tag, but
ideally this would be required.
-
-
-
The height of the 'folder' widget is managed by the splitter.
In this case, the 'folder' Listbox, sets its width to 80.
Now the 'message' view needs to have its height defined.
The splitter now divides the upper and lower views, ..Splitter
setVertical="false".., embedded in the previous Splitter's
right pane.
Let us make the 'message' a table, as shown below
The final 'preview' widget is a simple listbox.
What you should note is that everytime the splitter is resized it re-enforces the
height (or width) of the embedded widget panes, to fit the new size.
How many levels of splitters can we define?
There is no limit other than physically what can be displayed by the various
bars
Here is the xml script in full
-
-
-
Back
Next