#include <widget.h>
Inheritance diagram for wftk::Widget:

Public Member Functions | |
| Widget () | |
| Contstructor. | |
| Widget (const Surface &backgrnd, bool tileIt=true) | |
| Constructor which sets the widget background from a given Surface. | |
| Widget (Surface::Resource *backgrnd, bool tileIt=true) | |
| Constructor which sets the widget background from a given Resource. | |
| Widget (const std::string &backgrnd, bool tileIt=true) | |
| (string is the name of a Resource) | |
| virtual | ~Widget () |
| Destructor. | |
| void | setBackground (const Surface &backgrnd, bool tileIt=true) |
| Set background image. | |
| void | setBackground (Surface::Resource *backgrnd, bool tileIt=true) |
| Set background image. | |
| void | setBackground (const std::string &, bool tileIt=true) |
| set background from named resource | |
| void | clearBackground () |
| clear background image | |
| Surface::Resource * | getResourceBackground () const |
| get the current background | |
| void | setColor (const Color &color) |
| setting background color. | |
| void | setColor (const std::string &) |
| set background color from named resource | |
| void | setColor (const char *name) |
| need this one due to needing Color constructor from const char* | |
| void | setDisabledColor (const Color &color) |
| to set the background colour when the widget is disabled | |
| void | setDisabledColor (const std::string &) |
| set disabled color from named resource | |
| void | setDisabledColor (const char *name) |
| and the const char* version, just like for setColor() | |
| void | enable () |
| enable this widget tree | |
| void | disable () |
| disable this widget tree. | |
| virtual bool | mouseEvent (const Point &, const Point &, Mouse::Button) |
| mouse motion event handler | |
| virtual bool | buttonEvent (Mouse::Button, bool pressed, const Point &) |
| mouse button event handler | |
| virtual void | gainedMouse () |
| mouse gain event handler | |
| virtual bool | keyEvent (const SDL_keysym &sym, bool pressed) |
| keyboard event handler | |
| virtual void | gainedFocus () |
| focus gain handler | |
| virtual void | lostFocus () |
| focus loss handler | |
| bool | isEnabled () const |
| returns whether this widget is enabled | |
| const Color & | color () const |
| returns the background color | |
| bool | hasFocus () const |
| true if the widget has keyboard focus | |
| bool | releaseFocus () |
| release the keyboard focus | |
| bool | grabFocus () |
| grab the keyboard focus | |
| void | setClickToFocus (bool val=true) |
| set whether to grab focus on a mouse click | |
| void | setPointToFocus (bool val=true) |
| set whether to grab focus on mouse entry | |
| Widget * | nextFocus () |
| get the next focus in the focus list | |
| Widget * | prevFocus () |
| get the previous focus in the focus list | |
| bool | acceptsFocus () const |
| return whether this widget accepts keyboard focus | |
| void | getResourceBackground (const std::string &) |
| set background color and image from named resources | |
Protected Member Functions | |
| virtual void | draw (Surface &, const Point &offset, const Region &) |
| The area drawn to must lie within the given region. | |
| virtual void | drawAfter (Surface &, const Point &offset, const Region &) |
| The area drawn to must lie within the given region. | |
| virtual void | handleResize (Uint16 w, Uint16 h) |
| Calculate new shape for shaped widgets, call to setShape() after a resize. | |
| virtual bool | isOpaque () const |
| used in Widget's handleResize() implementation, many widgets can reimplement this instead of handleResize() | |
| virtual void | setPackingInfo () |
| recalculate the object's prefered size | |
|
|
disable this widget tree. The widget tree gets greyed and the members ignore any events. |
|
||||||||||||||||
|
The area drawn to must lie within the given region. This is protected so derived classes can call their parents' draw() in their own implementations. Reimplemented from wftk::ScreenArea. Reimplemented in wftk::BorderedDialog, wftk::Label, wftk::LineEdit, wftk::PushButton, and wftk::Slider. |
|
||||||||||||||||
|
The area drawn to must lie within the given region. This is protected so derived classes can call their parents' drawAfter() in their own implementations. Reimplemented from wftk::ScreenArea. Reimplemented in wftk::RootWindow. |
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.