Category Archives: Menu

Setting a variable row height on an MX MenuBar control in Flex

The following example shows how you can set a variable row height on an MX MenuBar control in Flex by listening for the menuShow event, setting the Boolean variableRowHeight property on the MenuEvent object’s menu property, and then calling the invalidateSize() method.

Continue reading Setting a variable row height on an MX MenuBar control in Flex

Displaying icons in a Flex PopUpButton control (Redux)

In a previous example, “Displaying icons in a Flex PopUpButton control”, we saw how you could add icons to a PopUpButton control’s nested menu using an Array data provider.

The following example shows you how you can add icons to a pop up menu in a PopUpButton control in Flex by specifying the iconField property in the PopUpButton control’s nested Menu control using an XML data provider.

Full code after the jump.

Continue reading Displaying icons in a Flex PopUpButton control (Redux)

Adding a horizontal separator to a Flex PopUpButton control’s pop up menu (redux)

In a previous example, “Adding a horizontal separator to a Flex PopUpButton control’s pop up menu”, we saw how you could add a horizontal separator to a PopUpButton control’s pop up menu in Flex by setting the type attribute to “separator” in the menu’s data provider.

The following example shows how you can adjust the amount of empty space around the horizontal separator by setting the Boolean variableRowHeight property.

Full code after the jump.

Continue reading Adding a horizontal separator to a Flex PopUpButton control’s pop up menu (redux)

Determining if a check box menu item is toggled in a Flex PopUpButton control’s pop up menu

The following example shows you how you can determine if a check box menu item in a Flex PopUpButton control was checked or not by using the change event on the pop up menu along with the dataDescriptor property and isToggled() method.

Full code after the jump.

Continue reading Determining if a check box menu item is toggled in a Flex PopUpButton control’s pop up menu

Reducing the vertical space around a separator in a Flex PopUpButton control’s pop up menu by enabling variable row heights

The following example shows how you can reduce the amount of whitespace around a PopUpButton control’s pop up menu by setting the variableRowHeight property on the menu in Flex.

Full code after the jump.

Continue reading Reducing the vertical space around a separator in a Flex PopUpButton control’s pop up menu by enabling variable row heights

Adding checkboxes, radiobuttons, and sub-menus to a Flex PopUpButton control’s pop up menu

In a previous example, “Adding a horizontal separator to a Flex PopUpButton control’s pop up menu”, we saw how you can add horizontal separators to a PopUpButton control’s pop up menu by setting the type attribute to “separator”. So, “what other special types are there?”, you may be asking, as it turns out you can create folders with sub-menus, checkboxes, radiobuttons, and even disable item selection.

Continue reading Adding checkboxes, radiobuttons, and sub-menus to a Flex PopUpButton control’s pop up menu