Torque3D Documentation / _generateds / mountingGroup.h

mountingGroup.h

Engine/source/gui/editor/inspector/mountingGroup.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 GUI_INSPECTOR_MOUNTINGGROUP_H
 25#define GUI_INSPECTOR_MOUNTINGGROUP_H
 26
 27#include "gui/editor/inspector/group.h"
 28#include "console/simFieldDictionary.h"
 29#include "T3D/components/component.h"
 30#include "gui/controls/guiPopUpCtrlEx.h"
 31
 32#ifndef _GUI_INSPECTOR_TYPES_H_
 33#include "gui/editor/guiInspectorTypes.h"
 34#endif
 35
 36#ifndef _ENTITY_H_
 37#include "T3D/entity.h"
 38#endif
 39
 40class GuiInspectorMountingGroup;
 41
 42class GuiInspectorNodeListField : public GuiInspectorField
 43{
 44   typedef GuiInspectorField Parent;
 45   friend class GuiInspectorMountingGroup;
 46
 47public:
 48
 49   GuiInspectorNodeListField( GuiInspector *inspector, GuiInspectorGroup* parent, SimFieldDictionary::Entry* field,
 50                                                    SimObjectPtr<Entity> target  );
 51   GuiInspectorNodeListField();
 52   ~GuiInspectorNodeListField() {};
 53
 54   DECLARE_CONOBJECT( GuiInspectorNodeListField );
 55
 56   virtual void             setData( const char* data, bool callbacks = true );
 57   virtual const char*      getData( U32 inspectObjectIndex = 0 );
 58   virtual void             updateValue();
 59   virtual StringTableEntry getFieldName() { return StringTable->EmptyString(); }
 60
 61   virtual void setDoc( const char* doc );
 62   virtual void setToolTip( StringTableEntry data );
 63
 64   virtual bool onAdd();
 65
 66   virtual void setInspectorField( AbstractClassRep::Field *field, 
 67                                   StringTableEntry caption = NULL,
 68                                   const char *arrayIndex = NULL );
 69   
 70   virtual GuiControl* constructEditControl();
 71
 72   virtual void setValue( const char* newValue );
 73
 74   void setTargetEntity(SimObjectPtr<Entity> target);
 75
 76protected:
 77
 78   virtual void _executeSelectedCallback();
 79
 80protected:
 81
 82   String mCustomValue;
 83   StringTableEntry mDoc;
 84
 85   GuiPopUpMenuCtrl  *mMenu;
 86
 87   SimObjectPtr<Entity> mTargetEntity;
 88};
 89
 90class GuiInspectorMountingGroup : public GuiInspectorGroup
 91{
 92private:
 93   typedef GuiInspectorGroup Parent;
 94   GuiControl* mAddCtrl;
 95
 96   GuiPopUpMenuCtrlEx* mAddBhvrList;
 97
 98   GuiTextCtrl    *persistText;
 99   GuiButtonCtrl *reloadFile;
100   GuiButtonCtrl *saveFile;
101   GuiButtonCtrl *overwriteFile;
102   GuiButtonCtrl *mBrowseButton;
103   GuiControl    *filePath;
104
105   GuiControl        *targetMountCtrl;
106   GuiTextCtrl       *targetMountText;
107   GuiPopUpMenuCtrl  *targetMountNode;
108
109   GuiControl        *mountCtrl;
110   GuiTextCtrl       *mountText;
111   GuiPopUpMenuCtrl  *mountNode;
112
113   GuiInspectorNodeListField* mountNodeList;
114   GuiInspectorNodeListField* targetMountNodeList;
115
116   SimObjectPtr<GuiInspector>   mParentInspector;
117
118public:
119   DECLARE_CONOBJECT(GuiInspectorMountingGroup);
120   GuiInspectorMountingGroup() { /*mNeedScroll=false;*/ };
121   GuiInspectorMountingGroup( StringTableEntry groupName, SimObjectPtr<GuiInspector> parent );
122
123   //-----------------------------------------------------------------------------
124   // inspectGroup is overridden in GuiInspectorMountingGroup to inspect an 
125   // objects FieldDictionary (dynamic fields) instead of regular persistent
126   // fields.
127   bool inspectGroup();
128   virtual void updateAllFields();
129
130   void onMouseMove(const GuiEvent &event);
131
132   // For scriptable dynamic field additions
133   void addDynamicField();
134
135   // Clear our fields (delete them)
136   void clearFields();
137
138   virtual bool resize( const Point2I &newPosition, const Point2I &newExtent );
139
140   // Find an already existent field by name in the dictionary
141   virtual SimFieldDictionary::Entry* findDynamicFieldInDictionary( StringTableEntry fieldName );
142
143   AbstractClassRep::Field* findObjectComponentField(Component* target, String fieldName);
144protected:
145   // create our inner controls when we add
146   virtual bool createContent();
147
148   GuiControl* buildMenuCtrl();
149
150   bool buildList(Entity* ent, GuiPopUpMenuCtrl* menu);
151};
152
153#endif
154