OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
class.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_CLASS_H
2 #define MWGUI_CLASS_H
3 
6 #include "widgets.hpp"
7 #include "windowbase.hpp"
8 
9 namespace MWGui
10 {
11  void setClassImage(MyGUI::ImageBox* imageBox, const std::string& classId);
12 
13  class InfoBoxDialog : public WindowModal
14  {
15  public:
16  InfoBoxDialog();
17 
18  typedef std::vector<std::string> ButtonList;
19 
20  void setText(const std::string &str);
21  std::string getText() const;
22  void setButtons(ButtonList &buttons);
23 
24  virtual void onOpen();
25 
26  bool exit() { return false; }
27 
28  // Events
29  typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
30 
35 
36  protected:
37  void onButtonClicked(MyGUI::Widget* _sender);
38 
39  private:
40 
41  void fitToText(MyGUI::TextBox* widget);
42  void layoutVertically(MyGUI::Widget* widget, int margin);
43  MyGUI::Widget* mTextBox;
44  MyGUI::TextBox* mText;
45  MyGUI::Widget* mButtonBar;
46  std::vector<MyGUI::Button*> mButtons;
47  };
48 
49  // Lets the player choose between 3 ways of creating a class
51  {
52  public:
53  // Corresponds to the buttons that can be clicked
55  {
60  };
62  };
63 
65  {
66  public:
68 
69  std::string getClassId() const;
70  void setClassId(const std::string &classId);
71 
72  bool exit() { return false; }
73 
74  // Events
75  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
76 
81 
86 
87  protected:
88  void onOkClicked(MyGUI::Widget* _sender);
89  void onBackClicked(MyGUI::Widget* _sender);
90 
91  private:
92  MyGUI::ImageBox* mClassImage;
93  MyGUI::TextBox* mClassName;
94 
95  std::string mCurrentClassId;
96  };
97 
99  {
100  public:
101  PickClassDialog();
102 
103  const std::string &getClassId() const { return mCurrentClassId; }
104  void setClassId(const std::string &classId);
105 
106  void setNextButtonShow(bool shown);
107  virtual void onOpen();
108 
109  bool exit() { return false; }
110 
111  // Events
112  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
113 
118 
123 
124  protected:
125  void onSelectClass(MyGUI::ListBox* _sender, size_t _index);
126  void onAccept(MyGUI::ListBox* _sender, size_t _index);
127 
128  void onOkClicked(MyGUI::Widget* _sender);
129  void onBackClicked(MyGUI::Widget* _sender);
130 
131  private:
132  void updateClasses();
133  void updateStats();
134 
135  MyGUI::ImageBox* mClassImage;
136  MyGUI::ListBox* mClassList;
137  MyGUI::TextBox* mSpecializationName;
141 
142  std::string mCurrentClassId;
143  };
144 
146  {
147  public:
150 
151  virtual bool exit();
152 
154 
155  // Events
156  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
157 
162 
167 
168  protected:
169  void onSpecializationClicked(MyGUI::Widget* _sender);
170  void onCancelClicked(MyGUI::Widget* _sender);
171 
172  private:
174 
176  };
177 
179  {
180  public:
183 
184  virtual bool exit();
185 
187 
188  // Events
189  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
190 
195 
200 
201  protected:
203  void onCancelClicked(MyGUI::Widget* _sender);
204 
205  private:
207  };
208 
210  {
211  public:
214 
215  virtual bool exit();
216 
218 
219  // Events
220  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
221 
226 
231 
232  protected:
233  void onSkillClicked(Widgets::MWSkillPtr _sender);
234  void onCancelClicked(MyGUI::Widget* _sender);
235 
236  private:
240 
242  };
243 
245  {
246  public:
249 
250  std::string getTextInput() const { return mTextEdit->getCaption(); }
251  void setTextInput(const std::string &text) { mTextEdit->setCaption(text); }
252 
257 
258  protected:
259  void onOkClicked(MyGUI::Widget* _sender);
260 
261  private:
262  MyGUI::EditBox* mTextEdit;
263  };
264 
266  {
267  public:
269  virtual ~CreateClassDialog();
270 
271  bool exit() { return false; }
272 
273  std::string getName() const;
274  std::string getDescription() const;
276  std::vector<int> getFavoriteAttributes() const;
277  std::vector<ESM::Skill::SkillEnum> getMajorSkills() const;
278  std::vector<ESM::Skill::SkillEnum> getMinorSkills() const;
279 
280  void setNextButtonShow(bool shown);
281 
282  // Events
283  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
284 
289 
294 
295  protected:
296  void onOkClicked(MyGUI::Widget* _sender);
297  void onBackClicked(MyGUI::Widget* _sender);
298 
299  void onSpecializationClicked(MyGUI::Widget* _sender);
302  void onAttributeSelected();
303  void onSkillClicked(Widgets::MWSkillPtr _sender);
304  void onSkillSelected();
305  void onDescriptionClicked(MyGUI::Widget* _sender);
306  void onDescriptionEntered(WindowBase* parWindow);
307  void onDialogCancel();
308 
309  void setSpecialization(int id);
310 
311  void update();
312 
313  private:
314  MyGUI::EditBox* mEditName;
315  MyGUI::TextBox* mSpecializationName;
319  std::vector<Widgets::MWSkillPtr> mSkills;
320  std::string mDescription;
321 
326 
328 
331  };
332 }
333 #endif
InfoBoxDialog()
Definition: class.cpp:310
CreateClassDialog()
Definition: class.cpp:400
DescriptionDialog * mDescDialog
Definition: class.hpp:325
Widgets::MWSkillPtr mMajorSkill[5]
Definition: class.hpp:317
Widgets::MWSkillPtr mMagicSkill[9]
Definition: class.hpp:238
virtual void onOpen()
Notify that window has been made visible.
Definition: class.cpp:133
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:73
MyGUI::ImageBox * mClassImage
Definition: class.hpp:92
EventHandle_Void eventBack
Definition: class.hpp:80
void updateStats()
Definition: class.cpp:242
MyGUI::EditBox * mEditName
Definition: class.hpp:314
GenerateClassResultDialog()
Definition: class.cpp:34
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:156
void setButtons(ButtonList &buttons)
Definition: class.cpp:333
MyGUI::EditBox * mTextEdit
Definition: class.hpp:262
std::string getName() const
Definition: class.cpp:498
ClassChoiceDialog()
Definition: class.cpp:386
std::vector< ESM::Skill::SkillEnum > getMinorSkills() const
Definition: class.cpp:531
std::string getClassId() const
Definition: class.cpp:55
void onSkillClicked(Widgets::MWSkillPtr _sender)
Definition: class.cpp:630
Definition: class.hpp:244
EventHandle_Void eventItemSelected
Definition: class.hpp:230
Definition: class.hpp:13
ESM::Class::Specialization getSpecializationId() const
Definition: class.hpp:153
void onBackClicked(MyGUI::Widget *_sender)
Definition: class.cpp:176
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:75
SelectSkillDialog * mSkillDialog
Definition: class.hpp:324
MyGUI::TextBox * mSpecialization0
Definition: class.hpp:173
void setNextButtonShow(bool shown)
Definition: class.cpp:541
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:678
SelectAttributeDialog * mAttribDialog
Definition: class.hpp:323
std::vector< std::string > ButtonList
Definition: class.hpp:18
Definition: widgets.hpp:91
EventHandle_Void eventBack
Definition: class.hpp:117
void fitToText(MyGUI::TextBox *widget)
Definition: class.cpp:280
ESM::Skill::SkillEnum mSkillId
Definition: class.hpp:241
void onSkillClicked(Widgets::MWSkillPtr _sender)
Definition: class.cpp:877
bool exit()
Gracefully exits the window.
Definition: class.hpp:26
Definition: widgets.hpp:132
Widgets::MWSkillPtr mAffectedSkill
Definition: class.hpp:330
void setSpecialization(int id)
Definition: class.cpp:587
ESM::Class::Specialization getSpecializationId() const
Definition: class.cpp:508
std::vector< MyGUI::Button * > mButtons
Definition: class.hpp:46
EventHandle_Void eventBack
Definition: class.hpp:288
Definition: class.hpp:59
void onDescriptionClicked(MyGUI::Widget *_sender)
Definition: class.cpp:663
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:112
Widgets::MWAttributePtr mFavoriteAttribute1
Definition: class.hpp:316
SelectSpecializationDialog * mSpecDialog
Definition: class.hpp:322
void onBackClicked(MyGUI::Widget *_sender)
Definition: class.cpp:78
void onSpecializationSelected()
Definition: class.cpp:578
MyGUI::TextBox * mSpecializationName
Definition: class.hpp:137
bool exit()
Gracefully exits the window.
Definition: class.hpp:109
MyGUI::Widget * mButtonBar
Definition: class.hpp:45
std::string getDescription() const
Definition: class.cpp:503
Definition: class.hpp:265
~DescriptionDialog()
Definition: class.cpp:913
Widgets::MWAttributePtr mFavoriteAttribute[2]
Definition: class.hpp:138
EventHandle_Void eventCancel
Definition: class.hpp:194
MyGUI::delegates::CMultiDelegate1< int > EventHandle_Int
Definition: class.hpp:29
Widgets::MWSkillPtr mStealthSkill[9]
Definition: class.hpp:239
MyGUI::TextBox * mSpecialization2
Definition: class.hpp:173
EventHandle_Void eventCancel
Definition: class.hpp:225
EventHandle_WindowBase eventDone
Definition: class.hpp:122
void onSelectClass(MyGUI::ListBox *_sender, size_t _index)
Definition: class.cpp:189
Definition: class.hpp:50
virtual bool exit()
Gracefully exits the window.
Definition: class.cpp:888
DescriptionDialog()
Definition: class.cpp:896
bool exit()
Gracefully exits the window.
Definition: class.hpp:271
Widgets::MWAttributePtr mFavoriteAttribute0
Definition: class.hpp:316
std::string getText() const
Definition: class.cpp:328
ESM::Attribute::AttributeID mAttributeId
Definition: class.hpp:206
MyGUI::TextBox * mSpecialization1
Definition: class.hpp:173
EventHandle_WindowBase eventDone
Definition: class.hpp:293
std::string mCurrentClassId
Definition: class.hpp:95
MyGUI::TextBox * mSpecializationName
Definition: class.hpp:315
std::string mCurrentClassId
Definition: class.hpp:142
Widgets::MWSkillPtr mMinorSkill[5]
Definition: class.hpp:318
void update()
Definition: class.cpp:486
Definition: class.hpp:178
void onDescriptionEntered(WindowBase *parWindow)
Definition: class.cpp:671
void onAttributeClicked(Widgets::MWAttributePtr _sender)
Definition: class.cpp:600
ESM::Skill::SkillEnum getSkillId() const
Definition: class.hpp:217
Definition: class.hpp:145
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:919
SelectAttributeDialog()
Definition: class.cpp:755
void updateClasses()
Definition: class.cpp:204
void setText(const std::string &str)
Definition: class.cpp:321
EventHandle_Int eventButtonSelected
Definition: class.hpp:34
Widgets::MWAttributePtr mAffectedAttribute
Definition: class.hpp:329
void onSkillSelected()
Definition: class.cpp:640
virtual ~CreateClassDialog()
Definition: class.cpp:478
void onButtonClicked(MyGUI::Widget *_sender)
Definition: class.cpp:369
void setClassImage(MyGUI::ImageBox *imageBox, const std::string &classId)
Definition: class.cpp:924
EventHandle_WindowBase eventDone
Definition: class.hpp:256
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:169
EventHandle_Void eventItemSelected
Definition: class.hpp:166
SelectSkillDialog()
Definition: class.cpp:805
std::vector< ESM::Skill::SkillEnum > getMajorSkills() const
Definition: class.cpp:521
MyGUI::TextBox * mClassName
Definition: class.hpp:93
PickClassDialog()
Definition: class.cpp:85
void onCancelClicked(MyGUI::Widget *_sender)
Definition: class.cpp:883
void onAccept(MyGUI::ListBox *_sender, size_t _index)
Definition: class.cpp:181
void setTextInput(const std::string &text)
Definition: class.hpp:251
virtual void onOpen()
Notify that window has been made visible.
Definition: class.cpp:358
ESM::Attribute::AttributeID getAttributeId() const
Definition: class.hpp:186
void onCancelClicked(MyGUI::Widget *_sender)
Definition: class.cpp:791
Definition: class.hpp:209
~SelectSkillDialog()
Definition: class.cpp:871
Widgets::MWSkillPtr mCombatSkill[9]
Definition: class.hpp:237
ESM::Class::Specialization mSpecializationId
Definition: class.hpp:327
void setClassId(const std::string &classId)
Definition: class.cpp:150
~SelectSpecializationDialog()
Definition: class.cpp:722
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:283
void onSpecializationClicked(MyGUI::Widget *_sender)
Definition: class.cpp:728
void onBackClicked(MyGUI::Widget *_sender)
Definition: class.cpp:685
SelectSpecializationDialog()
Definition: class.cpp:692
Definition: windowbase.hpp:21
MyGUI::ImageBox * mClassImage
Definition: class.hpp:135
EventHandle_Void eventCancel
Definition: class.hpp:161
virtual bool exit()
Gracefully exits the window.
Definition: class.cpp:747
void onAttributeClicked(Widgets::MWAttributePtr _sender)
Definition: class.cpp:784
Definition: class.hpp:64
void onAttributeSelected()
Definition: class.cpp:610
std::string getTextInput() const
Definition: class.hpp:250
Widgets::MWSkillPtr mMajorSkill[5]
Definition: class.hpp:139
Specialization
Definition: loadclas.hpp:46
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:220
void setNextButtonShow(bool shown)
Definition: class.cpp:122
void onCancelClicked(MyGUI::Widget *_sender)
Definition: class.cpp:742
EventHandle_WindowBase eventDone
Definition: class.hpp:85
MyGUI::TextBox * mText
Definition: class.hpp:44
bool exit()
Gracefully exits the window.
Definition: class.hpp:72
MyGUI::Widget * mTextBox
Definition: class.hpp:43
MyGUI::delegates::CMultiDelegate1< WindowBase * > EventHandle_WindowBase
Definition: windowbase.hpp:29
std::vector< Widgets::MWSkillPtr > mSkills
Definition: class.hpp:319
virtual bool exit()
Gracefully exits the window.
Definition: class.cpp:796
~SelectAttributeDialog()
Definition: class.cpp:778
void setClassId(const std::string &classId)
Definition: class.cpp:60
void onDialogCancel()
Definition: class.cpp:554
Definition: class.hpp:98
const std::string & getClassId() const
Definition: class.hpp:103
Definition: class.hpp:57
EventHandle_Void eventItemSelected
Definition: class.hpp:199
SkillEnum
Definition: loadskil.hpp:45
Widgets::MWSkillPtr mMinorSkill[5]
Definition: class.hpp:140
MyGUI::ListBox * mClassList
Definition: class.hpp:136
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:189
void onSpecializationClicked(MyGUI::Widget *_sender)
Definition: class.cpp:569
ClassChoice
Definition: class.hpp:54
ESM::Class::Specialization mSpecializationId
Definition: class.hpp:175
std::vector< int > getFavoriteAttributes() const
Definition: class.cpp:513
AttributeID
Definition: attr.hpp:14
std::string mDescription
Definition: class.hpp:320
void layoutVertically(MyGUI::Widget *widget, int margin)
Definition: class.cpp:290
Definition: windowbase.hpp:61