#include <basiccontainer.hpp>
Inheritance diagram for gcn::BasicContainer:

Contains basic container functions every container should have. Containers should inherit from this class and implement it's functions.
Definition at line 72 of file basiccontainer.hpp.
Public Types | |
| enum | { NEVER, ALWAYS, NOT_ON_CHILD, NOT_IN_CHILDREN_AREA } |
Public Member Functions | |
| BasicContainer () | |
| Constructor. | |
| virtual | ~BasicContainer () |
| Destructor. | |
| virtual void | moveToTop (Widget *widget) |
| Moves a Widget to the top of the BasicContainer. | |
| virtual void | moveToBottom (Widget *widget) |
| Moves a widget to the bottom of the BasicContainer. | |
| virtual void | _announceDeath (Widget *widget) |
| Called when a child of the BasicContainer gets destroyed. | |
| virtual Rectangle | getChildrenArea () |
| Gets the subarea of the BasicContainer that the children occupy. | |
| virtual void | focusNext () |
| Focuses the next Widget in the BasicContainer. | |
| virtual void | focusPrevious () |
| Focuses the previous Widge in the BasicContainer. | |
| virtual Widget * | getWidgetAt (int x, int y) |
| Gets a widget from a certain position in the container. | |
| virtual void | showWidgetPart (Widget *widget, Rectangle area) |
| Tries to show a specific part of a Widget by moving it. | |
| virtual void | logic () |
| Called for all Widgets in the gui each time Gui::logic is called. | |
| virtual void | _setFocusHandler (FocusHandler *focusHandler) |
| Sets the FocusHandler to be used. | |
| virtual void | _mouseInputMessage (const MouseInput &mouseInput) |
| Called when a Widget recieves a MouseInput. | |
| virtual void | _mouseOutMessage () |
| Called when the mouse leaves the Widget area. | |
| virtual void | _keyInputMessage (const KeyInput &keyInput) |
| Called when a Widget recieves a KeyInput. | |
Protected Types | |
| typedef std::list< Widget * > | WidgetList |
| typedef WidgetList::iterator | WidgetListIterator |
| typedef WidgetList::reverse_iterator | WidgetListReverseIterator |
Protected Member Functions | |
| virtual void | add (Widget *widget) |
| Adds a widget. | |
| virtual void | remove (Widget *widget) |
| Removes a widget. | |
| virtual void | clear () |
| Clears the BasicContainer of widgets. | |
| virtual void | drawChildren (Graphics *graphics) |
| Draws children widgets. | |
| virtual void | logicChildren () |
| Calls logic for children widgets. | |
| virtual void | setMouseInputPolicy (unsigned int policy) |
| Sets the mouse input policy. | |
| virtual unsigned int | getMouseInputPolicy () |
| Gets the mouse input policy. | |
| virtual FocusHandler * | getInternalFocusHandler () |
| Gets the internal FocusHandler used. | |
| virtual void | setInternalFocusHandler (FocusHandler *focusHandler) |
| Sets the internal FocusHandler. | |
Protected Attributes | |
| WidgetList | mWidgets |
| Widget * | mWidgetWithMouse |
| unsigned int | mMouseInputPolicy |
| FocusHandler * | mInternalFocusHandler |
|
|
Called when a child of the BasicContainer gets destroyed.
Reimplemented in gcn::DropDown. Definition at line 111 of file basiccontainer.cpp. Referenced by gcn::Widget::~Widget(). |
|
|
Called when a Widget recieves a KeyInput. WARNING: This function is used internally to handle all key messages. Don't call or overload it unless you know what you are doing.
Reimplemented from gcn::Widget. Definition at line 526 of file basiccontainer.cpp. References gcn::Widget::_keyInputMessage(), and gcn::FocusHandler::getFocused(). |
|
|
Called when a Widget recieves a MouseInput. WARNING: This function is used internally to handle all mouse messages. Don't call or overload it unless you know what you are doing.
Reimplemented from gcn::Widget. Definition at line 252 of file basiccontainer.cpp. References gcn::Widget::_mouseInMessage(), gcn::Widget::_mouseInputMessage(), gcn::Widget::_mouseOutMessage(), getChildrenArea(), gcn::FocusHandler::getDragged(), gcn::FocusHandler::getFocused(), gcn::Widget::getHeight(), getWidgetAt(), gcn::Widget::getWidth(), gcn::Widget::getX(), gcn::Widget::getY(), gcn::Widget::hasMouse(), gcn::Widget::isDragged(), gcn::Widget::isFocused(), gcn::Rectangle::isPointInRect(), gcn::Rectangle::x, gcn::MouseInput::x, gcn::Rectangle::y, and gcn::MouseInput::y. |
|
|
Called when the mouse leaves the Widget area. WARNING: This function is used internally be to handle mouse out messages. Don't call or overload this function unless you know what you are doing. Reimplemented from gcn::Widget. Definition at line 360 of file basiccontainer.cpp. References gcn::Widget::_mouseOutMessage(). |
|
|
Sets the FocusHandler to be used. WARNING: This function is used internally and should not be called or overloaded unless you know what you are doing.
Reimplemented from gcn::Widget. Definition at line 235 of file basiccontainer.cpp. |
|
|
Adds a widget.
Reimplemented in gcn::Container. Definition at line 371 of file basiccontainer.cpp. References gcn::Widget::_getFocusHandler(), gcn::Widget::_setFocusHandler(), and gcn::Widget::_setParent(). Referenced by gcn::DropDown::DropDown(), and gcn::ScrollArea::setContent(). |
|
|
Draws children widgets.
References getChildrenArea(), gcn::Rectangle::height, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y. Referenced by gcn::Window::draw(), gcn::ScrollArea::draw(), gcn::DropDown::draw(), and gcn::Container::draw(). |
|
|
Gets the subarea of the BasicContainer that the children occupy.
Reimplemented in gcn::DropDown, and gcn::Window. Definition at line 129 of file basiccontainer.cpp. References gcn::Widget::getHeight(), and gcn::Widget::getWidth(). Referenced by _mouseInputMessage(), gcn::DropDown::adjustHeight(), gcn::ScrollArea::drawBackground(), drawChildren(), gcn::ScrollArea::getHorizontalMarkerDimension(), gcn::ScrollArea::getHorizontalMaxScroll(), gcn::ScrollArea::getVerticalMarkerDimension(), gcn::ScrollArea::getVerticalMaxScroll(), gcn::ScrollArea::getWidgetAt(), getWidgetAt(), gcn::TextBox::keyPress(), gcn::ScrollArea::mousePress(), gcn::ScrollArea::mouseWheelDown(), gcn::ScrollArea::mouseWheelUp(), and showWidgetPart(). |
|
|
Gets the internal FocusHandler used.
|
|
|
Gets the mouse input policy.
|
|
||||||||||||
|
Gets a widget from a certain position in the container. This function is used to decide which gets mouse input, thus it can be overloaded to change that behaviour.
Reimplemented in gcn::ScrollArea. Definition at line 206 of file basiccontainer.cpp. References getChildrenArea(), gcn::Rectangle::isPointInRect(), gcn::Rectangle::x, and gcn::Rectangle::y. Referenced by _mouseInputMessage(). |
|
|
Called for all Widgets in the gui each time Gui::logic is called. You can do logic stuff here like playing an animation.
Reimplemented from gcn::Widget.
Reimplemented in gcn::DropDown, and gcn::ScrollArea. Definition at line 230 of file basiccontainer.cpp. References logicChildren(). |
|
|
Moves a widget to the bottom of the BasicContainer. The Widget will be drawn below all other Widgets in the BasicContainer.
Referenced by gcn::Widget::requestMoveToBottom(). |
|
|
Moves a Widget to the top of the BasicContainer. The widget will be drawn above all other Widgets in the BasicContainer.
Referenced by gcn::DropDown::dropDown(), gcn::Window::mousePress(), and gcn::Widget::requestMoveToTop(). |
|
|
Removes a widget.
Reimplemented in gcn::Container. Definition at line 388 of file basiccontainer.cpp. References gcn::Widget::_setFocusHandler(), and gcn::Widget::_setParent(). |
|
|
Sets the internal FocusHandler. An internal focushandler is needed if both a widget in the container and the container should be foucsed at once.
References gcn::Widget::_getFocusHandler(). Referenced by gcn::DropDown::DropDown(). |
|
|
Sets the mouse input policy.
|
|
||||||||||||
|
Tries to show a specific part of a Widget by moving it.
Reimplemented in gcn::ScrollArea. Definition at line 476 of file basiccontainer.cpp. References getChildrenArea(), gcn::Widget::getX(), gcn::Widget::getY(), gcn::Rectangle::height, gcn::Widget::setX(), gcn::Widget::setY(), gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y. Referenced by gcn::TextBox::scrollToCaret(), and gcn::ListBox::setSelected(). |
1.3.8