MyGUI 3.5.3
MyGUI_WidgetContainer.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_WIDGET_CONTAINER_H_
8#define MYGUI_WIDGET_CONTAINER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_WidgetDefines.h"
12#include "MyGUI_WidgetStyle.h"
13#include "MyGUI_Align.h"
14#include "MyGUI_TCoord.h"
15#include "MyGUI_Types.h"
16
17namespace MyGUI
18{
19
20 class Widget;
21
22 class MYGUI_EXPORT WidgetContainer
23 {
24 public:
25 WidgetContainer() = default;
26 virtual ~WidgetContainer() = default;
27
28 /*internal:*/
29 virtual void _linkChildWidget(Widget* _widget);
30 void _unlinkChildWidget(Widget* _widget);
31
32 // child widgets access
33 const VectorWidgetPtr& getChildWidgets() const;
34 size_t getChildCount() const;
35 Widget* getChildAt(size_t _index) const;
36
37 protected:
38 virtual void _destroyChildWidget(Widget* _widget);
39 void _destroyAllChildWidget();
40
41 // widget creation (overridable for subclasses with different creation logic)
42 virtual Widget* baseCreateWidget(
43 WidgetStyle _style,
44 std::string_view _type,
45 std::string_view _skin,
46 const IntCoord& _coord,
47 Align _align,
48 std::string_view _layer,
49 std::string_view _name);
50
51 VectorWidgetPtr mWidgetChild;
52 };
53
54} // namespace MyGUI
55
56#endif // MYGUI_WIDGET_CONTAINER_H_
#define MYGUI_EXPORT
std::vector< Widget * > VectorWidgetPtr