floating_textbox.hpp

Go to the documentation of this file.
00001 /* $Id: floating_textbox.hpp 26083 2008-04-25 01:55:51Z soliton $ */
00002 /*
00003    Copyright (C) 2006 - 2008 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 version 2
00009    or 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 
00016 #ifndef FLOATING_TEXTBOX_H_INCLUDED
00017 #define FLOATING_TEXTBOX_H_INCLUDED
00018 
00019 #include "global.hpp"
00020 
00021 #include "scoped_resource.hpp"
00022 #include "widgets/textbox.hpp"
00023 
00024 class game_display;
00025 class team;
00026 class unit_map;
00027 
00028 namespace gui{
00029 
00030     enum TEXTBOX_MODE { TEXTBOX_NONE, TEXTBOX_SEARCH, TEXTBOX_MESSAGE,
00031                 TEXTBOX_COMMAND, TEXTBOX_AI };
00032 
00033     class floating_textbox{
00034     public:
00035         floating_textbox();
00036 
00037         TEXTBOX_MODE mode() const { return mode_; }
00038         const util::scoped_ptr<gui::button>& check() const { return check_; }
00039         const util::scoped_ptr<gui::textbox>& box() const { return box_; }
00040 
00041         void close(game_display& gui);
00042         void update_location(game_display& gui);
00043         void show(gui::TEXTBOX_MODE mode, const std::string& label,
00044             const std::string& check_label, bool checked, game_display& gui);
00045         void tab(std::vector<team>& teams, const unit_map& units, game_display& gui);
00046         bool active() const { return box_.get() != NULL; }
00047 
00048     private:
00049         util::scoped_ptr<gui::textbox> box_;
00050         util::scoped_ptr<gui::button> check_;
00051 
00052         TEXTBOX_MODE mode_;
00053 
00054         std::string label_string_;
00055         int label_;
00056     };
00057 }
00058 
00059 #endif

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs