Planeshift
eeditloadmaptoolbox.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_LOAD_MAP_TOOLBOX_WINDOW_HEADER
21 #define EEDIT_LOAD_MAP_TOOLBOX_WINDOW_HEADER
22 
23 #include "eedittoolbox.h"
24 #include "paws/pawswidget.h"
26 #include "eeditinputboxmanager.h"
27 #include <csutil/dirtyaccessarray.h>
28 
29 class pawsButton;
30 class pawsEditTextBox;
31 
38 class EEditLoadMapToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditLoadMapToolbox>
39 {
40 public:
42  virtual ~EEditLoadMapToolbox();
43 
49  void SetMapFile(const char * mapFile);
50 
51  // inheritted from EEditToolbox
52  virtual void Update(unsigned int elapsed);
53  virtual size_t GetType() const;
54  virtual const char * GetName() const;
55 
56  // inheritted from pawsWidget
57  virtual bool PostSetup();
58  virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
59 
60 private:
61 
64  class OnFileSelected : public iOnFileSelectedAction
65  {
66  private:
67  pawsEditTextBox * textBox;
68 
69  public:
73  OnFileSelected(pawsEditTextBox * widget) : textBox(widget)
74  {}
75 
78  virtual ~OnFileSelected() {}
79 
83  virtual void Execute(const csString & text);
84  };
85 
86  pawsEditTextBox * mapPath;
87  pawsButton * loadMap;
88  pawsButton * browseMap;
89 };
90 
92 
95 #endif
CREATE_PAWS_FACTORY(EEditLoadMapToolbox)
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
virtual bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
An edit box widget/.
Definition: pawstextbox.h:409
virtual ~EEditLoadMapToolbox()
This allows loading of a new map.
void SetMapFile(const char *mapFile)
Sets the text for the map field.
virtual const char * GetName() const
Gets the name of the toolbox.
A base class for all eedit toolbox windows.
Definition: eedittoolbox.h:26
A simple button widget.
Definition: pawsbutton.h:43
virtual size_t GetType() const
Gets the toolbox type.
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
virtual void Update(unsigned int elapsed)
Updates the toobox.