Planeshift
eedittargettoolbox.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_TARGET_TOOLBOX_WINDOW_HEADER
21 #define EEDIT_TARGET_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 
31 class pawsButton;
32 class pawsEditTextBox;
33 class pawsSpinBox;
34 class pawsRadioButton;
35 
42 class EEditTargetToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditTargetToolbox>
43 {
44 public:
46  virtual ~EEditTargetToolbox();
47 
51  void SetMeshFile(const csString & file);
52 
56  void FillAnimList(iSpriteCal3DState * cal3d);
57 
61  void SetPosition(const csVector3 & pos);
62 
63  // inheritted from EEditToolbox
64  virtual void Update(unsigned int elapsed);
65  virtual size_t GetType() const;
66  virtual const char * GetName() const;
67 
68  // inheritted from pawsWidget
69  virtual bool PostSetup();
70  virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
71 
72 private:
73 
76  class OnFileSelected : public iOnFileSelectedAction
77  {
78  private:
79  pawsEditTextBox * textBox;
80 
81  public:
85  OnFileSelected(pawsEditTextBox * widget) : textBox(widget)
86  {}
87 
90  virtual ~OnFileSelected() {}
91 
95  virtual void Execute(const csString & text);
96  };
97 
100  class OnAnimSelected : public EEditInputboxManager::iSelectList
101  {
102  public:
105  OnAnimSelected() {}
106 
109  virtual ~OnAnimSelected() {}
110 
111  virtual void Select(const csString & value, size_t index);
112  };
113 
114  pawsButton * moreLessButton;
115  pawsButton * animButton;
116  pawsButton * browseMesh;
117  pawsEditTextBox * meshFileText;
118  pawsSpinBox * tarX;
119  pawsSpinBox * tarY;
120  pawsSpinBox * tarZ;
121  pawsSpinBox * rot;
122  pawsRadioButton * tarTypeNone;
123  pawsRadioButton * tarTypeAxis;
124  pawsRadioButton * tarTypeCustom;
125 
126  csVector3 prevTar;
127  float prevRot;
128 
129  csDirtyAccessArray<csString> anims;
130 };
131 
133 
136 #endif
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
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
void SetPosition(const csVector3 &pos)
Sets the position of the actor.
virtual const char * GetName() const
Gets the name of the toolbox.
An edit box widget/.
Definition: pawstextbox.h:409
virtual ~EEditTargetToolbox()
virtual bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
virtual size_t GetType() const
Gets the toolbox type.
A base class for all eedit toolbox windows.
Definition: eedittoolbox.h:26
virtual void Update(unsigned int elapsed)
Updates the toobox.
A simple button widget.
Definition: pawsbutton.h:43
This handles the effect target object.
CREATE_PAWS_FACTORY(EEditTargetToolbox)
void SetMeshFile(const csString &file)
Sets the path to the target&#39;s mesh indicator, to be filled in the edit box.
void FillAnimList(iSpriteCal3DState *cal3d)
Fills the animation list with the cal3d animations.