The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
combo.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by David White <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 #ifndef COMBO_H_INCLUDED
15 #define COMBO_H_INCLUDED
16 
17 #include "button.hpp"
18 
19 class display;
20 
21 namespace gui {
22 
23 class combo : public button
24 {
25 public:
26  combo(CVideo& v, const std::vector<std::string>& items);
27 
28  void set_selected(int val);
29  void set_items(const std::vector<std::string>& items);
30  int selected() const;
31  bool changed();
32 
33 protected:
34  virtual void process_event();
35 
36  void make_drop_down_menu();
37 private:
38  void set_selected_internal(int val);
39  std::vector<std::string> items_;
43  static const int font_size;
44  static const int horizontal_padding;
45  static const int vertical_padding;
46 }; //end class combo
47 
48 }
49 
50 #endif
CVideo * video_
Definition: combo.hpp:41
virtual void process_event()
Definition: combo.cpp:82
Definition: video.hpp:58
General purpose widgets.
std::vector< std::string > items_
Definition: combo.hpp:39
GLuint const GLfloat * val
Definition: glew.h:2614
static const int horizontal_padding
Definition: combo.hpp:44
combo(CVideo &v, const std::vector< std::string > &items)
Definition: combo.cpp:32
const std::vector< std::string > items
int selected() const
Definition: combo.cpp:38
static const int font_size
Definition: combo.hpp:43
static const int vertical_padding
Definition: combo.hpp:45
bool changed()
Definition: combo.cpp:43
const GLdouble * v
Definition: glew.h:1359
void set_selected_internal(int val)
Definition: combo.cpp:58
void set_selected(int val)
Definition: combo.cpp:68
void set_items(const std::vector< std::string > &items)
Definition: combo.cpp:52
int selected_
Definition: combo.hpp:40
void make_drop_down_menu()
Definition: combo.cpp:74
static const std::string empty_combo_label
Definition: combo.hpp:42
int oldSelected_
Definition: combo.hpp:40
GLsizei const GLcharARB ** string
Definition: glew.h:4503