20 #include <QGroupBox> |
20 #include <QGroupBox> |
21 #include <QCheckBox> |
21 #include <QCheckBox> |
22 #include <QGridLayout> |
22 #include <QGridLayout> |
23 #include <QSpinBox> |
23 #include <QSpinBox> |
24 #include <QLabel> |
24 #include <QLabel> |
|
25 |
25 #include "gamecfgwidget.h" |
26 #include "gamecfgwidget.h" |
|
27 #include "igbox.h" |
26 |
28 |
27 GameCFGWidget::GameCFGWidget(QWidget* parent, bool externalControl) : |
29 GameCFGWidget::GameCFGWidget(QWidget* parent, bool externalControl) : |
28 QWidget(parent), mainLayout(this) |
30 QGroupBox(parent), mainLayout(this) |
29 { |
31 { |
30 mainLayout.setMargin(0); |
32 mainLayout.setMargin(0); |
31 mainLayout.setSizeConstraint(QLayout::SetMinimumSize); |
33 // mainLayout.setSizeConstraint(QLayout::SetMinimumSize); |
32 QGroupBox *GBoxMap = new QGroupBox(this); |
|
33 //GBoxMap->setTitle(QGroupBox::tr("Landscape")); |
|
34 GBoxMap->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); |
|
35 mainLayout.addWidget(GBoxMap); |
|
36 |
34 |
37 QHBoxLayout *GBoxMapLayout = new QHBoxLayout(GBoxMap); |
35 pMapContainer = new HWMapContainer(this); |
38 GBoxMapLayout->setMargin(0); |
36 mainLayout.addWidget(pMapContainer, 0, 0); |
39 pMapContainer = new HWMapContainer(GBoxMap); |
|
40 GBoxMapLayout->addStretch(); |
|
41 GBoxMapLayout->addWidget(pMapContainer); |
|
42 GBoxMapLayout->addStretch(); |
|
43 |
37 |
44 QGroupBox *GBoxOptions = new QGroupBox(this); |
38 IconedGroupBox *GBoxOptions = new IconedGroupBox(this); |
45 GBoxOptions->setTitle(QGroupBox::tr("Game scheme")); |
|
46 GBoxOptions->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); |
39 GBoxOptions->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); |
47 mainLayout.addWidget(GBoxOptions); |
40 mainLayout.addWidget(GBoxOptions); |
48 |
41 |
49 QGridLayout *GBoxOptionsLayout = new QGridLayout(GBoxOptions); |
42 QGridLayout *GBoxOptionsLayout = new QGridLayout(GBoxOptions); |
50 CB_mode_Forts = new QCheckBox(GBoxOptions); |
43 CB_mode_Forts = new QCheckBox(GBoxOptions); |
68 GBoxOptionsLayout->addWidget(SB_TurnTime, 1, 1); |
61 GBoxOptionsLayout->addWidget(SB_TurnTime, 1, 1); |
69 GBoxOptionsLayout->addWidget(SB_InitHealth, 2, 1); |
62 GBoxOptionsLayout->addWidget(SB_InitHealth, 2, 1); |
70 WeaponsName = new QComboBox(GBoxOptions); |
63 WeaponsName = new QComboBox(GBoxOptions); |
71 GBoxOptionsLayout->addWidget(WeaponsName, 3, 1); |
64 GBoxOptionsLayout->addWidget(WeaponsName, 3, 1); |
72 |
65 |
73 mainLayout.addWidget(new QWidget(this), 100); |
66 mainLayout.addWidget(new QWidget(this), 5, 0); |
74 |
67 |
75 connect(SB_InitHealth, SIGNAL(valueChanged(int)), this, SLOT(onInitHealthChanged(int))); |
68 connect(SB_InitHealth, SIGNAL(valueChanged(int)), this, SLOT(onInitHealthChanged(int))); |
76 connect(SB_TurnTime, SIGNAL(valueChanged(int)), this, SLOT(onTurnTimeChanged(int))); |
69 connect(SB_TurnTime, SIGNAL(valueChanged(int)), this, SLOT(onTurnTimeChanged(int))); |
77 connect(CB_mode_Forts, SIGNAL(toggled(bool)), this, SLOT(onFortsModeChanged(bool))); |
70 connect(CB_mode_Forts, SIGNAL(toggled(bool)), this, SLOT(onFortsModeChanged(bool))); |
78 connect(WeaponsName, SIGNAL(activated(const QString&)), this, SIGNAL(newWeaponsName(const QString&))); |
71 connect(WeaponsName, SIGNAL(activated(const QString&)), this, SIGNAL(newWeaponsName(const QString&))); |