Mana
Loading...
Searching...
No Matches
dropdown.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2006-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 <guichan/widgets/dropdown.hpp>
25
33class DropDown : public gcn::DropDown
34{
35 public:
42 DropDown(gcn::ListModel *listModel = nullptr);
43
44 ~DropDown() override;
45
46 void draw(gcn::Graphics *graphics) override;
47
48 void drawFrame(gcn::Graphics *graphics) override;
49
50 void adjustHeight();
51
52 // Inherited from BasicContainer
53
54 gcn::Rectangle getChildrenArea() override;
55
56 // Inherited from FocusListener
57
58 void focusLost(const gcn::Event& event) override;
59
60 // Inherited from KeyListener
61
62 void keyPressed(gcn::KeyEvent& keyEvent) override;
63
64 // Inherited from MouseListener
65
66 void mousePressed(gcn::MouseEvent& mouseEvent) override;
67
68 void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override;
69
70 void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override;
71
72 protected:
78 void drawButton(gcn::Graphics *graphics) override;
79
80 void dropDown() override;
81 void foldUp() override;
82
83 int mPadding = 1;
84};
A drop down box from which you can select different values.
Definition dropdown.h:34
void mouseWheelMovedDown(gcn::MouseEvent &mouseEvent) override
Definition dropdown.cpp:235
void mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) override
Definition dropdown.cpp:228
void mousePressed(gcn::MouseEvent &mouseEvent) override
Definition dropdown.cpp:212
~DropDown() override
Definition dropdown.cpp:51
void dropDown() override
Definition dropdown.cpp:243
void adjustHeight()
Definition dropdown.cpp:111
void focusLost(const gcn::Event &event) override
Definition dropdown.cpp:206
void drawButton(gcn::Graphics *graphics) override
Draws the button with the little down arrow.
Definition dropdown.cpp:159
void drawFrame(gcn::Graphics *graphics) override
Definition dropdown.cpp:99
void keyPressed(gcn::KeyEvent &keyEvent) override
Definition dropdown.cpp:179
gcn::Rectangle getChildrenArea() override
Definition dropdown.cpp:145
int mPadding
Definition dropdown.h:83
void foldUp() override
Definition dropdown.cpp:261
void draw(gcn::Graphics *graphics) override
Definition dropdown.cpp:56
Graphics * graphics
Definition client.cpp:104