Inherited by FileItem, RadioItem, and ToggleItem.
Public Member Functions | |
void | draw () |
void | layout () |
int | handle (int) |
Item (const char *label=0) | |
Item (const char *label, const Symbol *) | |
Item (const char *label, int shortcut, Callback *callback=0, void *user_data_=0, int flags=0) | |
Static Public Member Functions | |
void | set_style (const Style *, bool menubar) |
void | set_style (const Widget *w, bool f) |
void | clear_style () |
Static Public Attributes | |
NamedStyle * | default_style |
|
Unlike other widgets the constructor does not take any dimensions, since it is assummed the container widget will size this correctly. |
|
This constructor also sets the image(), useful for a browser item. |
|
This constructor is provided to match the Menu::add() function arguments. See Menu::add() for more details. |
|
The SELECTED flag will cause it to draw using the selected colors. Focusbox is also drawn if FOCUSED is on. The current version can also draw check or radio buttons but this functionality may be removed. Reimplemented from Widget. |
|
Returns 0 always. Items do not accept any events. Any results of clicking on them is handled by the parent Menu or Browser. Reimplemented from Widget. |
|
Measure the space the draw() will take and set w() and h(). Maybe this should be the default layout() function for Widget? Reimplemented from Widget. |
|
Modify the parent of the Item::default_style to this style. If no style settings have been done to an Item, it will use the textfont, textsize, textcolor, and possibly other settings inherited from this style to draw itself. This is used by menus and browsers to cause all the elements inside them to draw using their settings. The menubar flag causes it to mangle the style so that the buttonbox of style is used as the box, and the highlight_color is used as the selection_color. This is done to replicate the rather inconsistent appearance on Windows of menubars. Use Item::clear_style() to put this back so that style can be deleted. This is the same as setting it to Widget::default_style. |
|
The default style sets FLAT_BOX. Changing this will mess up the appearance of both menus and browsers. All the rest of the style is blank, and normally it inherits from the current browser or menu, which should call set_style() before drawing any items. Reimplemented from Widget. |