WoopsiUI::ContextMenuItem Class Reference

#include <contextmenuitem.h>

Inheritance diagram for WoopsiUI::ContextMenuItem:
WoopsiUI::Label WoopsiUI::Gadget

List of all members.

Public Member Functions

 ContextMenuItem (s16 x, s16 y, u16 width, u16 height, const char *text, u32 value, FontBase *font=NULL)
virtual void draw (Rect clipRect)
u32 getValue () const
virtual bool click (s16 x, s16 y)
bool release (s16 x, s16 y)
virtual bool focus ()
virtual bool blur ()

Detailed Description

Class representing an item in the ContextMenu class. Woopsi handles the creation of these items automatically based on a gadget's context menu item array, so these objects should not be created by any other code.


Constructor & Destructor Documentation

WoopsiUI::ContextMenuItem::ContextMenuItem ( s16  x,
s16  y,
u16  width,
u16  height,
const char *  text,
u32  value,
FontBase font = NULL 
)

Constructor.

Parameters:
x The x co-ordinate of the menu item, relative to its parent.
y The y co-ordinate of the menu item, relative to its parent.
width The width of the menu item.
height The height of the menu item.
text Pointer to a string to display in the menu item.
value The value of the item.
font The font to use in this menu item.

Member Function Documentation

virtual bool WoopsiUI::ContextMenuItem::blur (  )  [inline, virtual]

Remove focus from the gadget.

Returns:
True if the gadget lost focus correctly.

Reimplemented from WoopsiUI::Gadget.

virtual bool WoopsiUI::ContextMenuItem::click ( s16  x,
s16  y 
) [virtual]

Click this gadget at the supplied co-ordinates.

Parameters:
x X co-ordinate of the click.
y Y co-ordinate of the click.
Returns:
True if the click was successful.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::ContextMenuItem::draw ( Rect  clipRect  )  [virtual]

Draw the region of the menu item within the clipping rect.

Parameters:
clipRect The clipping rect to limit drawing to.

Reimplemented from WoopsiUI::Label.

virtual bool WoopsiUI::ContextMenuItem::focus (  )  [inline, virtual]

Give the gadget focus.

Returns:
True if the gadget received focus correctly.

Reimplemented from WoopsiUI::Gadget.

u32 WoopsiUI::ContextMenuItem::getValue (  )  const [inline]

Get the menu item's value.

Returns:
The menu item's value.
bool WoopsiUI::ContextMenuItem::release ( s16  x,
s16  y 
) [virtual]

Release this gadget at the supplied co-ordinates

Parameters:
x X co-ordinate of the release.
y Y co-ordinate of the release.
Returns:
True if the release was successful.

Reimplemented from WoopsiUI::Gadget.


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

Generated on Sun Nov 15 11:35:36 2009 for Woopsi by  doxygen 1.6.1