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" 71 virtual int getWidth() = 0;
72 virtual int getHeight() = 0;
89 T* outCasted =
dynamic_cast<T*
>( out );
90 if (out != NULL && outCasted == NULL)
91 Log::fatal(
"Screen::getWidget",
"Widget '%s' of type '%s'" 92 "cannot be casted to requested type '%s'!\n", name,
93 typeid(*out).name(),
typeid(T).name());
108 virtual bool enableScreenPadding()
const {
return true; }
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:31
bool isMyChild(Widget *widget) const
This function checks if a widget is a child of the container.
Definition: abstract_top_level_container.cpp:126
Widget * getFirstWidget(PtrVector< Widget > *within_vector=NULL)
This function returns the first widget found in within_vector.
Definition: abstract_top_level_container.cpp:213
void elementsWereDeleted(PtrVector< Widget > *within_vector=NULL)
This function is called when screen is removed.
Definition: abstract_top_level_container.cpp:295
Represents a GUI widgets container.
Definition: abstract_top_level_container.hpp:42
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
PtrVector< Widget, HOLD > m_widgets
the widgets in this screen
Definition: abstract_top_level_container.hpp:46
Widget * getLastWidget(PtrVector< Widget > *within_vector=NULL)
This function returns the last widget found in within_vector.
Definition: abstract_top_level_container.cpp:253
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:86
Widget * m_first_widget
AbstractTopLevelContainer is generally able to determine its first widget just fine, but in highly complex screens (e.g.
Definition: abstract_top_level_container.hpp:54
Widget * m_last_widget
AbstractTopLevelContainer is generally able to determine its last widget just fine, but in highly complex screens (e.g.
Definition: abstract_top_level_container.hpp:62
Definition: ptr_vector.hpp:43
Widget * getWidget(const char *name)
This function returns a widget by name if that widget is found.
Definition: abstract_top_level_container.cpp:136