00001 /* $Id: combo.hpp 23842 2008-02-16 08:47:16Z mordante $ */ 00002 /* 00003 Copyright (C) 2003 - 2008 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 version 2 00008 or at your option any later version. 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY. 00011 00012 See the COPYING file for more details. 00013 */ 00014 #ifndef COMBO_H_INCLUDED 00015 #define COMBO_H_INCLUDED 00016 00017 #include "SDL.h" 00018 00019 class display; 00020 00021 #include "button.hpp" 00022 00023 namespace gui { 00024 00025 class combo : public button 00026 { 00027 public: 00028 combo(display& disp, const std::vector<std::string>& items); 00029 00030 void set_selected(int val); 00031 void set_items(const std::vector<std::string>& items); 00032 size_t items_size() const; 00033 int selected() const; 00034 bool changed(); 00035 00036 protected: 00037 virtual void process_event(); 00038 00039 private: 00040 void set_selected_internal(int val); 00041 std::vector<std::string> items_; 00042 int selected_, oldSelected_; 00043 display* disp_; 00044 }; //end class combo 00045 00046 } 00047 00048 #endif
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |