#include <contextmenuitem.h>
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 () |
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.
ContextMenuItem::ContextMenuItem | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
const char * | text, | |||
u32 | value, | |||
FontBase * | font = NULL | |||
) |
Constructor.
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. |
virtual bool WoopsiUI::ContextMenuItem::blur | ( | ) | [inline, virtual] |
Remove focus from the gadget.
Reimplemented from WoopsiUI::Gadget.
bool ContextMenuItem::click | ( | s16 | x, | |
s16 | y | |||
) | [virtual] |
Click this gadget at the supplied co-ordinates.
x | X co-ordinate of the click. | |
y | Y co-ordinate of the click. |
Reimplemented from WoopsiUI::Gadget.
void ContextMenuItem::draw | ( | Rect | clipRect | ) | [virtual] |
Draw the region of the menu item within the clipping rect.
clipRect | The clipping rect to limit drawing to. |
Reimplemented from WoopsiUI::Label.
virtual bool WoopsiUI::ContextMenuItem::focus | ( | ) | [inline, virtual] |
Give the gadget focus.
Reimplemented from WoopsiUI::Gadget.
u32 WoopsiUI::ContextMenuItem::getValue | ( | ) | const [inline] |
Get the menu item's value.
bool ContextMenuItem::release | ( | s16 | x, | |
s16 | y | |||
) | [virtual] |
Release this gadget at the supplied co-ordinates
x | X co-ordinate of the release. | |
y | Y co-ordinate of the release. |
Reimplemented from WoopsiUI::Gadget.