Menu

Set the font, color, and image properties for menus.

Syntax

menu {=} umenu(PropertiesList)

Arguments

PropertiesList—semi-colon delimited list of property-value pairs.

When a color property is not defined, the Windows default is used.

Menu Properties
Property Description Details
Font Font used for text in menus. Font
Color Properties
BackColor Background color of drop-down menu and popup menus. Background Color (BackColor)
BackColorSelect Background color of the selected menu item. Active Background Color (BackColorSelect)
BackColorSidebar Background color of the sidebar in drop-down and popup menus. BackColorSidebar
BackColorFill Style of the background color for the selected menu item: flat or gradient . Gradient Fill Style (BackColorFill)
BorderColorSelect Color of the border around a selected menu item. BorderColorSelect
ForeColor Color of the text in menu items and separators in menus. Foreground Color (ForeColor)
ForeColorSelect Color of the text when the menu item is selected. Active Foreground Color (ForecolorSelect)
ForeColorDisabled  Color of the text when the menu item is disabled. ForeColorDisabled
Image Properties
ImgSelect Image displayed as the selected menu item. Active Image (ImgSelect)
ImgSidebar  Image displayed as the side bar of a drop-down or popup menu. Overrides the BackColorSidebar property. ImgSidebar
ImgSize Size used to display an image in front of the menu item. Uniface always reserves an area in front of a menu item for an image. Image Size (ImgSize)
Default value: None
File section: [application]

Description

Use the Menu setting control the appearance of menus in the application using colors or images.

Tip: Colors have a performance advantage over images.

Important: Using the Menu setting bypasses the Windows theme manager, so you need to explicitly specify all the properties you want to control. For each color property that is not defined in the property string, the system-defined color is used, which gives menus a flat appearance. You can use the BackColorFill property to set the default to a gradient fill.

If menu item definitions specify images (displayed as icons in front of the text), these are only displayed if at least one menu property is set in the application .ini file. For example:

;usys.ini
[application]
Menu = umenu(backcolor=control)

It is advisable to define a font in the property string. If there is no font defined, the current Font0 is used to calculate the size of the menu. If this is changed, the menu size may become bigger or smaller than expected.

Menu=umenu(font=monomedium;backcolor=blue)

Setting Menu Properties

The following example sets the font, foreground, background, and selection colors for menus. (For readability, this example is formatted over several lines.)

menu=umenu(font=SansMedium;
           backcolor=#fdfdfd;forecolor=black;forecolorselect=green;
           backcolorselect=#c0ddfc;bordercolorselect=#3399ff)
Result

Result of menu proeprties