19 #ifndef __TOP_LEVEL_CONT_HPP__
20 #define __TOP_LEVEL_CONT_HPP__
23 #include "guiengine/widget.hpp"
24 #include "utils/log.hpp"
25 #include "utils/ptr_vector.hpp"
72 virtual int getWidth() = 0;
73 virtual int getHeight() = 0;
90 T* outCasted =
dynamic_cast<T*
>( out );
91 if (out != NULL && outCasted == NULL)
92 Log::fatal(
"Screen::getWidget",
"Widget '%s' of type '%s'"
93 "cannot be casted to requested type '%s'!\n", name,
94 typeid(*out).name(),
typeid(T).name());
109 virtual bool enableScreenPadding()
const {
return true; }
Represents a GUI widgets container.
Definition: abstract_top_level_container.hpp:43
void addWidgetsRecursively(PtrVector< Widget > &widgets, Widget *parent=NULL)
This function adds a list of widgets recursively, effectively creating the hierarchy of widgets.
Definition: abstract_top_level_container.cpp:52
Widget * getLastWidget(PtrVector< Widget > *within_vector=NULL)
This function returns the last widget found in within_vector.
Definition: abstract_top_level_container.cpp:272
Widget * m_first_widget
AbstractTopLevelContainer is generally able to determine its first widget just fine,...
Definition: abstract_top_level_container.hpp:54
PtrVector< Widget, HOLD > m_widgets
the widgets in this screen
Definition: abstract_top_level_container.hpp:46
Widget * m_last_widget
AbstractTopLevelContainer is generally able to determine its last widget just fine,...
Definition: abstract_top_level_container.hpp:62
void resizeWidgetsRecursively(PtrVector< Widget > &widgets)
This function invokes resize() of each widgets and its children.
Definition: abstract_top_level_container.cpp:98
T * getWidget(const char *name)
This function searches and returns a widget by name, cast as specified type, if that widget is found ...
Definition: abstract_top_level_container.hpp:87
Widget * getWidget(const char *name)
This function returns a widget by name if that widget is found.
Definition: abstract_top_level_container.cpp:155
void elementsWereDeleted(PtrVector< Widget > *within_vector=NULL)
This function is called when screen is removed.
Definition: abstract_top_level_container.cpp:314
bool isMyChild(Widget *widget) const
This function checks if a widget is a child of the container.
Definition: abstract_top_level_container.cpp:145
Widget * getFirstWidget(PtrVector< Widget > *within_vector=NULL)
This function returns the first widget found in within_vector.
Definition: abstract_top_level_container.cpp:232
Definition: ptr_vector.hpp:44
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33