Torque3D Documentation / _generateds / guiScriptNotifyControl.cpp

guiScriptNotifyControl.cpp

Engine/source/gui/core/guiScriptNotifyControl.cpp

More...

Public Functions

ConsoleDocClass(GuiScriptNotifyCtrl , "@brief A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> which adds several reactions <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> other GUIs via <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callbacks.\n\n</a>" "<a href="/coding/class/classguiscriptnotifyctrl/">GuiScriptNotifyCtrl</a> does not exist <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> anything. When parented or made <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child of " "other controls, you can toggle flags on or off <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make use of its specialized callbacks. " "Normally these callbacks are used as utility functions by the GUI Editor, or other container " "classes. However, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> very fancy GUI work where controls interact with each other " " constantly, this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> handy utility <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">of.\n\n</a> " " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Common member fields left out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> sake of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">example\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classguiscriptnotifyctrl/">GuiScriptNotifyCtrl</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " onChildAdded=\"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "	onChildRemoved = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "	onChildResized = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "	onParentResized = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiUtil\n</a>" )
IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onChildAdded , void , (SimObjectId ID, SimObjectId childID) , (ID, childID) , "Called when <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child is added <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GUI.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param childID Unique object ID of child being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">added.\n</a>" )
IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onChildRemoved , void , (SimObjectId ID, SimObjectId childID) , (ID, childID) , "Called when <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child is removed from this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GUI.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param childID Unique object ID of child being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">removed.\n</a>" )
IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onChildResized , void , (SimObjectId ID, SimObjectId childID) , (ID, childID) , "Called when <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child is of this GUI is being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param childID Unique object ID of child being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n</a>" )
IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onGainFirstResponder , void , (SimObjectId ID) , (ID) , "Called when this GUI gains <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">focus.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onLoseFirstResponder , void , (SimObjectId ID) , (ID) , "Called when this GUI loses <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">focus.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onParentResized , void , (SimObjectId ID) , (ID) , "Called when this GUI's parent is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onResize , void , (SimObjectId ID) , (ID) , "Called when this GUI is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )

Detailed Description

Public Functions

ConsoleDocClass(GuiScriptNotifyCtrl , "@brief A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> which adds several reactions <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> other GUIs via <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callbacks.\n\n</a>" "<a href="/coding/class/classguiscriptnotifyctrl/">GuiScriptNotifyCtrl</a> does not exist <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> anything. When parented or made <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child of " "other controls, you can toggle flags on or off <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make use of its specialized callbacks. " "Normally these callbacks are used as utility functions by the GUI Editor, or other container " "classes. However, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> very fancy GUI work where controls interact with each other " " constantly, this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> handy utility <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">of.\n\n</a> " " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Common member fields left out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> sake of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">example\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classguiscriptnotifyctrl/">GuiScriptNotifyCtrl</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " onChildAdded=\"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "	onChildRemoved = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "	onChildResized = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "	onParentResized = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiUtil\n</a>" )

IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onChildAdded , void , (SimObjectId ID, SimObjectId childID) , (ID, childID) , "Called when <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child is added <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GUI.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param childID Unique object ID of child being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">added.\n</a>" )

IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onChildRemoved , void , (SimObjectId ID, SimObjectId childID) , (ID, childID) , "Called when <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child is removed from this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GUI.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param childID Unique object ID of child being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">removed.\n</a>" )

IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onChildResized , void , (SimObjectId ID, SimObjectId childID) , (ID, childID) , "Called when <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> child is of this GUI is being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param childID Unique object ID of child being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n</a>" )

IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onGainFirstResponder , void , (SimObjectId ID) , (ID) , "Called when this GUI gains <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">focus.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )

IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onLoseFirstResponder , void , (SimObjectId ID) , (ID) , "Called when this GUI loses <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">focus.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )

IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onParentResized , void , (SimObjectId ID) , (ID) , "Called when this GUI's parent is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )

IMPLEMENT_CALLBACK(GuiScriptNotifyCtrl , onResize , void , (SimObjectId ID) , (ID) , "Called when this GUI is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">resized.\n\n</a>" "@param ID Unique object ID assigned when created (%this in script).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )

IMPLEMENT_CONOBJECT(GuiScriptNotifyCtrl )

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#include "gui/core/guiScriptNotifyControl.h"
 25#include "console/consoleTypes.h"
 26#include "console/engineAPI.h"
 27
 28//------------------------------------------------------------------------------
 29
 30IMPLEMENT_CONOBJECT(GuiScriptNotifyCtrl);
 31
 32ConsoleDocClass( GuiScriptNotifyCtrl,
 33   "@brief A control which adds several reactions to other GUIs via callbacks.\n\n"
 34
 35   "GuiScriptNotifyCtrl does not exist to render anything. When parented or made a child of "
 36   "other controls, you can toggle flags on or off to make use of its specialized callbacks. "
 37   "Normally these callbacks are used as utility functions by the GUI Editor, or other container "
 38   "classes. However, for very fancy GUI work where controls interact with each other "
 39   "constantly, this is a handy utility to make use of.\n\n "
 40
 41   "@tsexample\n"
 42   "// Common member fields left out for sake of example\n"
 43   "new GuiScriptNotifyCtrl()\n"
 44   "{\n"
 45   "  onChildAdded = \"0\";\n"
 46   "  onChildRemoved = \"0\";\n"
 47   "  onChildResized = \"0\";\n"
 48   "  onParentResized = \"0\";\n"
 49   "};\n"
 50   "@endtsexample\n\n"
 51
 52   "@ingroup GuiUtil\n");
 53
 54GuiScriptNotifyCtrl::GuiScriptNotifyCtrl()
 55{
 56   mOnChildAdded = false;
 57   mOnChildRemoved = false;
 58   mOnResize = false;
 59   mOnChildResized = false;
 60   mOnParentResized = false;
 61   mOnLoseFirstResponder = true;
 62   mOnGainFirstResponder = true;
 63}
 64
 65GuiScriptNotifyCtrl::~GuiScriptNotifyCtrl()
 66{
 67}
 68
 69void GuiScriptNotifyCtrl::initPersistFields()
 70{
 71   // Callbacks Group
 72   addGroup("Callbacks");
 73   addField("notifyOnChildAdded", TypeBool, Offset( mOnChildAdded, GuiScriptNotifyCtrl ), "Enables/disables onChildAdded callback" );
 74   addField("notifyOnChildRemoved", TypeBool, Offset( mOnChildRemoved, GuiScriptNotifyCtrl ), "Enables/disables onChildRemoved callback" );
 75   addField("notifyOnChildResized", TypeBool, Offset( mOnChildResized, GuiScriptNotifyCtrl ), "Enables/disables onChildResized callback" );
 76   addField("notifyOnParentResized", TypeBool, Offset( mOnParentResized, GuiScriptNotifyCtrl ), "Enables/disables onParentResized callback" );
 77   addField("notifyOnResize", TypeBool, Offset( mOnResize, GuiScriptNotifyCtrl ), "Enables/disables onResize callback" );
 78   addField("notifyOnLoseFirstResponder", TypeBool, Offset( mOnLoseFirstResponder, GuiScriptNotifyCtrl ), "Enables/disables onLoseFirstResponder callback" );
 79   addField("notifyOnGainFirstResponder", TypeBool, Offset( mOnGainFirstResponder, GuiScriptNotifyCtrl ), "Enables/disables onGainFirstResponder callback" );
 80   endGroup("Callbacks");
 81
 82   Parent::initPersistFields();
 83}
 84
 85IMPLEMENT_CALLBACK( GuiScriptNotifyCtrl, onResize, void, ( SimObjectId ID ), ( ID ),
 86   "Called when this GUI is resized.\n\n"
 87   "@param ID Unique object ID assigned when created (%this in script).\n"
 88);
 89IMPLEMENT_CALLBACK( GuiScriptNotifyCtrl, onChildAdded, void, ( SimObjectId ID, SimObjectId childID ), ( ID, childID ),
 90   "Called when a child is added to this GUI.\n\n"
 91   "@param ID Unique object ID assigned when created (%this in script).\n"
 92   "@param childID Unique object ID of child being added.\n"
 93);
 94IMPLEMENT_CALLBACK( GuiScriptNotifyCtrl, onChildRemoved, void, ( SimObjectId ID, SimObjectId childID ), ( ID, childID ),
 95   "Called when a child is removed from this GUI.\n\n"
 96   "@param ID Unique object ID assigned when created (%this in script).\n"
 97   "@param childID Unique object ID of child being removed.\n"
 98);
 99IMPLEMENT_CALLBACK( GuiScriptNotifyCtrl, onChildResized, void, ( SimObjectId ID, SimObjectId childID ), ( ID, childID ),
100   "Called when a child is of this GUI is being resized.\n\n"
101   "@param ID Unique object ID assigned when created (%this in script).\n"
102   "@param childID Unique object ID of child being resized.\n"
103);
104IMPLEMENT_CALLBACK( GuiScriptNotifyCtrl, onParentResized, void, ( SimObjectId ID ), ( ID ),
105   "Called when this GUI's parent is resized.\n\n"
106   "@param ID Unique object ID assigned when created (%this in script).\n"
107);
108IMPLEMENT_CALLBACK( GuiScriptNotifyCtrl, onLoseFirstResponder, void, ( SimObjectId ID ), ( ID ),
109   "Called when this GUI loses focus.\n\n"
110   "@param ID Unique object ID assigned when created (%this in script).\n"
111);
112IMPLEMENT_CALLBACK( GuiScriptNotifyCtrl, onGainFirstResponder, void, ( SimObjectId ID ), ( ID ),
113   "Called when this GUI gains focus.\n\n"
114   "@param ID Unique object ID assigned when created (%this in script).\n"
115);
116
117// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
118void GuiScriptNotifyCtrl::onChildAdded( GuiControl *child )
119{
120   Parent::onChildAdded( child );
121
122   // Call Script.
123   if( mOnChildAdded )
124      onChildAdded_callback(getId(), child->getId());
125}
126
127void GuiScriptNotifyCtrl::onChildRemoved( GuiControl *child )
128{
129   Parent::onChildRemoved( child );
130
131   // Call Script.
132   if( mOnChildRemoved )
133      onChildRemoved_callback(getId(), child->getId());
134}
135//----------------------------------------------------------------
136
137bool GuiScriptNotifyCtrl::resize(const Point2I &newPosition, const Point2I &newExtent)
138{
139   if( !Parent::resize( newPosition, newExtent ) )
140      return false;
141
142   // Call Script.
143   if( mOnResize )
144      onResize_callback(getId());
145
146   return true;
147}
148
149void GuiScriptNotifyCtrl::childResized(GuiScriptNotifyCtrl *child)
150{
151   Parent::childResized( child );
152
153   // Call Script.
154   if( mOnChildResized )
155      onChildResized_callback(getId(), child->getId());
156}
157
158void GuiScriptNotifyCtrl::parentResized(const RectI &oldParentRect, const RectI &newParentRect)
159{
160   Parent::parentResized( oldParentRect, newParentRect );
161
162   // Call Script.
163   if( mOnParentResized )
164      onParentResized_callback(getId());
165}
166 
167void GuiScriptNotifyCtrl::onLoseFirstResponder()
168{
169   Parent::onLoseFirstResponder();
170
171   // Call Script.
172   if( mOnLoseFirstResponder )
173      onLoseFirstResponder_callback(getId());
174}
175
176void GuiScriptNotifyCtrl::setFirstResponder( GuiControl* firstResponder )
177{
178   Parent::setFirstResponder( firstResponder );
179
180   // Call Script.
181   if( mOnGainFirstResponder && isFirstResponder() )
182      onGainFirstResponder_callback(getId());
183}
184
185void GuiScriptNotifyCtrl::setFirstResponder()
186{
187   Parent::setFirstResponder();
188
189   // Call Script.
190   if( mOnGainFirstResponder && isFirstResponder() )
191      onGainFirstResponder_callback(getId());
192}
193
194void GuiScriptNotifyCtrl::onMessage(GuiScriptNotifyCtrl *sender, S32 msg)
195{
196   Parent::onMessage( sender, msg );
197}
198
199void GuiScriptNotifyCtrl::onDialogPush()
200{
201   Parent::onDialogPush();
202}
203
204void GuiScriptNotifyCtrl::onDialogPop()
205{
206   Parent::onDialogPop();
207}
208
209
210//void GuiScriptNotifyCtrl::onMouseUp(const GuiEvent &event)
211//{
212//}
213//
214//void GuiScriptNotifyCtrl::onMouseDown(const GuiEvent &event)
215//{
216//}
217//
218//void GuiScriptNotifyCtrl::onMouseMove(const GuiEvent &event)
219//{
220//}
221//
222//void GuiScriptNotifyCtrl::onMouseDragged(const GuiEvent &event)
223//{
224//}
225//
226//void GuiScriptNotifyCtrl::onMouseEnter(const GuiEvent &)
227//{
228//}
229//
230//void GuiScriptNotifyCtrl::onMouseLeave(const GuiEvent &)
231//{
232//}
233//
234//bool GuiScriptNotifyCtrl::onMouseWheelUp( const GuiEvent &event )
235//{
236//}
237//
238//bool GuiScriptNotifyCtrl::onMouseWheelDown( const GuiEvent &event )
239//{
240//}
241//
242//void GuiScriptNotifyCtrl::onRightMouseDown(const GuiEvent &)
243//{
244//}
245//
246//void GuiScriptNotifyCtrl::onRightMouseUp(const GuiEvent &)
247//{
248//}
249//
250//void GuiScriptNotifyCtrl::onRightMouseDragged(const GuiEvent &)
251//{
252//}
253//
254//void GuiScriptNotifyCtrl::onMiddleMouseDown(const GuiEvent &)
255//{
256//}
257//
258//void GuiScriptNotifyCtrl::onMiddleMouseUp(const GuiEvent &)
259//{
260//}
261//
262//void GuiScriptNotifyCtrl::onMiddleMouseDragged(const GuiEvent &)
263//{
264//}
265//void GuiScriptNotifyCtrl::onMouseDownEditor(const GuiEvent &event, Point2I offset)
266//{
267//}
268//void GuiScriptNotifyCtrl::onRightMouseDownEditor(const GuiEvent &event, Point2I offset)
269//{
270//}
271
272//bool GuiScriptNotifyCtrl::onKeyDown(const GuiEvent &event)
273//{
274//  if ( Parent::onKeyDown( event ) )
275//     return true;
276//}
277//
278//bool GuiScriptNotifyCtrl::onKeyRepeat(const GuiEvent &event)
279//{
280//   // default to just another key down.
281//   return onKeyDown(event);
282//}
283//
284//bool GuiScriptNotifyCtrl::onKeyUp(const GuiEvent &event)
285//{
286//  if ( Parent::onKeyUp( event ) )
287//     return true;
288//}
289