00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef SKILLSDIALOG_HH_
00017 #define SKILLSDIALOG_HH_
00018
00019 #include <vector>
00020 #include <string>
00021
00022 #include "pglineedit.h"
00023
00024 #include "paragui.h"
00025 #include "pglabel.h"
00026 #include "pgwindow.h"
00027 #include "pgbutton.h"
00028 #include "pglistbox.h"
00029
00030 #include "../../common/Position.hh"
00031 #include "../../common/Player.hh"
00032
00033 class DECLSPEC SkillsDialog : public PG_Window
00034 {
00035 public:
00045 SkillsDialog(PG_Widget* parent,
00046 const PG_Rect& r, const char* windowtitle,
00047 Player* player,
00048 const char* style="MessageBox");
00049
00050 virtual ~SkillsDialog();
00051
00052 void LoadThemeStyle(const char* widgettype);
00053
00058 inline int WaitForClick() {
00059 return RunModal();
00060 }
00061
00062
00063 std::vector<std::string> getPlayerSkills();
00064
00065
00066 std::vector<std::string> getPlayerSkillsDouble();
00067
00068
00069 private:
00070
00074 bool handleButton(PG_Button* button);
00075
00076 bool handleButtonAddClick();
00077 bool handleButtonRemoveClick();
00078 bool handleButtonAddDoubleClick();
00079 bool handleButtonRemoveDoubleClick();
00080
00081
00082
00083
00084 Player* player_;
00085
00086 PG_Button* btnOk_;
00087 PG_Button* btnCancel_;
00088
00089 PG_Button* btnAdd_;
00090 PG_Button* btnRemove_;
00091 PG_Button* btnAddDouble_;
00092 PG_Button* btnRemoveDouble_;
00093
00094 PG_ListBox* selectedSkills_;
00095 PG_ListBox* availableSkills_;
00096
00097 PG_ListBox* selectedSkillsDouble_;
00098 PG_ListBox* availableSkillsDouble_;
00099 PG_Label* l1_;
00100 PG_Label* l2_;
00101 PG_Label* l3_;
00102 PG_Label* l4_;
00103
00104 void Init(const char* style);
00105 void FillAvailableSkills();
00106 void InsertSkillsFromVector(std::vector<std::string> v, PG_ListBox* list);
00107 bool IsPlayerSkill(const char* s);
00108
00109 };
00110 #endif