PopupMenuCustomComponent Class Reference

A user-defined copmonent that can appear inside one of the rows of a popup menu. More...

Inherits Component, and ReferenceCountedObject.

List of all members.

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.

Detailed Description

A user-defined copmonent that can appear inside one of the rows of a popup menu.

See also:
PopupMenu::addCustomItem

Constructor & Destructor Documentation

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.


Member Function Documentation

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.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:15 2010 for JUCE by  doxygen 1.6.3