New enhanced menus

In this section:

The format code %em (Enhanced Menu) allows you to put icons in the left hand column of menus. %em (Enhanced Menu) is used once for a given window and enables the use of icons for subsequent %mn (Menu) and %pm (Popup Menu) menus. %em (before %mn and %pm) therefore provides an alternative to %`mn and %`pm.

When a window description contains %em, menu items can have the name of an icon resource before the text as in %mn[File[MY_ICON/Open]]. %mn[File[MY_ICON//Open]] has the same effect but the icon will not be greyed when the item is disabled. In all other respects, %mn and %pm remain unchanged.

By default %em provides a basic enhanced menu that enables you to add icons and nothing more. Otherwise you can use one or more of the following options.

w7 and w8

provide default (Windows 7 and Windows 8) background colours for an item when it is highlighted.

background=#rrggbb

sets the background colour of an item when it is highlighted (rr represents hexadecimal digits for the red component etc.).

border=#rrggbb

sets the border colour of an item when it is highlighted

marginbits=MYBITMAP

sets the background bitmap for the icon margin when an item is NOT highlighted (MYBITMAP is the name of a bitmap resource).

bits=MYBITMAP

sets the background bitmap for the whole item when it is highlighted

theme1

provides a theme that is similar to Plato v4.6x.

theme2

provides a theme that is similar to Visual Studio 2010.

height=n

enhanced menu has a default height of 16 pixels and this height is automatically increased when an icon that is greater than 16x16 is added. This options allow for greater vertical spacing between menu items in the absence of larger icons.


Typically you can use a margin bitmap to provide a graded scale in vertical lines of colour. This bitmap could have any height but should be wide enough (say 40 pixels) for the whole margin. In the same way a background bitmap for a highlighted item could provide a graded scale in horizontal lines of colour. This bitmap could have any width but should be high enough (a little more than the size of the largest icon) for the whole item.

If you use %em with one of the theme options [w7], [w8], [theme1] or [theme2] then the number of visible characters in the name of the menu item is limited to a maximum of about 30.

 

 

Basket
Empty
 
Copyright © 1999-2020 Silverfrost Limited