A user-defined copmonent that can appear inside one of the rows of a popup menu. More...
Inherits Component, and ReferenceCountedObject.
Public Member Functions | |
| ~PopupMenuCustomComponent () | |
| Destructor. | |
| virtual void | getIdealSize (int &idealWidth, int &idealHeight)=0 |
| Chooses the size that this component would like to have. | |
| void | triggerMenuItem () |
| Dismisses the menu indicating that this item has been chosen. | |
| bool | isItemHighlighted () const throw () |
| Returns true if this item should be highlighted because the mouse is over it. | |
Protected Member Functions | |
| PopupMenuCustomComponent (bool isTriggeredAutomatically=true) | |
| Constructor. | |
A user-defined copmonent that can appear inside one of the rows of a popup menu.
| PopupMenuCustomComponent::~PopupMenuCustomComponent | ( | ) |
Destructor.
| PopupMenuCustomComponent::PopupMenuCustomComponent | ( | bool | isTriggeredAutomatically = true |
) | [protected] |
Constructor.
If isTriggeredAutomatically is true, then the menu will automatically detect a click on this component and use that to trigger it. If it's false, then it's up to your class to manually trigger the item if it wants to.
| virtual void PopupMenuCustomComponent::getIdealSize | ( | int & | idealWidth, | |
| int & | idealHeight | |||
| ) | [pure virtual] |
Chooses the size that this component would like to have.
Note that the size which this method returns isn't necessarily the one that the menu will give it, as it will be stretched to fit the other items in the menu.
| void PopupMenuCustomComponent::triggerMenuItem | ( | ) |
Dismisses the menu indicating that this item has been chosen.
This will cause the menu to exit from its modal state, returning this item's id as the result.
| bool PopupMenuCustomComponent::isItemHighlighted | ( | ) | const throw () |
Returns true if this item should be highlighted because the mouse is over it.
You can call this method in your paint() method to find out whether to draw a highlight.
1.6.3