GG
|
An abstract base class for all control classes. More...
#include <Control.h>
Protected Member Functions | |
virtual void | MouseWheel (const Pt &pt, int move, Flags< ModKey > mod_keys) |
virtual void | KeyPress (Key key, boost::uint32_t key_code_point, Flags< ModKey > mod_keys) |
virtual void | KeyRelease (Key key, boost::uint32_t key_code_point, Flags< ModKey > mod_keys) |
Protected Attributes | |
Clr | m_color |
bool | m_disabled |
Accessors | |
virtual void | DropsAcceptable (DropsAcceptableIter first, DropsAcceptableIter last, const Pt &pt) const |
Clr | Color () const |
bool | Disabled () const |
Mutators | |
virtual void | AcceptDrops (const std::vector< Wnd * > &wnds, const Pt &pt) |
virtual void | Render ()=0 |
virtual void | SetColor (Clr c) |
virtual void | Disable (bool b=true) |
virtual void | DefineAttributes (WndEditor *editor) |
Structors | |
Control () | |
Control (X x, Y y, X w, Y h, Flags< WndFlag > flags=INTERACTIVE) |
An abstract base class for all control classes.
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 forwards several types of events and requests for action to its parent Wnd (e.g. AcceptDrops()). In particular, keyboard input not handled by the Control is forwarded to the Control's parent. 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.
virtual void GG::Control::DropsAcceptable | ( | DropsAcceptableIter | first, |
DropsAcceptableIter | last, | ||
const Pt & | pt | ||
) | const [virtual] |
Sets the second member of each iterator to true or false, indicating whether the Wnd in the first member would be accepted if dropped on this Wnd at pt.
Reimplemented from GG::Wnd.
Reimplemented in GG::ListBox.
virtual void GG::Control::AcceptDrops | ( | const std::vector< Wnd * > & | wnds, |
const Pt & | pt | ||
) | [virtual] |
When the user drops Wnds onto this Wnd, DropsAcceptable() is passed the list of dropped Wnds. The Wnds marked acceptable by DropsAcceptable() are then passed to AcceptDrops(), which handles the receipt of one or more drag-and-drop wnds into this Wnd.
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::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().
virtual void GG::Control::MouseWheel | ( | const Pt & | pt, |
int | move, | ||
Flags< ModKey > | mod_keys | ||
) | [protected, 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 >.
virtual void GG::Control::KeyPress | ( | Key | key, |
boost::uint32_t | key_code_point, | ||
Flags< ModKey > | mod_keys | ||
) | [protected, virtual] |
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 >.
virtual void GG::Control::KeyRelease | ( | Key | key, |
boost::uint32_t | key_code_point, | ||
Flags< ModKey > | mod_keys | ||
) | [protected, virtual] |
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.