1 /*!
2 	@file
3 	@author		Generate utility by Albert Semenov
4 	@date		01/2009
5 	@module
6 */
7 #pragma once
8 
9 #include "MyGUI_Managed_TextBox.h"
10 
11 namespace MyGUI
12 {
13 	namespace Managed
14 	{
15 
16 		public ref class Window : public TextBox
17 		{
18 
19 		private:
20 			typedef MyGUI::Window ThisType;
21 
22 		public:
Window()23 			Window() : TextBox() { }
24 
25 		internal:
Window(MyGUI::Window * _native)26 			Window( MyGUI::Window* _native ) : TextBox(_native) { }
27 			Window( BaseWidget^ _parent, MyGUI::WidgetStyle _style, const std::string& _skin, const MyGUI::IntCoord& _coord, MyGUI::Align _align, const std::string& _layer, const std::string& _name )
28 			{
29 				CreateWidget(_parent, _style, _skin, _coord, _align, _layer, _name);
30 			}
31 
getClassTypeName()32 			virtual const std::string& getClassTypeName() override { return ThisType::getClassTypeName(); }
33 
34 			static BaseWidget^ WidgetCreator(BaseWidget^ _parent, MyGUI::WidgetStyle _style, const std::string& _skin, const MyGUI::IntCoord& _coord, MyGUI::Align _align, const std::string& _layer, const std::string& _name)
35 			{
36 				return gcnew Window(_parent, _style, _skin, _coord, _align, _layer, _name);
37 			}
38 
39 
40 			//InsertPoint
41 
42 	public:
43 		delegate void HandleWindowChangeCoord(
44 			Convert<MyGUI::Window *>::Type _sender );
45 		event HandleWindowChangeCoord^ EventWindowChangeCoord
46 		{
47 			void add(HandleWindowChangeCoord^ _value)
48 			{
49 				bool empty = mDelegateWindowChangeCoord == nullptr;
50 
51 				mDelegateWindowChangeCoord += _value;
52 				MMYGUI_CHECK_NATIVE(mNative);
53 
54 				if (empty)
55 					static_cast<ThisType*>(mNative)->eventWindowChangeCoord +=
56 						static_cast< MyGUI::delegates::IDelegate1<
57 							MyGUI::Window * > *>(
58 								new Delegate1< HandleWindowChangeCoord^ ,
59 								MyGUI::Window * >(mDelegateWindowChangeCoord) );
60 			}
61 			void remove(HandleWindowChangeCoord^ _value)
62 			{
63 				mDelegateWindowChangeCoord -= _value;
64 				MMYGUI_CHECK_NATIVE(mNative);
65 
66 				bool empty = mDelegateWindowChangeCoord == nullptr;
67 
68 				if (empty)
69 					static_cast<ThisType*>(mNative)->eventWindowChangeCoord -=
70 						static_cast< MyGUI::delegates::IDelegate1<
71 							MyGUI::Window * > *>(
72 								new Delegate1< HandleWindowChangeCoord^ ,
73 									MyGUI::Window * >(mDelegateWindowChangeCoord) );
74 			}
75 		}
76 	private:
77 		HandleWindowChangeCoord^ mDelegateWindowChangeCoord;
78 	public:
79 		delegate void HandleWindowButtonPressed(
80 			Convert<MyGUI::Window *>::Type _sender ,
81 			Convert<const std::string &>::Type _name );
82 		event HandleWindowButtonPressed^ EventWindowButtonPressed
83 		{
84 			void add(HandleWindowButtonPressed^ _value)
85 			{
86 				bool empty = mDelegateWindowButtonPressed == nullptr;
87 
88 				mDelegateWindowButtonPressed += _value;
89 				MMYGUI_CHECK_NATIVE(mNative);
90 
91 				if (empty)
92 					static_cast<ThisType*>(mNative)->eventWindowButtonPressed +=
93 						static_cast< MyGUI::delegates::IDelegate2<
94 							MyGUI::Window * ,
95 							const std::string & > *>(
96 								new Delegate2< HandleWindowButtonPressed^ ,
97 								MyGUI::Window * ,
98 								const std::string & >(mDelegateWindowButtonPressed) );
99 			}
100 			void remove(HandleWindowButtonPressed^ _value)
101 			{
102 				mDelegateWindowButtonPressed -= _value;
103 				MMYGUI_CHECK_NATIVE(mNative);
104 
105 				bool empty = mDelegateWindowButtonPressed == nullptr;
106 
107 				if (empty)
108 					static_cast<ThisType*>(mNative)->eventWindowButtonPressed -=
109 						static_cast< MyGUI::delegates::IDelegate2<
110 							MyGUI::Window * ,
111 							const std::string & > *>(
112 								new Delegate2< HandleWindowButtonPressed^ ,
113 									MyGUI::Window * ,
114 									const std::string & >(mDelegateWindowButtonPressed) );
115 			}
116 		}
117 	private:
118 		HandleWindowButtonPressed^ mDelegateWindowButtonPressed;
119 	public:
SetCoord(Convert<int>::Type _left,Convert<int>::Type _top,Convert<int>::Type _width,Convert<int>::Type _height)120 		void SetCoord(
121 			Convert<int>::Type _left ,
122 			Convert<int>::Type _top ,
123 			Convert<int>::Type _width ,
124 			Convert<int>::Type _height )
125 		{
126 			MMYGUI_CHECK_NATIVE(mNative);
127 			static_cast<ThisType*>(mNative)->setCoord(
128 				Convert<int>::From(_left) ,
129 				Convert<int>::From(_top) ,
130 				Convert<int>::From(_width) ,
131 				Convert<int>::From(_height) );
132 		}
133 	public:
SetSize(Convert<int>::Type _width,Convert<int>::Type _height)134 		void SetSize(
135 			Convert<int>::Type _width ,
136 			Convert<int>::Type _height )
137 		{
138 			MMYGUI_CHECK_NATIVE(mNative);
139 			static_cast<ThisType*>(mNative)->setSize(
140 				Convert<int>::From(_width) ,
141 				Convert<int>::From(_height) );
142 		}
143 	public:
SetPosition(Convert<int>::Type _left,Convert<int>::Type _top)144 		void SetPosition(
145 			Convert<int>::Type _left ,
146 			Convert<int>::Type _top )
147 		{
148 			MMYGUI_CHECK_NATIVE(mNative);
149 			static_cast<ThisType*>(mNative)->setPosition(
150 				Convert<int>::From(_left) ,
151 				Convert<int>::From(_top) );
152 		}
153 	public:
SetMaxSize(Convert<int>::Type _width,Convert<int>::Type _height)154 		void SetMaxSize(
155 			Convert<int>::Type _width ,
156 			Convert<int>::Type _height )
157 		{
158 			MMYGUI_CHECK_NATIVE(mNative);
159 			static_cast<ThisType*>(mNative)->setMaxSize(
160 				Convert<int>::From(_width) ,
161 				Convert<int>::From(_height) );
162 		}
163 	public:
SetMinSize(Convert<int>::Type _width,Convert<int>::Type _height)164 		void SetMinSize(
165 			Convert<int>::Type _width ,
166 			Convert<int>::Type _height )
167 		{
168 			MMYGUI_CHECK_NATIVE(mNative);
169 			static_cast<ThisType*>(mNative)->setMinSize(
170 				Convert<int>::From(_width) ,
171 				Convert<int>::From(_height) );
172 		}
173 	public:
DestroySmooth()174 		void DestroySmooth( )
175 		{
176 			MMYGUI_CHECK_NATIVE(mNative);
177 			static_cast<ThisType*>(mNative)->destroySmooth( );
178 		}
179 	public:
SetVisibleSmooth(Convert<bool>::Type _value)180 		void SetVisibleSmooth(
181 			Convert<bool>::Type _value )
182 		{
183 			MMYGUI_CHECK_NATIVE(mNative);
184 			static_cast<ThisType*>(mNative)->setVisibleSmooth(
185 				Convert<bool>::From(_value) );
186 		}
187 	public:
188 		property Convert<bool>::Type Movable
189 		{
get()190 			Convert<bool>::Type get( )
191 			{
192 				MMYGUI_CHECK_NATIVE(mNative);
193 				return Convert<bool>::To( static_cast<ThisType*>(mNative)->getMovable() );
194 			}
set(Convert<bool>::Type _value)195 			void set(Convert<bool>::Type _value)
196 			{
197 				MMYGUI_CHECK_NATIVE(mNative);
198 				static_cast<ThisType*>(mNative)->setMovable( Convert<bool>::From(_value) );
199 			}
200 		}
201 
202 	public:
203 		property Convert<const MyGUI::types::TCoord < int > &>::Type ActionScale
204 		{
get()205 			Convert<const MyGUI::types::TCoord < int > &>::Type get( )
206 			{
207 				MMYGUI_CHECK_NATIVE(mNative);
208 				return Convert<const MyGUI::types::TCoord < int > &>::To( static_cast<ThisType*>(mNative)->getActionScale() );
209 			}
210 		}
211 
212 	public:
213 		property Convert<bool>::Type Snap
214 		{
get()215 			Convert<bool>::Type get( )
216 			{
217 				MMYGUI_CHECK_NATIVE(mNative);
218 				return Convert<bool>::To( static_cast<ThisType*>(mNative)->getSnap() );
219 			}
set(Convert<bool>::Type _value)220 			void set(Convert<bool>::Type _value)
221 			{
222 				MMYGUI_CHECK_NATIVE(mNative);
223 				static_cast<ThisType*>(mNative)->setSnap( Convert<bool>::From(_value) );
224 			}
225 		}
226 
227 	public:
228 		property Convert<MyGUI::types::TSize < int >>::Type MaxSize
229 		{
get()230 			Convert<MyGUI::types::TSize < int >>::Type get( )
231 			{
232 				MMYGUI_CHECK_NATIVE(mNative);
233 				return Convert<MyGUI::types::TSize < int >>::To( static_cast<ThisType*>(mNative)->getMaxSize() );
234 			}
set(Convert<const MyGUI::types::TSize<int> &>::Type _value)235 			void set(Convert<const MyGUI::types::TSize < int > &>::Type _value)
236 			{
237 				MMYGUI_CHECK_NATIVE(mNative);
238 				static_cast<ThisType*>(mNative)->setMaxSize( Convert<const MyGUI::types::TSize < int > &>::From(_value) );
239 			}
240 		}
241 
242 	public:
243 		property Convert<MyGUI::types::TSize < int >>::Type MinSize
244 		{
get()245 			Convert<MyGUI::types::TSize < int >>::Type get( )
246 			{
247 				MMYGUI_CHECK_NATIVE(mNative);
248 				return Convert<MyGUI::types::TSize < int >>::To( static_cast<ThisType*>(mNative)->getMinSize() );
249 			}
set(Convert<const MyGUI::types::TSize<int> &>::Type _value)250 			void set(Convert<const MyGUI::types::TSize < int > &>::Type _value)
251 			{
252 				MMYGUI_CHECK_NATIVE(mNative);
253 				static_cast<ThisType*>(mNative)->setMinSize( Convert<const MyGUI::types::TSize < int > &>::From(_value) );
254 			}
255 		}
256 
257 	public:
258 		property Convert<MyGUI::TextBox *>::Type CaptionWidget
259 		{
get()260 			Convert<MyGUI::TextBox *>::Type get( )
261 			{
262 				MMYGUI_CHECK_NATIVE(mNative);
263 				return Convert<MyGUI::TextBox *>::To( static_cast<ThisType*>(mNative)->getCaptionWidget() );
264 			}
265 		}
266 
267 	public:
268 		property Convert<bool>::Type AutoAlpha
269 		{
get()270 			Convert<bool>::Type get( )
271 			{
272 				MMYGUI_CHECK_NATIVE(mNative);
273 				return Convert<bool>::To( static_cast<ThisType*>(mNative)->getAutoAlpha() );
274 			}
set(Convert<bool>::Type _value)275 			void set(Convert<bool>::Type _value)
276 			{
277 				MMYGUI_CHECK_NATIVE(mNative);
278 				static_cast<ThisType*>(mNative)->setAutoAlpha( Convert<bool>::From(_value) );
279 			}
280 		}
281 
282 		};
283 
284 	} // namespace Managed
285 } // namespace MyGUI
286