QTfrontend/ui/page/AbstractPage.h
author Wuzzy <almikes@aol.com>
Fri, 22 Sep 2017 02:35:06 +0200
changeset 12482 eeeb7e8de95c
parent 12245 5206f9a803d1
permissions -rw-r--r--
Add folder icon for main menu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 788
diff changeset
     2
 * Hedgewars, a free turn based strategy game
11046
47a8c19ecb60 more copyright fixes
sheepluva
parents: 10108
diff changeset
     3
 * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     4
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     8
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    12
 * GNU General Public License for more details.
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    13
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    15
 * along with this program; if not, write to the Free Software
10108
c68cf030eded update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents: 9998
diff changeset
    16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    17
 */
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    18
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    19
/**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    20
 * @file
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    21
 * @brief AbstractPage class definition
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    22
 */
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    23
5205
78138ae93820 some headers cleanup and rename of stats and playrecord pages for consistency
koda
parents: 5204
diff changeset
    24
#ifndef ABSTRACTPAGE_H
78138ae93820 some headers cleanup and rename of stats and playrecord pages for consistency
koda
parents: 5204
diff changeset
    25
#define ABSTRACTPAGE_H
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    26
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    27
#include <QWidget>
6577
9e49e6a8585b disable the glitchy exit sound
bovi
parents: 6477
diff changeset
    28
#include <qpushbuttonwithsound.h>
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    29
#include <QFont>
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    30
#include <QGridLayout>
5205
78138ae93820 some headers cleanup and rename of stats and playrecord pages for consistency
koda
parents: 5204
diff changeset
    31
#include <QComboBox>
1840
4747f0232b88 ttsmj2's random teams patch
unc0rr
parents: 1812
diff changeset
    32
#include <QSignalMapper>
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    33
6577
9e49e6a8585b disable the glitchy exit sound
bovi
parents: 6477
diff changeset
    34
class QPushButtonWithSound;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    35
class QGroupBox;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    36
class QComboBox;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    37
class QLabel;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    38
class QToolBox;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    39
class QLineEdit;
665
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    40
class QListWidget;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    41
class QCheckBox;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    42
class QSpinBox;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    43
class QTextEdit;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    44
class QRadioButton;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    45
class QTableView;
1377
a9e768739345 - Customize QTextBrowser look
unc0rr
parents: 1315
diff changeset
    46
class QTextBrowser;
1399
ada2411c1d60 Show additional info in rooms list
unc0rr
parents: 1395
diff changeset
    47
class QTableWidget;
1409
d1cbe4a57ebf Add button for controlling room options (no usefull yet)
unc0rr
parents: 1399
diff changeset
    48
class QAction;
1885
75489216b5b0 Continue work on new schemes
unc0rr
parents: 1884
diff changeset
    49
class QDataWidgetMapper;
1887
d68939b3f7f0 - Share model between test table and widgets
unc0rr
parents: 1885
diff changeset
    50
class QAbstractItemModel;
2773
e94f240a8a41 Have game beep when someone joins lobby/room. Controlled by Sound option
nemo
parents: 2762
diff changeset
    51
class QSettings;
3694
3e9c0634065c new quality slider widget (needs to be customized), removed obsolete arguments
koda
parents: 3690
diff changeset
    52
class QSlider;
6038
58d9badf3e7f wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents: 6009
diff changeset
    53
class QGridlayout;
665
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    54
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    55
class AbstractPage : public QWidget
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    56
{
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6577
diff changeset
    57
        Q_OBJECT
1885
75489216b5b0 Continue work on new schemes
unc0rr
parents: 1884
diff changeset
    58
6477
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    59
    public:
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    60
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    61
        /**
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    62
        * @brief Changes the desc text (should not be called manualy)
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    63
        *
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    64
        * @param desc the description of the widget focused
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    65
        */
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    66
        void setButtonDescription(QString desc);
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    67
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    68
        /**
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    69
        * @brief Changes the desc defaut text
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    70
        *
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    71
        * @param text the defaut desc
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    72
        */
8729
b19be476a2fa Call steps on focus instead. fix typo
nemo
parents: 8384
diff changeset
    73
        void setDefaultDescription(QString text);
6477
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    74
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    75
        /**
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    76
        * @brief Get the desc defaut text
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    77
        */
8729
b19be476a2fa Call steps on focus instead. fix typo
nemo
parents: 8384
diff changeset
    78
        QString * getDefaultDescription();
6477
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
    79
6038
58d9badf3e7f wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents: 6009
diff changeset
    80
    signals:
8384
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    81
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    82
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    83
         * @brief This signal is emitted when going back to the previous is
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    84
         * requested - e.g. when the back-button is clicked.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
    85
         */
6038
58d9badf3e7f wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents: 6009
diff changeset
    86
        void goBack();
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    87
8384
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    88
        /**
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    89
         * @brief This signal is emitted when the page is displayed
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    90
         */
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    91
        void pageEnter();
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    92
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    93
        /**
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    94
         * @brief This signal is emitted when this page is left
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    95
         */
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    96
        void pageLeave();
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    97
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    98
    public slots:
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
    99
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   100
        /**
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   101
         * @brief This slot is called to trigger this page's pageEnter signal
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   102
         */
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   103
        void triggerPageEnter();
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   104
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   105
        /**
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   106
         * @brief This slot is called to trigger this page's pageLeave signal
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   107
         */
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   108
        void triggerPageLeave();
a6e7a95f3b2e GCI2012: Abstract Page Load
dag10
parents: 8377
diff changeset
   109
6038
58d9badf3e7f wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents: 6009
diff changeset
   110
    protected:
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   111
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   112
         * @brief Class constructor
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   113
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   114
         * @param parent parent widget.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   115
         */
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   116
        AbstractPage(QWidget * parent = 0);
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   117
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   118
        /// Class Destructor
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   119
        virtual ~AbstractPage() {};
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   120
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   121
        /// Call this in the constructor of your subclass.
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   122
        void initPage();
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   123
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   124
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   125
         * @brief Used during page construction.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   126
         * You MUST implement this method in your subclass.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   127
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   128
         * Use it to define the main layout (no behavior) of the page.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   129
         */
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   130
        virtual QLayout * bodyLayoutDefinition() = 0;
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   131
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   132
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   133
         * @brief Used during page construction.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   134
         * You can implement this method in your subclass.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   135
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   136
         * Use it to define layout (not behavior) of the page's footer.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   137
         */
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6577
diff changeset
   138
        virtual QLayout * footerLayoutDefinition()
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6577
diff changeset
   139
        {
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6577
diff changeset
   140
            return NULL;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6577
diff changeset
   141
        };
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   142
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   143
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   144
         * @brief Used during page construction.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   145
         * You can implement this method in your subclass.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   146
         *
8377
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   147
         * Use it to define layout (not behavior) of the page's footer to the left of the help text.
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   148
         */
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   149
        virtual QLayout * footerLayoutLeftDefinition()
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   150
        {
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   151
            return NULL;
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   152
        };
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   153
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   154
        /**
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   155
         * @brief Used during page construction.
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   156
         * You can implement this method in your subclass.
869f80966a77 GCI2012: Improve Game Configuration Widget
dag10
parents: 7781
diff changeset
   157
         *
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   158
         * This is a good place to connect signals within your page in order
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   159
         * to get the desired page behavior.<br />
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   160
         * Keep in mind not to expose twidgets as public!
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   161
         * instead define a signal with a meaningful name and connect the widget
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   162
         * signals to your page signals
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   163
         */
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   164
        virtual void connectSignals() {};
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   165
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   166
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   167
         * @brief Creates a default formatted button for this page.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   168
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   169
         * @param name name of the button - used as its text if not hasIcon.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   170
         * @param hasIcon set to true if this is a picture button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   171
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   172
         * @return the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   173
         */
6577
9e49e6a8585b disable the glitchy exit sound
bovi
parents: 6477
diff changeset
   174
        QPushButtonWithSound * formattedButton(const QString & name, bool hasIcon = false);
7781
6505805e7f98 crude workaround for problem inu reported with sound button
nemo
parents: 6952
diff changeset
   175
        QPushButton * formattedSoundlessButton(const QString & name, bool hasIcon = false);
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   176
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   177
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   178
         * @brief Creates a default formatted button and adds it to a
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   179
         * grid layout at the location specified.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   180
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   181
         * @param name label or path to icon of the button (depends on hasIcon)
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   182
         * @param grid pointer of the grid layout in which to insert the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   183
         * @param row layout row index in which to insert the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   184
         * @param column layout column index in which to insert the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   185
         * @param rowSpan how many layout rows the button will span.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   186
         * @param columnSpan how many layout columns the button will span.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   187
         * @param hasIcon set to true if this is a picture button.
11818
b421923c2577 Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
   188
         * @param alignment alignment of the button in the layout.
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   189
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   190
         * @return the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   191
         */
11818
b421923c2577 Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
   192
        QPushButtonWithSound * addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan = 1, int columnSpan = 1, bool hasIcon = false, Qt::Alignment alignment = 0);
12245
5206f9a803d1 Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents: 11818
diff changeset
   193
        QPushButton * addSoundlessButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan = 1, int columnSpan = 1, bool hasIcon = false, Qt::Alignment alignment = 0);
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   194
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   195
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   196
         * @brief Creates a default formatted button and adds it to a
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   197
         * grid layout at the location specified.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   198
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   199
         * @param name label or path to icon of the button (depends on hasIcon)
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   200
         * @param box pointer of the box layout in which to insert the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   201
         * @param where layout ndex in which to insert the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   202
         * @param hasIcon set to true if this is a picture button.
11818
b421923c2577 Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
   203
         * @param alignment alignment of the button in the layout.
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   204
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   205
         * @return the button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   206
         */
11818
b421923c2577 Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
   207
        QPushButtonWithSound * addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false, Qt::Alignment alignment = 0);
b421923c2577 Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
   208
        QPushButton* addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false, Qt::Alignment alignment = 0);
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   209
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   210
        /**
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   211
         * @brief Changes visibility of the back-button.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   212
         *
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   213
         * @param visible set to true if the button should be visible.
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   214
         */
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6038
diff changeset
   215
        void setBackButtonVisible(bool visible = true);
692
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   216
6200
6a4ace88d85a tweak and document abstract page
sheepluva
parents: 6175
diff changeset
   217
        QFont * font14; ///< used font
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   218
6477
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
   219
        QLabel * descLabel; ///< text description
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
   220
        QString * defautDesc;
ad5741c252b9 GCI task: describez
Oranger
parents: 6200
diff changeset
   221
6577
9e49e6a8585b disable the glitchy exit sound
bovi
parents: 6477
diff changeset
   222
        QPushButtonWithSound * btnBack; ///< back button
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   223
};
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   224
5205
78138ae93820 some headers cleanup and rename of stats and playrecord pages for consistency
koda
parents: 5204
diff changeset
   225
#endif
78138ae93820 some headers cleanup and rename of stats and playrecord pages for consistency
koda
parents: 5204
diff changeset
   226