Menus unit
Implements menus used in forms created with the Lazarus IDE.
menus.pp contains classes, types, and routines used to implement
menus used on TForm instances in the Lazarus Component Library (
LCL).
Authors: Shane Miller and Marc Weustink
The following components are added to the Lazarus IDE component palette:
Standard Tab
- TMainMenu
- TPopupMenu
Registered but not displayed:
- TMenuItem
Classes and records
EMenuError | class | Exception raised when an error occurs while accessing a menu item. |
TMainMenu | class | TMainMenu - the Main Menu that appears at the top of most windows. |
TMenu | class | TMenu - a menu appearing in a form. Base class for TMainMenu or TPopupMenu. |
TMenuActionLink | class | TMenuActionLink: defines the link between a selected menu item and its corresponding action. |
TMenuItem | class | Represents a menu item displayed in a menu. |
TMenuItemEnumerator | class | Implements an enumerator for child menu items in the specified TMenuItem instance. |
TMenuItems | class | Implements a list used to store TMenuItem instances with a given parent. |
TMergedMenuItems | class | Implements a container for menu items merged into a parent menu or menu item. |
TPopupMenu | class | Implements a menu panel that pops up on the screen when the right mouse button is clicked. |
Procedures and functions
NewItem | function | Creates and configures a new menu item instance. |
NewLine | function | Creates and configures a menu item displayed as a separator line. |
NewMenu | function | Creates and configures a new menu instance with the specified menu items. |
NewPopupMenu | function | Creates and configures a new pop-up menu with the specified menu items. |
NewSubMenu | function | Creates and configures a new sub-menu with the specified child menu items. |
Register | procedure | Registers components for use in the Lazarus IDE. |
ShortCut | function | Converts a virtual key code and modifier to a shortcut value. |
ShortCutToKey | procedure | Converts a shortcut value to a virtual key code and modifier. |
StripHotkey | function | Removes the hot key (accelerator) prefix from the specified text. |
Types
TFindItemKind | enumeration | TFindItemKind - enumerated type for kind of item in search operation: a command, a handle or a shortcut. |
TGlyphShowMode | enumeration | TGlyphShowMode indicates if the glyph image for a menu or button should be shown, and in which circumstances. |
TMenuActionLinkClass | type | Class type used to create new instances of TMenuActionLink. |
TMenuAutoFlag | type | Range type which represents the valid TMenuItemAutoFlag values for TMenu instances. |
TMenuChangeEvent | procedure type | Specifies an event handler signalled when a menu or menu item is changed. |
TMenuDrawItemEvent | procedure type | Specifies an event handler signalled to draw a menu item on the given canvas. |
TMenuItemAutoFlag | enumeration | Represents line reduction modes available for menu items. |
TMenuItemClass | type | Class type used to create new TMenuItem instances. |
TMenuItemHandlerType | enumeration | Enumerated type which represents the available menu item handler types. |
TMenuMeasureItemEvent | procedure type | Specifies an event handler signalled to get the width and height for a menu item. |
TPopupAlignment | enumeration | An enumerated type to describe the position of pop-up menu relative to the pop-up coordinates. |
TTrackButton | enumeration | TTrackButton - enumerated type described which mouse buttons can be used to activate (click) menu items. |
Constants
cDialogSuffix | constant | Not used in the current LCL implementation. |
cHotkeyPrefix | constant | Prefix used in a menu item caption to identify a hot key (accelerator). |
cLineCaption | constant | Caption used for a menu item displayed as a separator line. |
ValidMenuHotkeys | constant | Contains characters that can be used as accelerator keys in menus and menu items. |
Variables
ActivePopupMenu | variable | Unit global variable which represents the active pop-up menu. |
OnDesignerMenuItemClick | variable | Unit global variable with the event handler signalled when a menu item is clicked at design-time. |
OnMenuPopupHandler | variable | Unit global variable with the event handler signalled when a pop-up menu is displayed. |
Topics
HowToUseMenus | topic | HowToUseMenus - hints for creating Menus for your Forms. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
