Mana
Loading...
Searching...
No Matches
quitdialog.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "gui/widgets/window.h"
25
26#include <guichan/actionlistener.hpp>
27#include <guichan/keylistener.hpp>
28
29#include <vector>
30
31class Button;
32
38class QuitDialog : public Window, public gcn::ActionListener,
39 public gcn::KeyListener
40{
41 public:
47 QuitDialog(QuitDialog **pointerToMe);
48
49 ~QuitDialog() override;
50
54 void action(const gcn::ActionEvent &event) override;
55
56 void keyPressed(gcn::KeyEvent &keyEvent) override;
57
58 private:
59 void placeOption(ContainerPlacer &place, gcn::RadioButton *option);
60 std::vector<gcn::RadioButton*> mOptions;
61
62 gcn::RadioButton *mLogoutQuit;
63 gcn::RadioButton *mForceQuit;
64 gcn::RadioButton *mSwitchAccountServer;
65 gcn::RadioButton *mSwitchCharacter;
68
70};
Button widget.
Definition button.h:38
This class is a helper for adding widgets to nested tables in a window.
Definition layout.h:34
The quit dialog.
Definition quitdialog.h:40
gcn::RadioButton * mSwitchAccountServer
Definition quitdialog.h:64
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
QuitDialog ** mMyPointer
Definition quitdialog.h:69
std::vector< gcn::RadioButton * > mOptions
Definition quitdialog.h:60
Button * mOkButton
Definition quitdialog.h:66
Button * mCancelButton
Definition quitdialog.h:67
void placeOption(ContainerPlacer &place, gcn::RadioButton *option)
gcn::RadioButton * mForceQuit
Definition quitdialog.h:63
void keyPressed(gcn::KeyEvent &keyEvent) override
~QuitDialog() override
gcn::RadioButton * mSwitchCharacter
Definition quitdialog.h:65
gcn::RadioButton * mLogoutQuit
Definition quitdialog.h:62
A window.
Definition window.h:59
LayoutCell & place(int x, int y, gcn::Widget *, int w=1, int h=1)
Adds a widget to the window and sets it at given cell.
Definition window.cpp:737