MyGUI  3.2.0
MyGUI_ISubWidget.h
Go to the documentation of this file.
1 
6 /*
7  This file is part of MyGUI.
8 
9  MyGUI is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  MyGUI is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_I_SUB_WIDGET_H__
23 #define __MYGUI_I_SUB_WIDGET_H__
24 
25 #include "MyGUI_Prerequest.h"
27 #include "MyGUI_ILayerNode.h"
28 #include "MyGUI_Types.h"
29 #include "MyGUI_IRenderTarget.h"
30 #include "MyGUI_IStateInfo.h"
31 #include "MyGUI_IObject.h"
32 
33 namespace MyGUI
34 {
35 
36  class ISubWidget;
37  typedef std::vector<ISubWidget*> VectorSubWidget;
38 
40  public ICroppedRectangle,
41  public IObject
42  {
44 
45  public:
46  ISubWidget() : mVisible(true) { }
47  virtual ~ISubWidget() { }
48 
49  virtual void createDrawItem(ITexture* _texture, ILayerNode* _node) = 0;
50  virtual void destroyDrawItem() = 0;
51 
52  virtual void setAlpha(float _alpha) { }
53 
54  virtual void setStateData(IStateInfo* _data) { }
55 
56  virtual void doRender() = 0;
57 
58  virtual void setAlign(Align _value)
59  {
60  mAlign = _value;
61  }
62  virtual void setVisible(bool _value)
63  {
64  mVisible = _value;
65  }
66 
67  virtual void _updateView() { }
68  virtual void _correctView() { }
69 
70  virtual void _setAlign(const IntSize& _oldsize) { }
71 
72  virtual void doManualRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) { }
73 
74  protected:
76  bool mVisible;
77  };
78 
79 } // namespace MyGUI
80 
81 #endif // __MYGUI_I_SUB_WIDGET_H__