GUI Builder

Top  Previous  Next

GUI Builder is the part of AggreGate Client that is used to edit widget templates or build widgets from scratch.

Main Window

GUI Builder always opens in a separate window:

cl_gb_main_window

The main window has several primary components:

Main Menu
Toolbar
Work Form
Resource Window
Entity Selector
Component Palette
Component Properties Window

Most components in GUI Builder are implemented as dockable panes and may be removed, resized, docked/undocked, put into tabs etc. For more information, see Customizing Dockable Panes.

Main Menu

There are two menus in GUI Builder: File and View.

cl_gb_main_menu

File Menu

New Template. Clears the template of the widget currently being edited.
Open Template. Loads a new widget template from file. The template currently being edited will be lost.
Save Template to File. Saves the currently edited template to file.

View Menu

Items in this menu may be enabled or disabled. They are used to show or hide different parts of GUI Builder.

Resource Window. Toggles Resource Window.
Palette Window. Toggles Component Palette.
Properties Window. Toggles Component Properties Window.
Entity Selector Window. Toggles Entity Selector.

Help Menu

Open GUI Builder help. Opens GUI Builder documentation in browser.
Open Widgets help. Opens widgets documentation in browser.

Toolbar

Provides quick access to commonly used operations:

gb_done

Done. Finishes editing of widget template and saves changes to the LinkServer.

gb_cancel

Cancel. Stops editing and abandons any changes.

gb_toggle_borders

Toggle Decorations. Enables or disables decorations of panel layout grid cells. See cell decorations for details.

gb_undo

Undo. Discards previous operation. This function has global keyboard shortcut: Ctrl-Z.

gb_redo

Redo. Repeats previously undone operation. This function has global keyboard shortcut: Ctrl-Y.

gb_run

Run Widget. Runs the widget currently being edited, for testing.

gb_fill_horizontal

Fill Horizontal. Toggles horizontal fill of currently selected component. Available for components that are located in container with Grid Layout.

gb_fill_vertical

Fill Vertical. Toggles vertical fill of currently selected component. Available for components that are located in container with Grid Layout.

gb_anchor_center

Set anchor of currently selected component to Center. Available for components that are located in container with Grid Layout.

gb_anchor_n

Set anchor of currently selected component to North. Available for components that are located in container with Grid Layout.

gb_anchor_e

Set anchor of currently selected component to East. Available for components that are located in container with Grid Layout.

gb_anchor_s

Set anchor of currently selected component to South. Available for components that are located in container with Grid Layout.

gb_anchor_w

Set anchor of currently selected component to West. Available for components that are located in container with Grid Layout.

gb_anchor_nw

Set anchor of currently selected component to North-West. Available for components that are located in container with Grid Layout.

gb_anchor_ne

Set anchor of currently selected component to North-East. Available for components that are located in container with Grid Layout.

gb_anchor_se

Set anchor of currently selected component to South-East. Available for components that are located in container with Grid Layout.

gb_anchor_sw

Set anchor of currently selected component to South-West. Available for components that are located in container with Grid Layout.

gb_align_top

Align selected components by their top edge. Available for components that are located in container with Absolute Layout.

gb_align_bottom

Align selected components by their bottom edge. Available for components that are located in container with Absolute Layout.

gb_align_left

Align selected components by their left edge. Available for components that are located in container with Absolute Layout.

gb_align_right

Align selected components by their right edge. Available for components that are located in container with Absolute Layout.

gb_align_horizontal_axis

Align selected components to horizontal axis by their center. Available for components that are located in container with Absolute Layout.

gb_align_vertical_axis

Align selected components to vertical axis by their center. Available for components that are located in container with Absolute Layout.

gb_same_width_min

Set width of all selected components equal to the minimal width of them all.

gb_same_width_max

Set width of all selected components equal to the maximal width of them all.

gb_same_height_min

Set height of all selected components equal to the minimal height of them all.

gb_same_height_max

Set height of all selected components equal to the maximal height of them all.

Work Form

The work form is used to preview widget layout during construction and editing. This is the main part of the GUI Builder window.

The work form always displays the core container of a widget - its root panel. If is contains any child components or containers, the entire hierarchy is shown in the work form. In other words, when cell decorations are disabled, the widget in the work form closely resembles what it'll look like when actually running in AggreGate Client.

You can put new components on the work form, move components within current container or to other containers, resize components and change their margins, create new bindings etc. See editing widget layout for details.

Here is what the work form looks like when editing a widget template:

cl_gb_work_form

Components in GUI Builder look similar to what they'll look like when the widget is executed in AggreGate Client, with some differences:

1. Most user input is ignored (e.g. buttons are not visually "pressed" when user clicks on them).

2. If Toggle Decorations button (see below) is pressed all containers have borders showing their titles:

ls_widgets_contaner_title

3. Empty cells in a Grid Layout are visually represented by white bordered rectangles.

ls_widgets_empty_cells

note_further-wt

The borders of these rectangles are used for resizing GUI components and defining their borders. For further details on how to use the borders, see Editing Widget Layout.

Cell Decorations

When a cell of a Grid Layout is shown in a work form, it may have additional decorations. These decoration make it easier to edit the layout, but make the widget appear different then what it looks like during normal execution. You can toggle them using the Toggle Decorations button in GUI Builder toolbar.

Additional visible elements shown when decorations are enabled:

1. Empty cells of Grid Layout are shown as white rectangles.
2. Every cell of Grid Layout has a border, to help find separate and joined cells.
3. Containers have title borders showing their names. If a container has multiple panes, each pane also gets a title border with its name.

Here is what the same panel with grid layout looks like, with and without decorations:

Without decorations:

cl_gb_decorations_off

With decorations:

cl_gb_decorations_on

In the Absolute Layout, every component is decorated by a border helping to view its margins:

cl_gb_decorations_absolute

Resource Window

The resource window contains a tree of widget components and other objects (i.e. Button Groups). The root panel forms the root node of the tree. Normal components and containers are shown as nodes with different icons. Components held by a container or a pane (i.e. in the case of a Layered Panel) are shown as its child nodes.

cl_gb_resources

The resource tree may be used for selecting components and panes of multi-pane containers. When a component or pane is selected in the resource window, it is also selected in the work form. Its properties are shown in the Component Properties Window.

cl_gb_component_renaming

Context Menu Of A Resource Tree Node

The context menu for a resource has the following operations:

Copy. Copy the reference to the widget component to the clipboard as a string. This reference may later be inserted in the binding.

Rename. This is the only way to change the name of a component, container or pane. The name is used to refer to the component in bindings.

Delete. Permanently delete the selected node (container, component or pane). The context menu for a node may also contain some component-specific operations. For example, the context menu for a Tabbed Panel node contains an Add Tab item. Similarly, the Button Groups node has an Add Button Group operation.

Clone. Make a copy of the component.

If selected node is a container, its context menu also has a Create submenu used to create a new widget component in this container.

note_further-wt

The same menu appears when right-clicking a component in a Work Form.

Drag-and-Drop Operations

The resource tree supports the following Drag-and-Drop operations:

If a component is dragged from a component palette and dropped on a container's node with Grid Layout, a new component is placed on the first free cell in the component's grid. If the container has no free cells, a new cell is created.
If a component is dragged from a component palette and dropped on a container's node with Absolute Layout, a new component is placed at position X=0, Y=0.
If a component is dragged from the work form and dropped on another component in the work form or resources tree, they exchange places.

Entity Selector Window

The entity selector window lets you browse the LinkServer context tree and see all available variables and functions with their fields. The default context defined during widget editing and all its children are marked in bold.

cl_entity_selector_2

The entity selector is mostly used for creating new bindings. See creating bindings for details.

Component Palette

The component palette is used to add new components to the widget layout by dragging and dropping them on the work form or on a container in the resource window. The palette has two tabs:

Components. Contains all normal components.
Containers. Contains all containers.

cl_gb_component_palette

See the editing widget layout section for more information on how to use component palette to add new components to the widget layout.

Component Properties Window

This window contains a properties editor used to change the properties of the currently selected component.

cl_gb_component_properties

When properties are changed, changes are saved immediately. There's usually no need to click the Save button in the Properties Editor toolbar.

note_warning-wt

If a new property value cannot be automatically saved (e.g. because it was filled with an invalid value, such as a negative width, for example), the status of this property is set to "Modified" in the Properties Editor. Modified properties are highlighted in dark grey, and you have to correct them and then click the Save button in the toolbar to save them. If such explicit saving fails, an Error Dialog pops up, describing the problem.

Properties Editor article has more information on using the Properties Editor. Component properties are described in the component reference.

Editing Widget Layout

note_further-wt

Before reading this section make sure that you read and understood how widget layout is organized.

note_tip-wt

The effect of all operations described in this section may be obtained by manually editing the constraints of widget components.

note_tip-wt

It's possible to clone component by moving it to another location with the mouse when Alt key is pressed.

Editing Grid Layout

You can use Drag-and-Drop to add new components from the component palette or to move and resize components already laid out on the work form.

A component may be dropped...

1. On an empty cell in the layout grid,
2. Over an existing component,
3. On a drop zone, causing automatic creation of new row and/or column in the panel layout grid, or
4. On a drop zone leading to the implicit creation of a new Panel.

1. Dropping on an empty cell

When a component is dragged onto the work form and the mouse hovers over an empty cell (one marked with a white background, if decorations are enabled), the cell is highlighted in blue:

cl_gb_drop_to_empty_cell

Dropped here, the component will occupy the empty cell.

2. Dropping over an existing component

You can drag an existing component from its location on the form and drop it onto another component. The two will swap places, even if they are located in different containers. This obviously doesn't work with new components dragged from the palette.

cl_gb_drop_over_existing_component

The third and fourth aforementioned methods work similarly. The component being dragged is dropped inside a cell already occupied by some component, but not directly over the component. Each cell occupied by some component (label1 in the following picture) has 16 available drop locations:

cl_gb_drop_zones

Dropping the component over one of the first eight locations (illustrated in yellow in the example above) puts it into a new row and/or column of the layout grid. More on this in the description for method 3, below.

Dropping the component over locations 9-16 (green, above), creates a new Panel container in the cell occupied by label1. This panel will now hold two components: label1 and the component that was dropped. More on this below, in the description of method 4.

3. Dropping on locations 1-8

If the component is dropped on the locations 1-8 (shown in the image above), it will be put in the layout grid of label1's container (the root panel, in our example). A new row and/or column will be created in the layout grid to hold the dropped component. When the mouse hovers over the 1-8 drop locations, "ghost" frames are shown to help visualize where the new row and/or column will be located. Here is what it looks like when the mouse is held over location 5:

cl_gb_suggestion_1

If we now drop the new component, a new column will be created to the right of label1:

cl_gb_suggestion_2

Hovering over location 8 shows the following "ghost" frames:

cl_gb_suggestion_3

In the above case, the new component will be placed on a new row and column created to the bottom and to the right of label1. As a side-effect, two empty cells will be created:

cl_gb_suggestion_4

This is what the "ghost" frames look like in a more complicated layout:

cl_gb_suggestion_5

This is what this layout looks like once the component is dropped:

cl_gb_suggestion_6

4. Dropping on locations 9-16

Dropping on these locations creates new a Panel in the cell. This panel will then contain two components: label1 and the component dropped. Their relative positions in the new panel will depend on where the new component is dropped. "Ghost" frames are also shown when the mouse hovers over these locations while dragging. Here is the "ghost" frame for location 13:

cl_gb_suggestion_7

If the component is dropped on this location, a new panel will be created, containing two cells in one row:

cl_gb_suggestion_8

For location 16, "ghost" frames show that the new panel will contain four cells. label1 will be placed in row 1, column 1, while the dropped component will be placed in row 2, column 2:

cl_gb_suggestion_9

Here is what the new panel will look like:

cl_gb_suggestion_10

Resizing COMPONENTS and editing THEIR margins

When a component is selected in the work form, it has a blue dashed border with blue and green dots used to resize it or edit its Grid Layout margins:

cl_gb_resize

To resize the component, drag the blue dots. To change its margins, drag the green dots. When margins are set to non-zero values, they are drawn as green dashed rectangles around the component:

cl_gb_margins

note_tip-wt

Holding Shift key during component resize will cause it to preserve its proportions.

Holding Alt key during resize will resize component relatively to its center instead of its top-left point.

note_further-wt

The Root panel never has margins (it must occupy all available space in the widget window).

Editing Absolute Layout

Editing an absolute layout is much easier than editing grid layout. Move the components using the mouse, and their X and Y Coordinates will be updated properly. Use keyboard arrow keys for precision moving.

It is possible to resize any selected component using the mouse. Simultaneous moving/resizing of multiple selected components is also supported.

Creating Bindings

GUI Builder helps create widget bindings using intuitive drag and drop operations: You can drag a node from the Entity Selector onto a component or container in the Work Form or in the Resource Window.

PREVIEW OF BINDINGS TO BE CREATED

When a node is dragged from the entity selector onto the work form and the mouse is held over a form component, bindings that will be created if the component is dropped are shown in a red tooltip. The left part of the binding (before the "=" character) is binding target, while the right part is the binding expression:

cl_gb_bindings_helper

If the node is then dropped onto the component, the bindings created are shown in the popup window:

cl_gb_bindings_created

Drag and Drop Operations Between Entity Selector and Work Form

1. Dragging a variable field and dropping it on a component

In this case, two bindings are created:

A binding that reads the variable field on startup and reset event of the root panel and writes it to the component's default property.
A bindings that writes the value of the component's default property back to the context variable upon the submit event of the root panel.

cl_gb_bindings_1

2. Dragging a function input field and dropping it on a component

This operation creates one binding. Its target is a function's input field. Its expression is a reference to the default property of widget component. Its Activator is the root panel's submit event.

cl_gb_bindings_2

3. Dragging a function output field and dropping it on a component

This operation also creates a single binding with a target pointing to a property of the component. The binding expression is a reference pointing to the output field of the function. Activator of this binding is submit event of the root panel.

cl_gb_bindings_3

4. Dragging a variable to the Data Table Editor component

This operation creates three bindings:

A binding that reads the variable value on widget startup and writes it to the default property of the Data Table Editor, i.e. the table this editor operates on.
A binding that writes the table contained in the Data Table Editor back to the context upon the submit event of the root panel.
A binding that sets the Enabled property of the Data Table Editor according to the Writable property of the variable definition, to make sure that value of read-only variables can't be edited.

cl_gb_bindings_4

5. Dragging a function to a Button component

This operation does not actually create new bindings. Instead, it finds all widget bindings:

Whose target points to the input field of this function, or
Whose expression contains references to the output fields of this function

and sets their activators to the action event of the button component. This makes them working together within one bindings processing session that is started upon button click (when action event is fired).

If a widget has no bindings related to the input or output fields of the dragged function, this drag and drop operation won't be allowed.

6. Dragging a variable field to a button group

This operation creates three bindings, which let you use the buttons in the group to change the field's value:

cl_gb_bindings_5

If the field has selection values, this operation also changes the Value property of all radio buttons that belong to the group to the available selection values. If you have 5 selection values (for example) yet only 3 radio buttons, only the first 3 values will be used - no error will be shown.

7. Dragging a variable field to Combo Box or List

This creates the same bindings as in 1 above (Dragging A Variable Field And Dropping It On A Component), but adds an extra binding whose purpose is to display the selection values defined by the field format in the combo box or list.

8. Dragging a Device Context and dropping it to any container

This drag and drop operation created a new Device component in the target container. The new component will have labels showing basic status of the dropped Device. It will also have a pre-defined Status Table configured to indicate current device connection status (Online, Offline or Suspended).

A binding linking server-side device status to the Status parameter of device component is also created.