Planeshift
eeditpositiontoolbox.h
Go to the documentation of this file.
1 /*
2  * Author: Andrew Robberts
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef EEDIT_POSITION_TOOLBOX_WINDOW_HEADER
21 #define EEDIT_POSITION_TOOLBOX_WINDOW_HEADER
22 
23 #include "eedittoolbox.h"
24 #include "paws/pawswidget.h"
26 #include "eeditinputboxmanager.h"
27 #include <csutil/dirtyaccessarray.h>
28 
29 struct iSpriteCal3DState;
30 class pawsButton;
31 class pawsEditTextBox;
32 class pawsSpinBox;
33 class pawsRadioButton;
34 
40 class EEditPositionToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditPositionToolbox>
41 {
42 public:
44  virtual ~EEditPositionToolbox();
45 
49  void SetMeshFile(const csString & file);
50 
54  void FillAnimList(iSpriteCal3DState * cal3d);
55 
59  void SetPosition(const csVector3 & pos);
60 
61  // inheritted from EEditToolbox
62  virtual void Update(unsigned int elapsed);
63  virtual size_t GetType() const;
64  virtual const char * GetName() const;
65 
66  // inheritted from pawsWidget
67  virtual bool PostSetup();
68  virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
69 
70 private:
71 
74  class OnFileSelected : public iOnFileSelectedAction
75  {
76  private:
77  pawsEditTextBox * textBox;
78 
79  public:
83  OnFileSelected(pawsEditTextBox * widget) : textBox(widget)
84  {}
85 
88  virtual ~OnFileSelected() {}
89 
93  virtual void Execute(const csString & text);
94  };
95 
98  class OnAnimSelected : public EEditInputboxManager::iSelectList
99  {
100  public:
103  OnAnimSelected() {}
104 
107  virtual ~OnAnimSelected() {}
108 
109  virtual void Select(const csString & value, size_t index);
110  };
111 
112  pawsButton * moreLessButton;
113  pawsButton * animButton;
114  pawsButton * browseMesh;
115  pawsEditTextBox * meshFileText;
116  pawsSpinBox * posX;
117  pawsSpinBox * posY;
118  pawsSpinBox * posZ;
119  pawsSpinBox * rot;
120  pawsRadioButton * posTypeNone;
121  pawsRadioButton * posTypeAxis;
122  pawsRadioButton * posTypeCustom;
123 
124  csVector3 prevPos;
125  float prevRot;
126 
127  csDirtyAccessArray<csString> anims;
128 };
129 
131 
134 #endif
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
A combination widget that has up and down arrows and a text label.
Definition: pawsspinbox.h:56
A combination widget that has a radio button and a text label.
Definition: pawsradio.h:81
CREATE_PAWS_FACTORY(EEditPositionToolbox)
void SetPosition(const csVector3 &pos)
Sets the position of the actor.
An edit box widget/.
Definition: pawstextbox.h:409
virtual const char * GetName() const
Gets the name of the toolbox.
void FillAnimList(iSpriteCal3DState *cal3d)
Fills the animation list with the cal3d animations.
virtual size_t GetType() const
Gets the toolbox type.
A base class for all eedit toolbox windows.
Definition: eedittoolbox.h:26
virtual bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
A simple button widget.
Definition: pawsbutton.h:43
virtual void Update(unsigned int elapsed)
Updates the toobox.
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
This handles the effect position object.
virtual ~EEditPositionToolbox()
void SetMeshFile(const csString &file)
Sets the path to the position&#39;s mesh indicator, to be filled in the edit box.