48 void UnregisterWidget(
Widget w )
50 m_OnMouseButtonDownRegister.Remove( w );
51 m_OnMouseButtonUpRegister.Remove( w );
52 m_OnMouseWheel.Remove( w );
53 m_OnDropReceived.Remove( w );
56 m_OnDraggingOver.Remove( w );
57 m_OnMouseEnter.Remove( w );
58 m_OnMouseButtonLeave.Remove( w );
59 m_OnClick.Remove( w );
60 m_OnDoubleClick.Remove( w );
61 m_OnDoubleClick.Remove( w );
62 m_OnFocus.Remove( w );
63 m_OnFocusLost.Remove( w );
64 m_OnController.Remove( w );
65 m_OnChildAdd.Remove( w );
66 m_OnChildRemove.Remove( w );
70 void RegisterOnMouseButtonDown(
Widget w,
Managed eventHandler,
string functionName )
74 m_OnMouseButtonDownRegister.Insert( w, param );
77 void RegisterOnMouseButtonUp(
Widget w,
Managed eventHandler,
string functionName )
81 m_OnMouseButtonUpRegister.Insert( w, param );
84 void RegisterOnMouseWheel(
Widget w,
Managed eventHandler,
string functionName )
88 m_OnMouseWheel.Insert( w, param );
91 void RegisterOnDropReceived(
Widget w,
Managed eventHandler,
string functionName )
95 m_OnDropReceived.Insert( w, param );
98 void RegisterOnDrag(
Widget w,
Managed eventHandler,
string functionName )
100 w.SetHandler(
this );
102 m_OnDrag.Insert( w, param );
105 void RegisterOnDrop(
Widget w,
Managed eventHandler,
string functionName )
107 w.SetHandler(
this );
109 m_OnDrop.Insert( w, param );
112 void RegisterOnDraggingOver(
Widget w,
Managed eventHandler,
string functionName )
114 w.SetHandler(
this );
116 m_OnDraggingOver.Insert( w, param );
119 void RegisterOnMouseEnter(
Widget w,
Managed eventHandler,
string functionName )
121 w.SetHandler(
this );
123 m_OnMouseEnter.Insert( w, param );
126 void RegisterOnMouseLeave(
Widget w,
Managed eventHandler,
string functionName )
128 w.SetHandler(
this );
130 m_OnMouseButtonLeave.Insert( w, param );
133 void RegisterOnClick(
Widget w,
Managed eventHandler,
string functionName )
135 w.SetHandler(
this );
137 m_OnClick.Insert( w, param );
140 void RegisterOnDoubleClick(
Widget w,
Managed eventHandler,
string functionName )
142 w.SetHandler(
this );
144 m_OnDoubleClick.Insert( w, param );
147 void RegisterOnFocus(
Widget w,
Managed eventHandler,
string functionName )
149 w.SetHandler(
this );
151 m_OnFocus.Insert( w, param );
153 void RegisterOnFocusLost(
Widget w,
Managed eventHandler,
string functionName )
155 w.SetHandler(
this );
157 m_OnFocusLost.Insert( w, param );
160 void RegisterOnChildAdd(
Widget w,
Managed eventHandler,
string functionName )
162 w.SetHandler(
this );
164 m_OnChildAdd.Insert( w, param );
167 void RegisterOnChildRemove(
Widget w,
Managed eventHandler,
string functionName )
169 w.SetHandler(
this );
171 m_OnChildRemove.Insert( w, param );
174 override bool OnClick(
Widget w,
int x,
int y,
int button)
184 m_OnClick.Remove( w );
187 Param param2 =
new Param4<Widget, int, int, int>( w,
x,
y, button );
188 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
193 override bool OnDoubleClick(
Widget w,
int x,
int y,
int button)
203 m_OnDoubleClick.Remove( w );
206 Param param2 =
new Param4<Widget, int, int, int>( w,
x,
y, button );
207 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
222 m_OnMouseButtonLeave.Remove( w );
225 Param param2 =
new Param4<Widget, Widget, int, int>( w, enterW,
x,
y );
226 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
231 override bool OnMouseEnter(
Widget w,
int x,
int y )
241 m_OnMouseEnter.Remove( w );
245 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
250 override bool OnMouseButtonDown(
Widget w,
int x,
int y,
int button )
260 m_OnMouseButtonDownRegister.Remove( w );
263 Param param2 =
new Param4<Widget, int, int, int>( w,
x,
y, button );
264 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
269 override bool OnMouseButtonUp(
Widget w,
int x,
int y,
int button )
279 m_OnMouseButtonUpRegister.Remove( w );
282 Param param2 =
new Param4<Widget, int, int, int>( w,
x,
y, button );
283 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
288 override bool OnDrag(
Widget w,
int x,
int y)
298 m_OnDrag.Remove( w );
302 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
317 m_OnDrop.Remove( w );
321 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
326 override bool OnDraggingOver(
Widget w,
int x,
int y,
Widget reciever)
336 m_OnDraggingOver.Remove( w );
339 Param param2 =
new Param4<Widget, int, int, Widget>( w,
x,
y, reciever );
340 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
345 override bool OnDropReceived(
Widget w,
int x,
int y,
Widget reciever )
347 if( w.GetName() ==
"GridItem" )
351 Param p = m_OnDropReceived.Get( reciever );
360 m_OnDropReceived.Remove( w );
363 Param param2 =
new Param4<Widget, int, int, Widget>( w,
x,
y, reciever );
364 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
369 override bool OnFocus(
Widget w,
int x,
int y )
379 m_OnFocus.Remove( w );
383 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
388 override bool OnFocusLost(
Widget w,
int x,
int y )
398 m_OnFocusLost.Remove( w );
402 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
407 override bool OnMouseWheel(
Widget w,
int x,
int y,
int wheel)
417 m_OnMouseWheel.Remove( w );
420 Param param2 =
new Param4<Widget, int, int, int>( w,
x,
y, wheel );
421 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
436 m_OnChildAdd.Remove( w );
440 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );
455 m_OnChildRemove.Remove( w );
459 GetGame().GameScript.CallFunctionParams( param.param1, param.param2, NULL, param2 );