00001 /* $Id: combo.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2003 - 2012 by David White <dave@whitevine.net> 00004 Part of the Battle for Wesnoth Project http://www.wesnoth.org/ 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY. 00012 00013 See the COPYING file for more details. 00014 */ 00015 #ifndef COMBO_H_INCLUDED 00016 #define COMBO_H_INCLUDED 00017 00018 #include "button.hpp" 00019 00020 class display; 00021 00022 namespace gui { 00023 00024 class combo : public button 00025 { 00026 public: 00027 combo(display& disp, const std::vector<std::string>& items); 00028 00029 void set_selected(int val); 00030 void set_items(const std::vector<std::string>& items); 00031 int selected() const; 00032 bool changed(); 00033 00034 protected: 00035 virtual void process_event(); 00036 00037 void make_drop_down_menu(); 00038 private: 00039 void set_selected_internal(int val); 00040 std::vector<std::string> items_; 00041 int selected_, oldSelected_; 00042 display* disp_; 00043 static const std::string empty_combo_label; 00044 static const int font_size; 00045 static const int horizontal_padding; 00046 static const int vertical_padding; 00047 }; //end class combo 00048 00049 } 00050 00051 #endif
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:02:58 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |