SkillsDialog.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 ** 
00004 ** Copyright (C) 2006 The TBT Team.
00005 ** 
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 ** 
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 ** 
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
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     // Return the list of the player's skills
00063     std::vector<std::string> getPlayerSkills();
00064     
00065     // Return the list of the player's skills double
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     //  Private data members
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 /*SKILLSDIALOG_HH_*/

Generated on Sat Jun 23 16:07:24 2007 for Stechec/TBT by  doxygen 1.4.7