MenuGroup

Form and theme XML code and CSS element selector

Inheritance diagram

Most commonly used form and theme properties

Associated ui methods

Influence and behavior

MenuGroup is a widget that contains a drop-down list with one or more menu commands, menu separators, and other menu groups.

Do not mix up menus created in Lycia Form Designer from MenuBars, MenuGroups, and MenuCommands, with menus created by the MENU statement.

MenuGroup as seen as seen in Lycia Form Designer:

Form XML code:

<MenuBar title="Menu bar" visible="true" identifier="c1">

  <MenuGroup text="Menu group" visible="true" identifier="mg1"/>

</MenuBar>

Theme element filter XML code:

<ElementFilter ElementName="MenuGroup">

  ...

</ElementFilter>

CSS element selector code:

.qx-aum-menu-group

Inheritance diagram:

Most commonly used form properties:

text

classnames

identifier

isExpanded

Most commonly used theme properties:

Background

New Background

Fill Color

Background Image

Background Style

Size

Location

Font:

New Font

Family

Bold  

Italic

Underline

Font Size

Fore Color

Image Id

Margin

Padding

Associated ui methods:

Create

ForName

SetMenuItems

GetMenuItems

SetImageId

GetImageId

SetIsExpanded

GetIsExpanded

SetText

GetText

SetOnStateChanged

GetOnStateChanged

Influence and behavior:

Menus have a reserved place in a window. You cannot place a MenuGroup anywhere you want - you can only insert it to a MenuBar or to another MenuGroup.

To add a MenuGroup to your form,

Step 1. Choose a MenuGroup in the widgets palette by left-clicking its icon.

Step 2. Move the cursor and drop the MenuGroup to the MenuBar or to the selected MenuGroup.

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

Step 4. Populate the MenuGroup with MenuCommands.

 

Most commonly used form properties of a menu group are text, classnames, identifier, and isExpanded.

Here you can find out how to change the text of the menu group in Lycia Form Designer:

Here you can find out how to change the widget text at runtime using ui methods.

 

At runtime, you can create and populate menu groups with ui methods.

To create a menu group at runtime,

Step 1. Create an .fm2 form that has a root container and a MenuBar.

Step 3. Bind this menubar to the variable of the ui.MenuBar datatype.

After this, you can populate this menu group with menu commands and then add it to your menu.

Try the example programs below to learn how it is done.

You can also use ui methods to change properties of a menu group:

CALL menugroup.setText("Menu Group")

CALL menugroup.setImageId("qx://application/bookmark.svg")

 

You can change the appearance of a menu group master and user themes and/or css styles.

property applied in the user theme:

theme XML code:

<?xml version="1.0" encoding="utf-8"?>

<StyleSheet xmlns="http://querix.com">

  <ElementFilter ElementName="MenuGroup">

    <StyleSheet>

      <DoStyleAction>

        <SetProperty>

          <PropertyPath>

            <PropertyName>Background</PropertyName>

            <PropertyName>FillColor</PropertyName>

          </PropertyPath>

          <PropertyValue type="CustomizedColor" RedColor="0" GreenColor="128" BlueColor="128" Alpha="255" />

        </SetProperty>

      </DoStyleAction>

    </StyleSheet>

  </ElementFilter>

</StyleSheet>

or

css code:

.qx-aum-menu-group {

background-color: teal;

}

runtime appearance:

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.