Planeshift
eediterrortoolbox.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_ERROR_TOOLBOX_WINDOW_HEADER
21 #define EEDIT_ERROR_TOOLBOX_WINDOW_HEADER
22 
23 #include <csutil/array.h>
24 #include "eedittoolbox.h"
25 #include "paws/pawswidget.h"
26 
27 class pawsButton;
28 class pawsMessageTextBox;
29 class pawsCheckBox;
30 
36 {
37 public:
38  EEditError(const char * _desc, int _colour, int _severity, bool _isEffectError)
39  : colour(_colour), severity(_severity), isEffectError(_isEffectError)
40  {
41  if (_desc == 0 || _desc[0] == '\0')
42  desc = " ";
43  else
44  desc = _desc;
45  }
46 
47  csString desc;
48  int colour;
49  int severity;
51 };
52 
55 class EEditErrorToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditErrorToolbox>
56 {
57 public:
59  virtual ~EEditErrorToolbox();
60 
66  void AddError(int severity, const char * msgId, const char * description);
67 
71  void SetLoadingEffects(bool isLoadingEffects);
72 
75  void Clear();
76 
79  void ResetFilter();
80 
81  // inheritted from EEditToolbox
82  virtual void Update(unsigned int elapsed);
83  virtual size_t GetType() const;
84  virtual const char * GetName() const;
85 
86  // inheritted from pawsWidget
87  virtual bool PostSetup();
88  virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget);
89  virtual void Show();
90 
91 private:
92 
96  void DisplayError(const EEditError & error);
97 
98  pawsMessageTextBox * errorText;
99  pawsButton * clearButton;
100  pawsButton * hideButton;
101  pawsCheckBox * onlyEffectErrors;
102  pawsCheckBox * showErrors;
103  pawsCheckBox * showWarnings;
104  pawsCheckBox * showNotifications;
105 
106  bool loadingEffects;
107 
108  csArray<EEditError> errors;
109 };
110 
112 
115 #endif
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
A combination widget that has a check box and a text label.
Definition: pawscheckbox.h:48
const char * GetName(int id)
CREATE_PAWS_FACTORY(EEditErrorToolbox)
EEditError(const char *_desc, int _colour, int _severity, bool _isEffectError)
This is a special type of text box that is used for messages.
Definition: pawstextbox.h:285
A base class for all eedit toolbox windows.
Definition: eedittoolbox.h:26
A simple button widget.
Definition: pawsbutton.h:43
This displays effect errors.