InjuriesDialog.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 INJURIESDIALOG_HH_
00017 #define INJURIESDIALOG_HH_
00018 
00019 #include "paragui.h"
00020 #include "pgwindow.h"
00021 #include "pgbutton.h"
00022 #include "pglabel.h"
00023 #include "pglineedit.h"
00024 #include "pgcheckbutton.h"
00025 
00026 #include "../../common/Player.hh"
00027 
00028 class DECLSPEC InjuriesDialog : public PG_Window 
00029 {
00030 public:
00040     InjuriesDialog(PG_Widget* parent, 
00041                 const PG_Rect& r, const char* windowtitle,
00042                 Player* player,
00043                 const char* style="MessageBox");
00044     
00045     virtual ~InjuriesDialog();
00046     
00047     void LoadThemeStyle(const char* widgettype);
00048 
00053     inline int WaitForClick() {
00054         return RunModal();
00055     }
00056     
00057     bool getMissNextMatch();
00058     int getNigglingInjuries();
00059     int getMaReducted();
00060     int getAvReducted();
00061     int getAgReducted();
00062     int getStReducted();
00063     
00064 private:
00065     template<typename T>
00066     std::string to_string( const T & Value );
00067 
00071     bool handleButton(PG_Button* button);    
00072     bool handleEditCharacteristicReducted(PG_LineEdit* edit);
00073 
00074     void displayError(const char* msg);
00075     void Init(const char* style);
00076 
00077     // -----------------------------------------------------------------------
00078     //  Private data members
00079     // -----------------------------------------------------------------------
00080     PG_Widget*      parent_;
00081 
00082     Player*         player_;
00083 
00084     PG_Button*      btnOk_;
00085     PG_Button*      btnCancel_;
00086     PG_CheckButton* cbtnMissNextMatch_;
00087 
00088     PG_Label*       lblNigglingInjuries_;
00089     PG_Label*       lblMaReducted_;
00090     PG_Label*       lblAvReducted_;
00091     PG_Label*       lblAgReducted_;
00092     PG_Label*       lblStReducted_;
00093 
00094     PG_LineEdit*    leNigglingInjuries_;
00095     PG_LineEdit*    leMaReducted_;
00096     PG_LineEdit*    leAvReducted_;
00097     PG_LineEdit*    leAgReducted_;
00098     PG_LineEdit*    leStReducted_;
00099 };
00100 
00101 #endif /*INJURIESDIALOG_HH_*/

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