Torque3D Documentation / _generateds / guiTabPageCtrl.h

guiTabPageCtrl.h

Engine/source/gui/controls/guiTabPageCtrl.h

More...

Classes:

Detailed Description

 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#ifndef _GUITABPAGECTRL_H_
25#define _GUITABPAGECTRL_H_
26
27#ifndef _GUITEXTCTRL_H_
28#include "gui/controls/guiTextCtrl.h"
29#endif
30
31class GuiTabPageCtrl : public GuiTextCtrl
32{
33   private:
34      typedef GuiTextCtrl Parent;
35
36      bool           mFitBook;   ///< Resize to fit book when first added
37      S32            mTabIndex;
38
39   public:
40      GuiTabPageCtrl();
41      
42      DECLARE_CONOBJECT(GuiTabPageCtrl);
43      DECLARE_CATEGORY( "Gui Containers" );
44      DECLARE_DESCRIPTION( "A page in a GuiTabBookCtrl." );
45      
46      static void initPersistFields();
47
48      bool onWake();    ///< The page awakens (becomes active)!
49      void onSleep();   ///< The page sleeps (zzzzZZ - becomes inactive)
50      void inspectPostApply();
51
52      bool getFitBook() { return mFitBook; }
53      void setFitBook(bool state) { mFitBook = state; }
54
55      GuiControl* findHitControl(const Point2I &pt, S32 initialLayer = -1); ///< Find which control is hit by the mouse starting at a specified layer
56
57      void onMouseDown(const GuiEvent &event);  ///< Called when a mouseDown event occurs
58      bool onMouseDownEditor(const GuiEvent &event, Point2I offset );   ///< Called when a mouseDown event occurs and the GUI editor is active
59
60      S32 getTabIndex(void) { return mTabIndex; }  ///< Get the tab index of this control
61
62      //only cycle tabs through the current window, so overwrite the method
63      GuiControl* findNextTabable(GuiControl *curResponder, bool firstCall = true);
64      GuiControl* findPrevTabable(GuiControl *curResponder, bool firstCall = true);
65
66      void selectWindow(void);               ///< Select this window
67
68      virtual void setText(const char *txt = NULL); ///< Override setText function to signal parent we need to update.
69
70      void onRender(Point2I offset, const RectI &updateRect);  ///< Called when it's time to render this page to the scene
71};
72
73#endif //_GUI_WINDOW_CTRL_H
74