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 open();
25 
26  // Events
27  typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
28 
33 
34  protected:
35  void onButtonClicked(MyGUI::Widget* _sender);
36 
37  private:
38 
39  void fitToText(MyGUI::TextBox* widget);
40  void layoutVertically(MyGUI::Widget* widget, int margin);
41  MyGUI::Widget* mTextBox;
42  MyGUI::TextBox* mText;
43  MyGUI::Widget* mButtonBar;
44  std::vector<MyGUI::Button*> mButtons;
45  };
46 
47  // Lets the player choose between 3 ways of creating a class
49  {
50  public:
51  // Corresponds to the buttons that can be clicked
53  {
58  };
60  };
61 
63  {
64  public:
66 
67  std::string getClassId() const;
68  void setClassId(const std::string &classId);
69 
70  // Events
71  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
72 
77 
82 
83  protected:
84  void onOkClicked(MyGUI::Widget* _sender);
85  void onBackClicked(MyGUI::Widget* _sender);
86 
87  private:
88  MyGUI::ImageBox* mClassImage;
89  MyGUI::TextBox* mClassName;
90 
91  std::string mCurrentClassId;
92  };
93 
95  {
96  public:
98 
99  const std::string &getClassId() const { return mCurrentClassId; }
100  void setClassId(const std::string &classId);
101 
102  void setNextButtonShow(bool shown);
103  virtual void open();
104 
105  // Events
106  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
107 
112 
117 
118  protected:
119  void onSelectClass(MyGUI::ListBox* _sender, size_t _index);
120  void onAccept(MyGUI::ListBox* _sender, size_t _index);
121 
122  void onOkClicked(MyGUI::Widget* _sender);
123  void onBackClicked(MyGUI::Widget* _sender);
124 
125  private:
126  void updateClasses();
127  void updateStats();
128 
129  MyGUI::ImageBox* mClassImage;
130  MyGUI::ListBox* mClassList;
131  MyGUI::TextBox* mSpecializationName;
135 
136  std::string mCurrentClassId;
137  };
138 
140  {
141  public:
144 
145  virtual void exit();
146 
148 
149  // Events
150  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
151 
156 
161 
162  protected:
163  void onSpecializationClicked(MyGUI::Widget* _sender);
164  void onCancelClicked(MyGUI::Widget* _sender);
165 
166  private:
168 
170  };
171 
173  {
174  public:
177 
178  virtual void exit();
179 
181 
182  // Events
183  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
184 
189 
194 
195  protected:
197  void onCancelClicked(MyGUI::Widget* _sender);
198 
199  private:
201  };
202 
204  {
205  public:
208 
209  virtual void exit();
210 
212 
213  // Events
214  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
215 
220 
225 
226  protected:
227  void onSkillClicked(Widgets::MWSkillPtr _sender);
228  void onCancelClicked(MyGUI::Widget* _sender);
229 
230  private:
234 
236  };
237 
239  {
240  public:
243 
244  std::string getTextInput() const { return mTextEdit->getCaption(); }
245  void setTextInput(const std::string &text) { mTextEdit->setCaption(text); }
246 
251 
252  protected:
253  void onOkClicked(MyGUI::Widget* _sender);
254 
255  private:
256  MyGUI::EditBox* mTextEdit;
257  };
258 
260  {
261  public:
263  virtual ~CreateClassDialog();
264 
265  std::string getName() const;
266  std::string getDescription() const;
268  std::vector<int> getFavoriteAttributes() const;
269  std::vector<ESM::Skill::SkillEnum> getMajorSkills() const;
270  std::vector<ESM::Skill::SkillEnum> getMinorSkills() const;
271 
272  void setNextButtonShow(bool shown);
273 
274  // Events
275  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
276 
281 
286 
287  protected:
288  void onOkClicked(MyGUI::Widget* _sender);
289  void onBackClicked(MyGUI::Widget* _sender);
290 
291  void onSpecializationClicked(MyGUI::Widget* _sender);
294  void onAttributeSelected();
295  void onSkillClicked(Widgets::MWSkillPtr _sender);
296  void onSkillSelected();
297  void onDescriptionClicked(MyGUI::Widget* _sender);
298  void onDescriptionEntered(WindowBase* parWindow);
299  void onDialogCancel();
300 
301  void setSpecialization(int id);
302 
303  void update();
304 
305  private:
306  MyGUI::EditBox* mEditName;
307  MyGUI::TextBox* mSpecializationName;
311  std::vector<Widgets::MWSkillPtr> mSkills;
312  std::string mDescription;
313 
318 
320 
323  };
324 }
325 #endif
InfoBoxDialog()
Definition: class.cpp:296
CreateClassDialog()
Definition: class.cpp:386
DescriptionDialog * mDescDialog
Definition: class.hpp:317
Widgets::MWSkillPtr mMajorSkill[5]
Definition: class.hpp:309
Widgets::MWSkillPtr mMagicSkill[9]
Definition: class.hpp:232
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:68
MyGUI::ImageBox * mClassImage
Definition: class.hpp:88
EventHandle_Void eventBack
Definition: class.hpp:76
void updateStats()
Definition: class.cpp:228
MyGUI::EditBox * mEditName
Definition: class.hpp:306
GenerateClassResultDialog()
Definition: class.cpp:29
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:150
void setButtons(ButtonList &buttons)
Definition: class.cpp:319
MyGUI::EditBox * mTextEdit
Definition: class.hpp:256
std::string getName() const
Definition: class.cpp:484
ClassChoiceDialog()
Definition: class.cpp:372
std::vector< ESM::Skill::SkillEnum > getMinorSkills() const
Definition: class.cpp:517
std::string getClassId() const
Definition: class.cpp:50
void onSkillClicked(Widgets::MWSkillPtr _sender)
Definition: class.cpp:616
Definition: class.hpp:238
EventHandle_Void eventItemSelected
Definition: class.hpp:224
Definition: class.hpp:13
ESM::Class::Specialization getSpecializationId() const
Definition: class.hpp:147
void onBackClicked(MyGUI::Widget *_sender)
Definition: class.cpp:162
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:71
SelectSkillDialog * mSkillDialog
Definition: class.hpp:316
MyGUI::TextBox * mSpecialization0
Definition: class.hpp:167
void setNextButtonShow(bool shown)
Definition: class.cpp:527
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:664
SelectAttributeDialog * mAttribDialog
Definition: class.hpp:315
std::vector< std::string > ButtonList
Definition: class.hpp:18
Definition: widgets.hpp:91
EventHandle_Void eventBack
Definition: class.hpp:111
void fitToText(MyGUI::TextBox *widget)
Definition: class.cpp:266
ESM::Skill::SkillEnum mSkillId
Definition: class.hpp:235
void onSkillClicked(Widgets::MWSkillPtr _sender)
Definition: class.cpp:861
Definition: widgets.hpp:132
Widgets::MWSkillPtr mAffectedSkill
Definition: class.hpp:322
void setSpecialization(int id)
Definition: class.cpp:573
ESM::Class::Specialization getSpecializationId() const
Definition: class.cpp:494
std::vector< MyGUI::Button * > mButtons
Definition: class.hpp:44
EventHandle_Void eventBack
Definition: class.hpp:280
virtual void exit()
Gracefully exits the window.
Definition: class.cpp:733
Definition: class.hpp:57
void onDescriptionClicked(MyGUI::Widget *_sender)
Definition: class.cpp:649
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:106
Widgets::MWAttributePtr mFavoriteAttribute1
Definition: class.hpp:308
SelectSpecializationDialog * mSpecDialog
Definition: class.hpp:314
void onBackClicked(MyGUI::Widget *_sender)
Definition: class.cpp:73
void onSpecializationSelected()
Definition: class.cpp:564
MyGUI::TextBox * mSpecializationName
Definition: class.hpp:131
MyGUI::Widget * mButtonBar
Definition: class.hpp:43
std::string getDescription() const
Definition: class.cpp:489
Definition: class.hpp:259
~DescriptionDialog()
Definition: class.cpp:896
Widgets::MWAttributePtr mFavoriteAttribute[2]
Definition: class.hpp:132
EventHandle_Void eventCancel
Definition: class.hpp:188
MyGUI::delegates::CMultiDelegate1< int > EventHandle_Int
Definition: class.hpp:27
Widgets::MWSkillPtr mStealthSkill[9]
Definition: class.hpp:233
MyGUI::TextBox * mSpecialization2
Definition: class.hpp:167
EventHandle_Void eventCancel
Definition: class.hpp:219
EventHandle_WindowBase eventDone
Definition: class.hpp:116
void onSelectClass(MyGUI::ListBox *_sender, size_t _index)
Definition: class.cpp:175
Definition: class.hpp:48
DescriptionDialog()
Definition: class.cpp:879
Widgets::MWAttributePtr mFavoriteAttribute0
Definition: class.hpp:308
std::string getText() const
Definition: class.cpp:314
ESM::Attribute::AttributeID mAttributeId
Definition: class.hpp:200
MyGUI::TextBox * mSpecialization1
Definition: class.hpp:167
EventHandle_WindowBase eventDone
Definition: class.hpp:285
std::string mCurrentClassId
Definition: class.hpp:91
MyGUI::TextBox * mSpecializationName
Definition: class.hpp:307
virtual void exit()
Gracefully exits the window.
Definition: class.cpp:781
std::string mCurrentClassId
Definition: class.hpp:136
Widgets::MWSkillPtr mMinorSkill[5]
Definition: class.hpp:310
void update()
Definition: class.cpp:472
Definition: class.hpp:172
virtual void open()
Notify that window has been made visible.
Definition: class.cpp:344
void onDescriptionEntered(WindowBase *parWindow)
Definition: class.cpp:657
void onAttributeClicked(Widgets::MWAttributePtr _sender)
Definition: class.cpp:586
ESM::Skill::SkillEnum getSkillId() const
Definition: class.hpp:211
Definition: class.hpp:139
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:902
SelectAttributeDialog()
Definition: class.cpp:740
void updateClasses()
Definition: class.cpp:190
void setText(const std::string &str)
Definition: class.cpp:307
EventHandle_Int eventButtonSelected
Definition: class.hpp:32
Widgets::MWAttributePtr mAffectedAttribute
Definition: class.hpp:321
void onSkillSelected()
Definition: class.cpp:626
virtual ~CreateClassDialog()
Definition: class.cpp:464
void onButtonClicked(MyGUI::Widget *_sender)
Definition: class.cpp:355
void setClassImage(MyGUI::ImageBox *imageBox, const std::string &classId)
Definition: class.cpp:907
EventHandle_WindowBase eventDone
Definition: class.hpp:250
void onOkClicked(MyGUI::Widget *_sender)
Definition: class.cpp:155
EventHandle_Void eventItemSelected
Definition: class.hpp:160
virtual void open()
Notify that window has been made visible.
Definition: class.cpp:128
SelectSkillDialog()
Definition: class.cpp:789
std::vector< ESM::Skill::SkillEnum > getMajorSkills() const
Definition: class.cpp:507
MyGUI::TextBox * mClassName
Definition: class.hpp:89
PickClassDialog()
Definition: class.cpp:80
virtual void exit()
Gracefully exits the window.
Definition: class.cpp:872
void onCancelClicked(MyGUI::Widget *_sender)
Definition: class.cpp:867
void onAccept(MyGUI::ListBox *_sender, size_t _index)
Definition: class.cpp:167
void setTextInput(const std::string &text)
Definition: class.hpp:245
ESM::Attribute::AttributeID getAttributeId() const
Definition: class.hpp:180
void onCancelClicked(MyGUI::Widget *_sender)
Definition: class.cpp:776
Definition: class.hpp:203
~SelectSkillDialog()
Definition: class.cpp:855
Widgets::MWSkillPtr mCombatSkill[9]
Definition: class.hpp:231
ESM::Class::Specialization mSpecializationId
Definition: class.hpp:319
void setClassId(const std::string &classId)
Definition: class.cpp:136
~SelectSpecializationDialog()
Definition: class.cpp:708
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:275
void onSpecializationClicked(MyGUI::Widget *_sender)
Definition: class.cpp:714
void onBackClicked(MyGUI::Widget *_sender)
Definition: class.cpp:671
SelectSpecializationDialog()
Definition: class.cpp:678
Definition: windowbase.hpp:16
MyGUI::ImageBox * mClassImage
Definition: class.hpp:129
EventHandle_Void eventCancel
Definition: class.hpp:155
void onAttributeClicked(Widgets::MWAttributePtr _sender)
Definition: class.cpp:769
Definition: class.hpp:62
void onAttributeSelected()
Definition: class.cpp:596
std::string getTextInput() const
Definition: class.hpp:244
Widgets::MWSkillPtr mMajorSkill[5]
Definition: class.hpp:133
Specialization
Definition: loadclas.hpp:46
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:214
void setNextButtonShow(bool shown)
Definition: class.cpp:117
void onCancelClicked(MyGUI::Widget *_sender)
Definition: class.cpp:728
EventHandle_WindowBase eventDone
Definition: class.hpp:81
MyGUI::TextBox * mText
Definition: class.hpp:42
MyGUI::Widget * mTextBox
Definition: class.hpp:41
MyGUI::delegates::CMultiDelegate1< WindowBase * > EventHandle_WindowBase
Definition: windowbase.hpp:22
std::vector< Widgets::MWSkillPtr > mSkills
Definition: class.hpp:311
~SelectAttributeDialog()
Definition: class.cpp:763
void setClassId(const std::string &classId)
Definition: class.cpp:55
void onDialogCancel()
Definition: class.cpp:540
Definition: class.hpp:94
const std::string & getClassId() const
Definition: class.hpp:99
Definition: class.hpp:55
EventHandle_Void eventItemSelected
Definition: class.hpp:193
SkillEnum
Definition: loadskil.hpp:45
Widgets::MWSkillPtr mMinorSkill[5]
Definition: class.hpp:134
MyGUI::ListBox * mClassList
Definition: class.hpp:130
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: class.hpp:183
void onSpecializationClicked(MyGUI::Widget *_sender)
Definition: class.cpp:555
ClassChoice
Definition: class.hpp:52
ESM::Class::Specialization mSpecializationId
Definition: class.hpp:169
std::vector< int > getFavoriteAttributes() const
Definition: class.cpp:499
AttributeID
Definition: attr.hpp:14
std::string mDescription
Definition: class.hpp:312
void layoutVertically(MyGUI::Widget *widget, int margin)
Definition: class.cpp:276
Definition: windowbase.hpp:41