Planeshift

eeditpositiontoolbox.h

Go to the documentation of this file.
00001 /*
00002  * Author: Andrew Robberts
00003  *
00004  * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 #ifndef EEDIT_POSITION_TOOLBOX_WINDOW_HEADER
00021 #define EEDIT_POSITION_TOOLBOX_WINDOW_HEADER
00022 
00023 #include "eedittoolbox.h"
00024 #include "paws/pawswidget.h"
00025 #include "paws/pawsfilenavigation.h"
00026 #include "eeditinputboxmanager.h"
00027 #include <csutil/dirtyaccessarray.h>
00028 
00029 struct iSpriteCal3DState;
00030 class pawsButton;
00031 class pawsEditTextBox;
00032 class pawsSpinBox;
00033 class pawsRadioButton;
00034 
00040 class EEditPositionToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditPositionToolbox>
00041 {
00042 public:
00043     EEditPositionToolbox();
00044     virtual ~EEditPositionToolbox();
00045 
00049     void SetMeshFile(const csString & file);
00050 
00054     void FillAnimList(iSpriteCal3DState * cal3d);
00055 
00059     void SetPosition(const csVector3 & pos);
00060 
00061     // inheritted from EEditToolbox
00062     virtual void Update(unsigned int elapsed);
00063     virtual size_t GetType() const;
00064     virtual const char * GetName() const;
00065     
00066     // inheritted from pawsWidget
00067     virtual bool PostSetup(); 
00068     virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
00069     
00070 private:
00071     
00074     class OnFileSelected : public iOnFileSelectedAction
00075     {
00076         private:
00077             pawsEditTextBox * textBox;
00078             
00079         public:
00083             OnFileSelected(pawsEditTextBox * widget) : textBox(widget)
00084             {}
00085 
00088             virtual ~OnFileSelected() {}
00089 
00093             virtual void Execute(const csString & text);
00094     };
00095 
00098     class OnAnimSelected : public EEditInputboxManager::iSelectList
00099     {
00100         public: 
00103             OnAnimSelected() {}
00104 
00107             virtual ~OnAnimSelected() {}
00108 
00109             virtual void Select(const csString & value, size_t index);
00110     };
00111     
00112     pawsButton      * moreLessButton;
00113     pawsButton      * animButton;
00114     pawsButton      * browseMesh;
00115     pawsEditTextBox * meshFileText;
00116     pawsSpinBox     * posX;
00117     pawsSpinBox     * posY;
00118     pawsSpinBox     * posZ;
00119     pawsSpinBox     * rot;
00120     pawsRadioButton * posTypeNone;
00121     pawsRadioButton * posTypeAxis;
00122     pawsRadioButton * posTypeCustom;
00123 
00124     csVector3 prevPos;
00125     float     prevRot;
00126 
00127     csDirtyAccessArray<csString> anims;
00128 };
00129 
00130 CREATE_PAWS_FACTORY(EEditPositionToolbox);
00131 
00134 #endif