00001 /* $Id: floating_textbox.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2006 - 2012 by Joerg Hinrichs <joerg.hinrichs@alice-dsl.de> 00004 wesnoth playturn Copyright (C) 2003 by David White <dave@whitevine.net> 00005 Part of the Battle for Wesnoth Project http://www.wesnoth.org/ 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY. 00013 00014 See the COPYING file for more details. 00015 */ 00016 00017 #ifndef FLOATING_TEXTBOX_H_INCLUDED 00018 #define FLOATING_TEXTBOX_H_INCLUDED 00019 00020 // Scoped_resource can't use a pointer to an incomplete pointer with MSVC. 00021 #include "widgets/textbox.hpp" 00022 #include "scoped_resource.hpp" 00023 00024 #include <set> 00025 00026 class game_display; 00027 class team; 00028 class unit_map; 00029 00030 namespace gui{ 00031 00032 class button; 00033 00034 enum TEXTBOX_MODE { TEXTBOX_NONE, TEXTBOX_SEARCH, TEXTBOX_MESSAGE, 00035 TEXTBOX_COMMAND, TEXTBOX_AI }; 00036 00037 class floating_textbox{ 00038 public: 00039 floating_textbox(); 00040 00041 TEXTBOX_MODE mode() const { return mode_; } 00042 const util::scoped_ptr<gui::button>& check() const { return check_; } 00043 const util::scoped_ptr<gui::textbox>& box() const { return box_; } 00044 00045 void close(game_display& gui); 00046 void update_location(game_display& gui); 00047 void show(gui::TEXTBOX_MODE mode, const std::string& label, 00048 const std::string& check_label, bool checked, game_display& gui); 00049 void tab(const std::set<std::string>& dictionary); 00050 bool active() const { return box_.get() != NULL; } 00051 00052 private: 00053 util::scoped_ptr<gui::textbox> box_; 00054 util::scoped_ptr<gui::button> check_; 00055 00056 TEXTBOX_MODE mode_; 00057 00058 std::string label_string_; 00059 int label_; 00060 }; 00061 } 00062 00063 #endif
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:02:36 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |