customField.h

Engine/source/gui/editor/inspector/customField.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_CUSTOMFIELD_H_
25#define _GUI_INSPECTOR_CUSTOMFIELD_H_
26
27#include "console/simFieldDictionary.h"
28#include "gui/editor/inspector/field.h"
29
30class GuiInspectorCustomField : public GuiInspectorField
31{
32   typedef GuiInspectorField Parent;   
33
34public:
35
36   GuiInspectorCustomField( GuiInspector *inspector, GuiInspectorGroup* parent, SimFieldDictionary::Entry* field );
37   GuiInspectorCustomField();
38   ~GuiInspectorCustomField() {};
39
40   DECLARE_CONOBJECT( GuiInspectorCustomField );
41
42   virtual void             setData( const char* data, bool callbacks = true );
43   virtual const char*      getData( U32 inspectObjectIndex = 0 );
44   virtual void             updateValue();
45   virtual StringTableEntry getFieldName() { return StringTable->EmptyString(); }
46
47   virtual void setDoc( const char* doc );
48   virtual void setToolTip( StringTableEntry data );
49
50   virtual bool onAdd();
51
52   virtual void setInspectorField( AbstractClassRep::Field *field, 
53                                   StringTableEntry caption = NULL,
54                                   const char *arrayIndex = NULL );
55   
56   virtual GuiControl* constructEditControl();
57
58   virtual void setValue( const char* newValue );
59
60protected:
61
62   virtual void _executeSelectedCallback();
63
64protected:
65
66   String mCustomValue;
67   StringTableEntry mDoc;
68};
69
70#endif // _GUI_INSPECTOR_DYNAMICFIELD_H_
71