QTfrontend/gamecfgwidget.h
changeset 1783 169ebeefd7ab
parent 1782 e7589e37a6d6
child 1784 dfe9bafb4590
equal deleted inserted replaced
1782:e7589e37a6d6 1783:169ebeefd7ab
    20 #define GAMECONFIGWIDGET_H
    20 #define GAMECONFIGWIDGET_H
    21 
    21 
    22 #include <QWidget>
    22 #include <QWidget>
    23 #include <QStringList>
    23 #include <QStringList>
    24 #include <QGroupBox>
    24 #include <QGroupBox>
       
    25 #include <QSpinBox>
    25 
    26 
    26 #include "mapContainer.h"
    27 #include "mapContainer.h"
    27 
    28 
    28 class QCheckBox;
    29 class QCheckBox;
    29 class QVBoxLayout;
    30 class QVBoxLayout;
    30 class QSpinBox;
       
    31 class QLabel;
    31 class QLabel;
       
    32 class FreqSpinBox;
       
    33 
       
    34 class FreqSpinBox : public QSpinBox
       
    35 {
       
    36 	Q_OBJECT
       
    37 
       
    38 public:
       
    39 	FreqSpinBox(QWidget* parent) : QSpinBox(parent)
       
    40 	{
       
    41 
       
    42 	}
       
    43 
       
    44 	QString textFromValue ( int value ) const
       
    45 	{
       
    46 		switch (value)
       
    47 		{
       
    48 			case 0 : return tr("Never");
       
    49 			case 1 : return tr("Every turn");
       
    50 			default : return tr("Each %1 turn").arg(value);
       
    51 		}
       
    52 	}
       
    53 };
    32 
    54 
    33 class GameCFGWidget : public QGroupBox
    55 class GameCFGWidget : public QGroupBox
    34 {
    56 {
    35 	Q_OBJECT
    57 	Q_OBJECT
    36 
    58 
    84 	QGridLayout mainLayout;
   106 	QGridLayout mainLayout;
    85 	HWMapContainer* pMapContainer;
   107 	HWMapContainer* pMapContainer;
    86 	QSpinBox * SB_TurnTime;
   108 	QSpinBox * SB_TurnTime;
    87 	QSpinBox * SB_InitHealth;
   109 	QSpinBox * SB_InitHealth;
    88 	QSpinBox * SB_SuddenDeath;
   110 	QSpinBox * SB_SuddenDeath;
    89 	QSpinBox * SB_CaseProb;
   111 	FreqSpinBox * SB_CaseProb;
    90 	QLabel * L_TurnTime;
   112 	QLabel * L_TurnTime;
    91 	QLabel * L_InitHealth;
   113 	QLabel * L_InitHealth;
    92 	QLabel * L_SuddenDeath;
   114 	QLabel * L_SuddenDeath;
    93 	QLabel * L_CaseProb;
   115 	QLabel * L_CaseProb;
    94 
   116