Context Popups

In the Windows Ribbon Framework, a Context Popup is a Context Menu and/or a Mini Toolbar that pops up when the user right-clicks a certain element in the application. A Context Popup in a word processing application might look like this:

Context Popup

A Context Popup can consist of a single Mini Toolbar, a single Context Menu or a combination of both. This is what one of the Context Popups looks like in the Context Popup sample application that comes with this library:

Context Popup

And this is the corresponding tree in the Ribbon Designer:

Context Popup Tree

This tree has 3 main sections:

  • Mini Toolbars: here you can design your mini toolbars. The mini toolbar in this example has 2 groups. The first group contains Cut, Copy and Paste buttons, while the second group as a toggle button and a drop-down button.
  • Context Menus: here you design your context menus. In this example, the context menu has 2 groups: one with a toggle button and one with 3 buttons. The Ribbon Framework will draw a divider between these 2 groups when the popup menu is rendered.
  • Context Maps: a context map links a mini toolbar and a context menu together. If your context popup only has a mini toolbar, then you set the Context Menu property to (none). Likewise, if your context popup only has a context menu, then you set the Mini Toolbar property to (none). The example above has 4 context maps. The second one links ContextMenu2 and MiniToolbar2 together.

In your Delphi application, you cannot show a mini toolbar or context menu; you can only show context maps. That's why you also need to define context maps for popups that only have a mini toolbar or context menu. The Command you assign to the context map will be used in Delphi as the identifier of the context popup to show.

Next we will look into the Application Menu, Quick Access Toolbar, Contextual Tabs and the Help button.

Next: Other Ribbon Features