afxEventCatchAll.cpp
Engine/source/afx/ui/afxEventCatchAll.cpp
Classes:
class
Public Functions
ConsoleDocClass(afxEventCatchAll , "@brief A simple but useful GUI <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> that propagates all events <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> its parent " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n\n</a>" "<a href="/coding/class/classafxeventcatchall/">afxEventCatchAll</a> is useful when you want certain events <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be handled by its parent " "<a href="/coding/class/classafxtsctrl/">afxTSCtrl</a> and not get consumed by certain non-interactive controls like <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> text " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">HUD.\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxGUI\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" )
Detailed Description
Public Functions
ConsoleDocClass(afxEventCatchAll , "@brief A simple but useful GUI <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> that propagates all events <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> its parent " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n\n</a>" "<a href="/coding/class/classafxeventcatchall/">afxEventCatchAll</a> is useful when you want certain events <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be handled by its parent " "<a href="/coding/class/classafxtsctrl/">afxTSCtrl</a> and not get consumed by certain non-interactive controls like <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> text " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">HUD.\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxGUI\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" )
IMPLEMENT_CONOBJECT(afxEventCatchAll )
1 2 3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames 5// Copyright (C) 2015 Faust Logic, Inc. 6// 7// Permission is hereby granted, free of charge, to any person obtaining a copy 8// of this software and associated documentation files (the "Software"), to 9// deal in the Software without restriction, including without limitation the 10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11// sell copies of the Software, and to permit persons to whom the Software is 12// furnished to do so, subject to the following conditions: 13// 14// The above copyright notice and this permission notice shall be included in 15// all copies or substantial portions of the Software. 16// 17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23// IN THE SOFTWARE. 24// 25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 26 27#include "afx/arcaneFX.h" 28 29#include "gui/3d/guiTSControl.h" 30 31class afxEventCatchAll : public GuiControl 32{ 33 typedef GuiControl Parent; 34 35public: 36 /* C */ afxEventCatchAll() { } 37 38 virtual void getCursor(GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent); 39 40 virtual void onMouseUp(const GuiEvent&); 41 virtual void onMouseDown(const GuiEvent&); 42 virtual void onMouseMove(const GuiEvent&); 43 virtual void onMouseDragged(const GuiEvent&); 44 virtual void onMouseEnter(const GuiEvent&); 45 virtual void onMouseLeave(const GuiEvent&); 46 47 virtual bool onMouseWheelUp(const GuiEvent&); 48 virtual bool onMouseWheelDown(const GuiEvent&); 49 50 virtual void onRightMouseDown(const GuiEvent&); 51 virtual void onRightMouseUp(const GuiEvent&); 52 virtual void onRightMouseDragged(const GuiEvent&); 53 54 DECLARE_CONOBJECT(afxEventCatchAll); 55 DECLARE_CATEGORY("AFX"); 56}; 57 58//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 59 60IMPLEMENT_CONOBJECT(afxEventCatchAll); 61 62ConsoleDocClass( afxEventCatchAll, 63 "@brief A simple but useful GUI control that propagates all events to its parent " 64 "control.\n\n" 65 66 "afxEventCatchAll is useful when you want certain events to be handled by its parent " 67 "afxTSCtrl and not get consumed by certain non-interactive controls like a text " 68 "HUD.\n\n" 69 70 "@ingroup afxGUI\n" 71 "@ingroup AFX\n" 72); 73 74void afxEventCatchAll::getCursor(GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent) 75{ 76 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 77 if (parent) parent->getCursor(cursor, showCursor, lastGuiEvent); 78} 79 80void afxEventCatchAll::onMouseUp(const GuiEvent& evt) 81{ 82 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 83 if (parent) parent->onMouseUp(evt); 84} 85 86void afxEventCatchAll::onMouseDown(const GuiEvent& evt) 87{ 88 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 89 if (parent) parent->onMouseDown(evt); 90} 91 92void afxEventCatchAll::onMouseMove(const GuiEvent& evt) 93{ 94 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 95 if (parent) parent->onMouseMove(evt); 96} 97 98void afxEventCatchAll::onMouseDragged(const GuiEvent& evt) 99{ 100 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 101 if (parent) parent->onMouseDragged(evt); 102} 103 104void afxEventCatchAll::onMouseEnter(const GuiEvent& evt) 105{ 106 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 107 if (parent) parent->onMouseEnter(evt); 108} 109 110void afxEventCatchAll::onMouseLeave(const GuiEvent& evt) 111{ 112 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 113 if (parent) parent->onMouseLeave(evt); 114} 115 116bool afxEventCatchAll::onMouseWheelUp(const GuiEvent& evt) 117{ 118 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 119 return (parent) ? parent->onMouseWheelUp(evt) : false; 120} 121 122bool afxEventCatchAll::onMouseWheelDown(const GuiEvent& evt) 123{ 124 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 125 return (parent) ? parent->onMouseWheelDown(evt) : false; 126} 127 128void afxEventCatchAll::onRightMouseDown(const GuiEvent& evt) 129{ 130 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 131 if (parent) parent->onRightMouseDown(evt); 132} 133 134void afxEventCatchAll::onRightMouseUp(const GuiEvent& evt) 135{ 136 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 137 if (parent) parent->onRightMouseUp(evt); 138} 139 140void afxEventCatchAll::onRightMouseDragged(const GuiEvent& evt) 141{ 142 GuiTSCtrl* parent = dynamic_cast<GuiTSCtrl*>(getParent()); 143 if (parent) parent->onRightMouseDragged(evt); 144} 145 146//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 147 148 149