00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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