Support for menu functions, events, and properties

Functions and events

The functions and events of the original menu will be supported in RibbonView.

  • RibbonView supports the events and properties of the original menu, as well as the corresponding scripts.

  • RibbonView supports the triggering of the Clicked and Selected events of menu items. However, if a menu item has a drop-down menu or a cascading menu, clicking on it will not trigger the Clicked event, but expand or collapse the submenu items.

  • In RibbonView, when you move the mouse over a menu item, only the Selected event will be triggered; to trigger the Clicked event, you need to click the menu item (that has no dropdown menu).

The MenuChanged event of the MDI window is triggered automatically when the ribbon bar is initialized.

Long MenuChanged (string oldmenu, string newmenu)

The oldname parameter indicates the name of the menu for the MDI frame and the newname parameter indicates the name of the menu associated with the active sheet (the currently opened sheet), because several sheets can be open at the same time, and the menu associated with the active sheet will display as the menu of the frame. Whenever the sheet switches to another one, the menu and its corresponding ribbon bar of the frame will be initialized again.

If you want to add scripts to customize the ribbon bar, it is highly recommended to place the scripts in the MenuChanged event. If you place the scripts in the other events such as the MDI window Open event, the scripts may not be executed when the sheet switches to another one.

Properties

The following Menu properties can be supported in RibbonView:

Properties of Traditional Style Menu

Properties of Contemporary Style Menu

Name

Name

Text

Text

MicroHelp

MicroHelp

Tag

Tag

Visible

Visible

Enabled

Enabled

Checked

Checked

Default

Default

Shortcut

Shortcut

N/A

MenuImage

N/A

FaceName

N/A

TextSize

Usages are consistent with the property settings of Menu. (Properties not listed are not supported)

  • MicroHelp

    In RibbonView, the text value of the MicroHelp property of the original menu item will display in the status area at the bottom of the frame as well as in the pop-up when the user moves a cursor over the menu item.

  • MenuImage

    The traditional style menu does not have the MenuImage property. The image specified via the ButtonImage property will be displayed, otherwise, the system default image will be displayed.

    For the contemporary style menu, the image set via the ButtonImage property will be displayed first; if not set, then the image specified via the MenuImage property will be displayed; if neither is set, the system default image will be displayed.

  • FaceName and TextSize

    The traditional style menu does not have FaceName and TextSize properties, therefore, the font name and text size: Tahoma 12 will be used.