lecui 1.0.0-alpha.20
lecui C++ user interface library
Classes | Public Types | Public Member Functions | List of all members
liblec::lecui::context_menu Class Reference

Context menu. More...

#include <context_menu.h>

Classes

struct  specs
 The context menu specifications. By default the menu is pinned to the top left corner of the mouse cursor. More...
 

Public Types

enum class  pin_type { bottom , right }
 Pin type. Used to determine the position of the context menu with respect to the pin rectangle. More...
 

Public Member Functions

 context_menu ()
 Context menu constructor.
 
std::string operator() (form &fm, const specs &menu_specs)
 Display a context menu. More...
 

Detailed Description

Context menu.

Member Enumeration Documentation

◆ pin_type

Pin type. Used to determine the position of the context menu with respect to the pin rectangle.

Enumerator
bottom 

If there is enough room below the pin rectangle, or if the area below is larger than the area above, the menu will be pinned at the bottom, otherwise it will be pinned at the top. The width of the menu will be equal to the width of the pin rectangle.

right 

If there is enough room on the right of the pin rectangle, or if the area on the right is larger than the area on the left, the menu will be pinned to the right, otherwise it will be pinned to the left.

Member Function Documentation

◆ operator()()

std::string liblec::lecui::context_menu::operator() ( form fm,
const specs menu_specs 
)

Display a context menu.

Parameters
fmThe form to which the menu belongs.
menu_specsThe menu specifications.
Returns
The selected menu item, if any. If the menu item is a child, the full path to the item is returned, e.g. "fruit/citrus/orange".

The documentation for this class was generated from the following file: