~vcs-imports/aethyra/client

« back to all changes in this revision

Viewing changes to src/bindings/guichan/dialogs/selectiondialog.h

  • Committer: Tametomo
  • Date: 2010-10-07 21:11:23 UTC
  • Revision ID: git-v1:dd62b9e123b6d7e4b0efb9b634dc1596d81bfea6
Instead of automatically defaulting to OpenGL, start the client in SDL
mode, then allow the user to select whether they want to use SDL or OpenGl.
Issue originally brought up by Srauls.

Also updated Code::Blocks dependencies to match up with a forthcoming
Windows devpack.

TODO: Eventually make restarting the client doable from within the running
instance, instead of relying on the user to do so themselves.

Signed-off-by: Tametomo <irarice@gmail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Aethyra
 
3
 *  Copyright (C) 2010  Aethyra Development Team
 
4
 *
 
5
 *  This file is part of Aethyra.
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 2 of the License, or
 
10
 *  any later version.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software
 
19
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
 */
 
21
 
 
22
#ifndef SELECTION_DIALOG_H
 
23
#define SELECTION_DIALOG_H
 
24
 
 
25
#include <vector>
 
26
 
 
27
#include <guichan/actionlistener.hpp>
 
28
 
 
29
#include "../widgets/window.h"
 
30
 
 
31
class RadioButton;
 
32
class TextBox;
 
33
 
 
34
/**
 
35
 * A selection dialog.
 
36
 *
 
37
 * \ingroup GUI
 
38
 */
 
39
class SelectionDialog : public Window, public gcn::ActionListener
 
40
{
 
41
    public:
 
42
        /**
 
43
         * Constructor.
 
44
         *
 
45
         * @see Window::Window
 
46
         */
 
47
        SelectionDialog(const std::string &title, const std::string &msg,
 
48
                        Window *parent = NULL, bool modal = false);
 
49
 
 
50
        virtual void close();
 
51
 
 
52
        unsigned int getNumRows();
 
53
 
 
54
        /**
 
55
         * Called when receiving actions from the widgets.
 
56
         */
 
57
        void action(const gcn::ActionEvent &event);
 
58
 
 
59
        void fontChanged();
 
60
 
 
61
        void reflow();
 
62
 
 
63
        /**
 
64
         * Adds an option to select from.
 
65
         */
 
66
        void addOption(std::string key, std::string label);
 
67
    private:
 
68
        TextBox *mTextBox;
 
69
        gcn::Button *mOkButton;
 
70
        std::vector<RadioButton*> mRadioButtons;
 
71
        std::string mDialogKey;
 
72
        static int mInstances;
 
73
};
 
74
 
 
75
#endif