Toolbar

Form and theme XML code and CSS element selector

Inheritance diagram

Most commonly used form and theme properties

Associated functions and ui methods

Influence and behavior

Toolbar contains a number of buttons which are used to invoke actions.

Toolbar with 2 toolbar buttons and a separator inserted in a Grid panel as seen in Lycia Form Designer.

Form XML code:

<Toolbar visible="true" identifier="toolbarMain1">

   <ToolbarGroup visible="true" identifier="tbGroup2"/>

</Toolbar>

Theme element filter XML code:

<ElementFilter ElementName="Toolbar">

   ...

</ElementFilter>

CSS element selector code:

qx-aum-toolbar

.qx-aum-toolbar .qx-text

.qx-aum-toolbar .qx-image

Inheritance diagram:

Most commonly used form properties:

hideLabels

identifier

preferredSize

toolbarLocation

Most commonly used theme properties:

Background:

New Background

Fill Color

Background Image

Background Style

Size

Location

Toolbar Location

Associated functions:

fgl_setactionlabel()

fgl_getactionlabel()

fgl_setkeylabel()

fgl_getkeylabel()

fgl_dialog_setactionlabel()

fgl_dialog_getactionlabel()

fgl_dialog_setkeylabel()

fgl_keydivider()

fgl_dialog_keydivider()

fgl_setkeystatic()

Associated ui methods:

SetHideLabels

GetHideLabels

SetToolbarLocation

GetToolbarLocation

ui.Interface.loadToolbar

ui.Form.loadToolbar

Influence and behavior:

To add a Toolbar to your form,

Step 1. Choose a Toolbar from the widgets palette by left-clicking its icon.

Step 2. Select the place in the form where you want to put the Toolbar.

Step 3. Left-click the selected spot (cell or sector) to place the Toolbar there.

Step 4. The Toolbar is now added to your form, and you can see it in the Structure view.

 

Toolbar can be stored in form files and then applied to other forms and windows.

To create a Toolbar from a file,

Form without a toolbar:

Form with the loaded toolbar:

Toolbars added in such a way can be used in MDI containers.

 

 

At runtime, toolbars can be populated and manipulated with ui methods.

You cannot create a Toolbar widget by ui methods.

However, if you have already added a Toolbar widget to the form, you can populate it via ui methods:

DEFINE tb_group ui.ToolbarGroup

DEFINE tb_button ui.ToolbarButton

...

LET tb_group = ui.ToolbarGroup.Create("tbg","toolbar")

LET tb_button = ui.ToolbarButton.Create("bt1","tbg")

CALL tb_button.SetText("form button")

To make this newly created toolbar button able to trigger any actions, you must set the event for it:

DEFINE buttonEvent ui.BackgroundServerEventHandler

...

LET buttonEvent = ui.BackgroundServerEventHandler.Create()

CALL buttonEvent.SetCallBackAction("display")

CALL tb_button.SetOnInvoke(buttonEvent)

So the simple algorithm for populating toolbars by ui methods is this:

  1. Add a Toolbar widget to your form.
  2. Define variables of ui.ToolbarGroup, ui.ToolbarButton, and ui.BackgroundServerEventHandler data types in your 4gl code.
  3. Use the create() method to create a toolbar group.
  4. Use the create() method to create a toolbar button. Make sure that you have specified the correct toolbar group.
  5. Set the event for this toolbar button.

All the toolbar properties can be changed at runtime by ui methods.

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.