VB - Visual Builder for the Prima toolkit |
VB - Visual Builder for the Prima toolkit
Visual Builder is a RAD-style suite for designing forms under
the Prima toolkit. It provides rich set of perl-composed widgets,
whose can be inserted into a form by simple actions. The form
can be stored in a file and loaded by either user program or
a simple wrapper, utils/fmview.pl
; the form can be also stored as
a valid perl program.
A form file typically has .fm extension, an can be loaded
by using the Prima::VB::VBLoader manpage module. The following example
is the only content of fmview.pl
:
use Prima qw(Application VB::VBLoader); my $ret = Prima::VBLoad( $ARGV[0] ); die "$@\n" unless $ret; $ret-> execute; and is usually sufficient for executing a form file.
The builder provides three main windows, that are used for designing. These are called main panel, object inspector and form window. When the builder is started, the form window is empty.
The main panel consists of the menu bar, speed buttons and the widget buttons. If the user presses a widget button, and then clicks the mouse on the form window, the designated widget is inserted into the form and becomes a child of the form window. If the click was made on a visible widget in the form window, the newly inserted widget becomes a children of that widget. After the widget is inserted, its properties are accessible via the object inspector window.
The menu bar contains the following commands:
This command is an alias to a 'new file' icon on the panel.
This command is an alias to an 'open folder' icon on the panel.
Once the user assigned a name and a type for the form, it is never asked when selecting this command.
This command is an alias to a 'save on disk' icon on the panel.
Bring to front Send to back Step forward Step backward Restore order
tabOrder
property is left to its default
value, so it is assigned according to the order of widget creation.
Ctrl+mouse click locks and unlocks a widget.
fmview.pl
.
The execution session ends either by closing the form window
or by calling Break command.
This command is an alias to a 'run' icon on the panel.
The form widget is a common parent for all widgets, created by the builder. The form window provides the following basic navigation functionality.
shift
key while clicking on a widget. This combination
also deselects the widget. To select all widgets on the form window,
call Select all command from the menu. To prevent widgets from being
occasionally selected, lock them with ``Edit/Toggle lock'' command or
Ctrl+mouse click.
origin
property.
If the Tab
key is pressed during the move, the mouse pointer is changed
between three states, each reflecting the currently accessible coordinates for
dragging. The default accessible coordinates are both the horizontal and
the vertical; other two are the horizontal only and the vertical only.
size
property.
The alternative context menus can be provided with some widgets ( for
example, TabbedNotebook
), and are accessible with control + right click
combination.
The inspector window reflects the events and properties of a widget. To explicitly select a widget, it must be either clicked by the mouse on the form window, or selected in the widget combo-box. Depending on whether the properties or the events are selected, the left panel of the inspector provides the properties or events list, and the right panel - a value of the currently selected property or event. To toggle between the properties and the events, use the button below the list.
The adjustable properties of a widget include an incomplete set of the properties,
returned by the class method profile_default
( the detailed explanation
see in the Prima::Object manpage). Among these are such basic properties as origin
, size
,
name
, color
, font
, visible
, enabled
, owner
and many others.
All the widgets share some common denominator, but almost all provide their own
intrinsic properties. Each property can be selected by the right-pane hosted property
selector; in such case, the name of a property is highlighted in the list - that means,
that the property is initialized. To remove a property from the initialization list,
double-click on it, so it is grayed again. Some very basic properties as name
can not be deselected. This is because the builder keeps a name-keyed list; another
consequence of this fact is that no widgets of same name can exist simultaneously
within the builder.
The events, much like the properties, are accessible for direct change.
All the events provide a small editor, so the custom code can be supplied.
This code is executed when the form is run or loaded via Prima::VB::VBLoader
interface.
The full explanation of properties and events is not provided here. It is
not even the goal of this document, because the builder can work with the
widgets irrespective of their property or event capabilities; this information
is extracted by native toolkit functionality. To read on what each property or
event means, use the documentation on the class of interest; the Prima::Widget manpage is a good
start because it encompasses the ground Prima::Widget
functionality.
The other widgets are ( hopefully ) documented in their modules, for example,
Prima::ScrollBar
documentation can be found in the Prima::ScrollBar manpage.
Prima, the Prima::VB::VBLoader manpage
Dmitry Karasik, <dmitry@karasik.eu.org>.
This program is distributed under the BSD License.
VB - Visual Builder for the Prima toolkit |