TMlSkinMenu

The menu skinning component: it repaints the form's main menu and context menus as image-based skinned menus.

Category
Menu
Unit
uMlSkinMenu.pas
Inherits from
TComponent

Notes

  • Every form that needs skinned menus must carry one. It takes over the drawing of all TMainMenu and TPopupMenu components on that form — leave it out and the menus stay grey system menus.
  • Menu_bk is the menu background, Menu_hilight the highlight bar, and separate properties supply the check mark, radio mark and submenu arrow.
  • GlyphBarWidth is the width of the icon column on the left, while BorderWidth and BorderOffset adjust the menu border.

Example

From the demo MlSkin.Demo.QQ旋风.v3.0 (.dfm form file)

object mn1: TMlSkinMenu
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  HotFont.Charset = DEFAULT_CHARSET
  HotFont.Color = clWhite
  HotFont.Height = -11
  HotFont.Name = 'Tahoma'
  HotFont.Style = []
  Menu_bk = 'MlSkinMenu_bk'
  Menu_hilight = 'MlSkinMenu_hilight'
  Menu_Check = 'MlSkinMenu_icon_check'
  Menu_Radio = 'MlSkinMenu_icon_radio'
  Menu_SubArrow = 'MlSkinMenu_sub_arrow'
  Left = 288
  Top = 129
end

Properties 12

NameTypeDefaultDescription
AboutTMlAboutInfoA design-time property: double-clicking it in the Object Inspector opens the MLSkin about box with the component version. It has no effect at run time and is not stored in the .dfm.
FontTFontFont of the menu text.
HotFontTFontFont used while the mouse is over the control, typically a different color or an underline for the hover effect.
LineColorTColor$00C4C4C4Colour of the menu separator lines.
Menu_bkTMlResIDMenu background image.
Menu_hilightTMlResIDHighlight bar image drawn under the selected menu item.
Menu_CheckTMlResIDImage for the check mark on a menu item.
Menu_RadioTMlResIDImage for the radio mark on a menu item.
Menu_SubArrowTMlResIDImage for the arrow shown on items that have a submenu.
BorderOffsetInteger6Offset of the menu content from its border, in pixels.
BorderWidthInteger0Width of the menu border in pixels.
GlyphBarWidthInteger31Width of the icon column at the left of the menu, where item icons are drawn.

Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.

Offline helpA PDF / CHM version is available for offline reading.