QTfrontend/pages.cpp
changeset 684 257444d8429f
parent 683 57d624f71e65
child 686 494b5880989a
equal deleted inserted replaced
683:57d624f71e65 684:257444d8429f
    49 #include "chatwidget.h"
    49 #include "chatwidget.h"
    50 #include "SDLs.h"
    50 #include "SDLs.h"
    51 #include "playrecordpage.h"
    51 #include "playrecordpage.h"
    52 #include "selectWeapon.h"
    52 #include "selectWeapon.h"
    53 
    53 
    54 PageMain::PageMain(QWidget* parent) : QWidget(parent)
    54 PageMain::PageMain(QWidget* parent) : 
    55 {
    55   AbstractPage(parent)
    56 	QFont * font14 = new QFont("MS Shell Dlg", 14);
    56 {
    57 	QGridLayout * pageLayout = new QGridLayout(this);
    57 	QGridLayout * pageLayout = new QGridLayout(this);
    58 	pageLayout->setMargin(25);
    58 	pageLayout->setMargin(25);
    59 	pageLayout->setColumnStretch(0, 1);
    59 	pageLayout->setColumnStretch(0, 1);
    60 	pageLayout->setColumnStretch(1, 2);
    60 	pageLayout->setColumnStretch(1, 2);
    61 	pageLayout->setColumnStretch(2, 1);
    61 	pageLayout->setColumnStretch(2, 1);
    62 
    62 
    63 	BtnSinglePlayer = new QPushButton(this);
    63 	BtnSinglePlayer = addButton("Single Player", pageLayout, 0, 1);
    64 	BtnSinglePlayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    64 	BtnSinglePlayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    65 	BtnSinglePlayer->setFont(*font14);
    65 
    66 	BtnSinglePlayer->setText(QPushButton::tr("Single Player"));
    66 	BtnMultiplayer = addButton("Multiplayer", pageLayout, 1, 1);
    67 	pageLayout->addWidget(BtnSinglePlayer, 0, 1);
       
    68 
       
    69 	BtnMultiplayer = new QPushButton(this);
       
    70 	BtnMultiplayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    67 	BtnMultiplayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    71 	BtnMultiplayer->setFont(*font14);
    68 
    72 	BtnMultiplayer->setText(QPushButton::tr("Multiplayer"));
    69 	BtnNet = addButton("Net game", pageLayout, 2, 1);
    73 	pageLayout->addWidget(BtnMultiplayer, 1, 1);
       
    74 
       
    75 	BtnNet = new QPushButton(this);
       
    76 	BtnNet->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    70 	BtnNet->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    77 	BtnNet->setFont(*font14);
    71 
    78 	BtnNet->setText(QPushButton::tr("Net game"));
    72 	BtnLoad = addButton("Saved games", pageLayout, 3, 1);
    79 	pageLayout->addWidget(BtnNet, 2, 1);
       
    80 
       
    81 	BtnLoad = new QPushButton(this);
       
    82 	BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    73 	BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    83 	BtnLoad->setFont(*font14);
    74 
    84 	BtnLoad->setText(QPushButton::tr("Saved games"));
    75 	BtnDemos = addButton("Demos", pageLayout, 4, 1);
    85 	pageLayout->addWidget(BtnLoad, 3, 1);
       
    86 
       
    87 	BtnDemos = new QPushButton(this);
       
    88 	BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    76 	BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    89 	BtnDemos->setFont(*font14);
    77 
    90 	BtnDemos->setText(QPushButton::tr("Demos"));
    78 	BtnSetup = addButton("Setup", pageLayout, 5, 1);
    91 	pageLayout->addWidget(BtnDemos, 4, 1);
       
    92 
       
    93 	BtnSetup = new QPushButton(this);
       
    94 	BtnSetup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    79 	BtnSetup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    95 	BtnSetup->setFont(*font14);
    80 
    96 	BtnSetup->setText(QPushButton::tr("Setup"));
    81 	BtnInfo = addButton("About", pageLayout, 6, 1);
    97 	pageLayout->addWidget(BtnSetup, 5, 1);
       
    98 
       
    99 	BtnInfo = new QPushButton(this);
       
   100 	BtnInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    82 	BtnInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
   101 	BtnInfo->setFont(*font14);
    83 
   102 	BtnInfo->setText(QPushButton::tr("About"));
    84 	BtnExit = addButton("Exit", pageLayout, 7, 1);
   103 	pageLayout->addWidget(BtnInfo, 6, 1);
       
   104 
       
   105 	BtnExit = new QPushButton(parent);
       
   106 	BtnExit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    85 	BtnExit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
   107 	BtnExit->setFont(*font14);
    86 }
   108 	BtnExit->setText(QPushButton::tr("Exit"));
    87 
   109 	pageLayout->addWidget(BtnExit, 7, 1);
    88 PageSimpleGame::PageSimpleGame(QWidget* parent) : 
   110 }
    89   AbstractPage(parent)
   111 
    90 {
   112 PageSimpleGame::PageSimpleGame(QWidget* parent) : QWidget(parent)
       
   113 {
       
   114 	QFont * font14 = new QFont("MS Shell Dlg", 14);
       
   115 	QVBoxLayout * pageLayout = new QVBoxLayout(this);
    91 	QVBoxLayout * pageLayout = new QVBoxLayout(this);
   116 	QHBoxLayout * topLayout = new QHBoxLayout();
    92 	QHBoxLayout * topLayout = new QHBoxLayout();
   117 	QHBoxLayout * bottomLayout = new QHBoxLayout();
    93 	QHBoxLayout * bottomLayout = new QHBoxLayout();
   118 	pageLayout->addLayout(topLayout, 100);
    94 	pageLayout->addLayout(topLayout, 100);
   119 	pageLayout->addLayout(bottomLayout, 0);
    95 	pageLayout->addLayout(bottomLayout, 0);
   120 
    96 
   121 	BtnBack = new QPushButton(this);
    97 	BtnBack = addButton("Back", bottomLayout, 100);
   122 	BtnBack->setFont(*font14);
       
   123 	BtnBack->setText(QPushButton::tr("Back"));
       
   124 	bottomLayout->addWidget(BtnBack, 100);
       
   125 	bottomLayout->addStretch(100);
    98 	bottomLayout->addStretch(100);
   126 	BtnSimpleGame = new QPushButton(this);
    99 
   127 	BtnSimpleGame->setFont(*font14);
   100 	BtnSimpleGame = addButton("Simple Game", bottomLayout, 100);
   128 	BtnSimpleGame->setText(QPushButton::tr("Simple Game"));
       
   129 	bottomLayout->addWidget(BtnSimpleGame, 100);
       
   130 
   101 
   131 	gameCFG = new GameCFGWidget(this);
   102 	gameCFG = new GameCFGWidget(this);
   132 	topLayout->addStretch(100);
   103 	topLayout->addStretch(100);
   133 	topLayout->addWidget(gameCFG);
   104 	topLayout->addWidget(gameCFG);
   134 	topLayout->addStretch(100);
   105 	topLayout->addStretch(100);
   697 	BtnBack->setFont(*font14);
   668 	BtnBack->setFont(*font14);
   698 	BtnBack->setText(QPushButton::tr("Back"));
   669 	BtnBack->setText(QPushButton::tr("Back"));
   699 	pageLayout->addWidget(BtnBack, 1, 0);
   670 	pageLayout->addWidget(BtnBack, 1, 0);
   700 }
   671 }
   701 
   672 
   702 PageSelectWeapon::PageSelectWeapon(QWidget* parent) : QWidget(parent)
   673 PageSelectWeapon::PageSelectWeapon(QWidget* parent) : 
   703 {
   674   AbstractPage(parent)
   704 	QFont * font14 = new QFont("MS Shell Dlg", 14);
   675 {
   705 	QGridLayout * pageLayout = new QGridLayout(this);
   676 	QGridLayout * pageLayout = new QGridLayout(this);
   706 	pageLayout->setMargin(25);
   677 	pageLayout->setMargin(25);
   707 	//pageLayout->setColumnStretch(0, 1);
   678 	//pageLayout->setColumnStretch(0, 1);
   708 	//pageLayout->setColumnStretch(1, 2);
   679 	//pageLayout->setColumnStretch(1, 2);
   709 	//pageLayout->setColumnStretch(2, 1);
   680 	//pageLayout->setColumnStretch(2, 1);
   710         
   681         
   711         pWeapons=new SelWeaponWidget(20, this);
   682         pWeapons=new SelWeaponWidget(20, this);
   712 	pageLayout->addWidget(pWeapons, 0, 0, 1, 3);
   683 	pageLayout->addWidget(pWeapons, 0, 0, 1, 3);
   713 
   684 
   714 	BtnBack = new QPushButton(this);
   685 	BtnBack = addButton("Back", pageLayout, 1, 0);
   715 	BtnBack->setFont(*font14);
   686 	BtnDefault = addButton("Default", pageLayout, 1, 1);
   716 	BtnBack->setText(QPushButton::tr("Back"));
   687 	BtnSave = addButton("Save", pageLayout, 1, 2);
   717 	pageLayout->addWidget(BtnBack, 1, 0);
   688 }
   718 
   689 
   719 	BtnDefault = new QPushButton(this);
       
   720 	BtnDefault->setFont(*font14);
       
   721 	BtnDefault->setText(QPushButton::tr("Default"));
       
   722 	pageLayout->addWidget(BtnDefault, 1, 1);
       
   723 
       
   724 	BtnSave = new QPushButton(this);
       
   725 	BtnSave->setFont(*font14);
       
   726 	BtnSave->setText(QPushButton::tr("Save"));
       
   727 	pageLayout->addWidget(BtnSave, 1, 2);
       
   728 }
       
   729