#include <Control.h>
Inheritance diagram for GG::Control:
Accessors | |
Clr | Color () const |
bool | Disabled () const |
Mutators | |
virtual void | AcceptDrops (std::list< Wnd * > &wnds, const Pt &pt) |
virtual void | Render ()=0 |
virtual void | MouseWheel (const Pt &pt, int move, Flags< ModKey > mod_keys) |
virtual void | KeyPress (Key key, Flags< ModKey > mod_keys) |
virtual void | KeyRelease (Key key, Flags< ModKey > mod_keys) |
virtual void | SetColor (Clr c) |
virtual void | Disable (bool b=true) |
virtual void | DefineAttributes (WndEditor *editor) |
Structors | |
Control () | |
Control (int x, int y, int w, int h, Flags< WndFlag > flags=CLICKABLE) | |
Protected Attributes | |
Clr | m_color |
bool | m_disabled |
Each control has (like all windows) coordinates offset from the upper-left corner of it's parent's client area. All controls may be disabled. By default, a Control passes keyboard input to its parent Wnd. Any class derived from Control should do the same with any keyboard input it does not need for its own use. For instance, an Edit control needs to know about arrow key keyboard input, but it should pass other key presses like 'ESC' to its parent.
Definition at line 44 of file Control.h.
GG::Control::Control | ( | ) | [protected] |
default ctor
basic ctor
Clr GG::Control::Color | ( | ) | const |
bool GG::Control::Disabled | ( | ) | const |
handles a drop of one or more drag-and-drop wnds into this Wnd; the accepted wnds remain in the list wnds; the rejected ones do not.
This function must not not alter the order of the elements in wnds. It may only remove elements.
Reimplemented from GG::Wnd.
Reimplemented in GG::ListBox.
virtual void GG::Control::Render | ( | ) | [pure virtual] |
draws this Wnd.
Note that Wnds being dragged for a drag-and-drop operation are rendered twice -- once in-place as normal, once in the location of the drag operation, attached to the cursor. Such Wnds may wish to render themselves differently in those two cases. To determine which render is being performed, they can call GUI::GetGUI()->RenderingDragDropWnds().
Reimplemented from GG::Wnd.
Implemented in GG::Button, GG::StateButton, GG::RadioButtonGroup, GG::HueSaturationPicker, GG::ValuePicker, GG::ColorDlg::ColorDisplay, GG::DropDownList, GG::DynamicGraphic, GG::Edit, GG::ListBox::Row, GG::ListBox, GG::MenuBar, GG::MultiEdit, GG::Scroll, GG::Slider, GG::Spin< T >, GG::StaticGraphic, GG::TabBar, and GG::TextControl.
virtual void GG::Control::MouseWheel | ( | const Pt & | pt, | |
int | move, | |||
Flags< ModKey > | mod_keys | |||
) | [virtual] |
respond to movement of the mouse wheel (move > 0 indicates the wheel is rolled up, < 0 indicates down)
Reimplemented from GG::Wnd.
Reimplemented in GG::ListBox, GG::MultiEdit, and GG::Spin< T >.
respond to down-keystrokes (focus window only).
A window may receive KeyPress() messages passed up to it from its children. For instance, Control-derived classes pass KeyPress() messages to their Parent() windows by default.
Reimplemented from GG::Wnd.
Reimplemented in GG::DropDownList, GG::Edit, GG::ListBox, GG::MultiEdit, GG::Slider, and GG::Spin< T >.
respond to up-keystrokes (focus window only).
A window may receive KeyRelease() messages passed up to it from its children. For instance, Control-derived classes pass KeyRelease() messages to their Parent() windows by default.
Reimplemented from GG::Wnd.
virtual void GG::Control::SetColor | ( | Clr | c | ) | [virtual] |
sets the color of the control
Reimplemented in GG::Button, GG::StateButton, GG::DropDownList, GG::Edit, GG::ListBox, GG::Scroll, GG::Slider, GG::Spin< T >, and GG::TextControl.
Referenced by GG::Spin< T >::SetColor().
virtual void GG::Control::Disable | ( | bool | b = true |
) | [virtual] |
disables/enables the control; disabled controls appear greyed
Reimplemented in GG::ListBox, GG::Scroll, GG::Slider, and GG::Spin< T >.
Referenced by GG::Spin< T >::Disable().
virtual void GG::Control::DefineAttributes | ( | WndEditor * | editor | ) | [virtual] |
provides the attributes of this object that are appropriate for a user to edit in a WndEditor; see WndEditor for details.
Reimplemented from GG::Wnd.
Reimplemented in GG::Button, GG::StateButton, GG::RadioButtonGroup, GG::DropDownList, GG::DynamicGraphic, GG::Edit, GG::ListBox, GG::MenuBar, GG::MultiEdit, GG::Scroll, GG::Slider, GG::Spin< T >, GG::StaticGraphic, and GG::TextControl.
Referenced by GG::Spin< T >::DefineAttributes().
Clr GG::Control::m_color [protected] |
bool GG::Control::m_disabled [protected] |