Envision
A visual programming IDE for object-oriented languages
|
This class provides a standard interface for creating a menu which is opened at the last cursor position. More...
Public Member Functions | |
virtual | ~Menu () |
QVector< QVector< Visualization::Item * > > | currentItems () const |
bool | executeFocused () |
Executes the currently focused item's function. More... | |
Visualization::Item * | focusedItem () const |
The currently focused item. More... | |
void | selectItem (Visualization::Item *item) |
Selects the given item as the focused item. More... | |
virtual void | updateGeometry (int availableWidth, int availableHeight) override |
Static Public Member Functions | |
static void | hide () |
Hides the active menu. More... | |
static void | initializeForms () |
static bool | isVisible () |
Returns whether a menu is currently visible on screen. More... | |
Protected Member Functions | |
Menu (QVector< QVector< Visualization::Item * >> items, Visualization::Item *selectedItem, Visualization::Item *target, StyleType *style=itemStyles().get()) | |
virtual void | endFocusMode (Visualization::Item *target)=0 |
End focus mode on the given target. More... | |
virtual bool | executeEntry (Visualization::Item *item)=0 |
The function to execute when selecting the given visualization. More... | |
QPoint | indexOf (Visualization::Item *item) const |
The index of the given item in the node grid. More... | |
virtual bool | sceneEventFilter (QGraphicsItem *watched, QEvent *event) override |
virtual void | startFocusMode (Visualization::Item *target)=0 |
Start focus mode with the given target to be focused. More... | |
Static Protected Member Functions | |
static void | hideNow () |
Static Protected Attributes | |
static Menu * | instance {} |
Private Member Functions | |
QPoint | correctCoordinates (QPoint point) const |
Corrects the coordinates given by the point to ensure they are located within the grid. More... | |
Private Attributes | |
QVector< QVector< Visualization::Item * > > | currentItems_ |
Visualization::Item * | focusedItem_ {} |
bool | inFocusMode_ {} |
QPointF | mousePosition_ |
Visualization::Item * | target_ {} |
Additional Inherited Members | |
Protected Types inherited from Core::Reflect< Base > | |
using | Super = Reflect< Base > |
This class provides a standard interface for creating a menu which is opened at the last cursor position.
Any kind of node can be used and actions may be associated with the nodes. The interface can also optionally contain a text field which is located above the normal items, where any text can be entered.
|
virtual |
|
protected |
|
private |
Corrects the coordinates given by the point to ensure they are located within the grid.
Implements a wraparound technique if the position selected is out of bounds.
|
inline |
|
protectedpure virtual |
End focus mode on the given target.
|
protectedpure virtual |
The function to execute when selecting the given visualization.
bool Interaction::Menu::executeFocused | ( | ) |
Executes the currently focused item's function.
Returns whether it was successfully executed.
|
inline |
The currently focused item.
Either the text field, or a visualization of one of the nodes.
|
static |
Hides the active menu.
|
staticprotected |
|
protected |
The index of the given item in the node grid.
Returns (-1, -1) if not found.
|
static |
|
inlinestatic |
Returns whether a menu is currently visible on screen.
|
overrideprotectedvirtual |
void Interaction::Menu::selectItem | ( | Visualization::Item * | item | ) |
Selects the given item as the focused item.
|
protectedpure virtual |
Start focus mode with the given target to be focused.
|
overridevirtual |
|
private |
|
private |
|
private |
|
staticprotected |
|
private |
|
private |