Planeshift

eedittargettoolbox.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_TARGET_TOOLBOX_WINDOW_HEADER
00021 #define EEDIT_TARGET_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 
00031 class pawsButton;
00032 class pawsEditTextBox;
00033 class pawsSpinBox;
00034 class pawsRadioButton;
00035 
00042 class EEditTargetToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditTargetToolbox>
00043 {
00044 public:
00045     EEditTargetToolbox();
00046     virtual ~EEditTargetToolbox();
00047 
00051     void SetMeshFile(const csString & file);
00052 
00056     void FillAnimList(iSpriteCal3DState * cal3d);
00057 
00061     void SetPosition(const csVector3 & pos);
00062 
00063     // inheritted from EEditToolbox
00064     virtual void Update(unsigned int elapsed);
00065     virtual size_t GetType() const;
00066     virtual const char * GetName() const;
00067     
00068     // inheritted from pawsWidget
00069     virtual bool PostSetup(); 
00070     virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
00071     
00072 private:
00073     
00076     class OnFileSelected : public iOnFileSelectedAction
00077     {
00078         private:
00079             pawsEditTextBox * textBox;
00080             
00081         public:
00085             OnFileSelected(pawsEditTextBox * widget) : textBox(widget)
00086             {}
00087 
00090             virtual ~OnFileSelected() {}
00091 
00095             virtual void Execute(const csString & text);
00096     };
00097   
00100     class OnAnimSelected : public EEditInputboxManager::iSelectList
00101     {
00102         public: 
00105             OnAnimSelected() {}
00106 
00109             virtual ~OnAnimSelected() {}
00110 
00111             virtual void Select(const csString & value, size_t index);
00112     };
00113   
00114     pawsButton      * moreLessButton;
00115     pawsButton      * animButton;
00116     pawsButton      * browseMesh;
00117     pawsEditTextBox * meshFileText;
00118     pawsSpinBox     * tarX;
00119     pawsSpinBox     * tarY;
00120     pawsSpinBox     * tarZ;
00121     pawsSpinBox     * rot;
00122     pawsRadioButton * tarTypeNone;
00123     pawsRadioButton * tarTypeAxis;
00124     pawsRadioButton * tarTypeCustom;
00125 
00126     csVector3 prevTar;
00127     float     prevRot;
00128 
00129     csDirtyAccessArray<csString> anims;
00130 };
00131 
00132 CREATE_PAWS_FACTORY(EEditTargetToolbox);
00133 
00136 #endif