The Battle for Wesnoth  1.15.1+dev
floating_textbox.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 - 2018 by Joerg Hinrichs <joerg.hinrichs@alice-dsl.de>
3  wesnoth playturn Copyright (C) 2003 by David White <dave@whitevine.net>
4  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
18 // Scoped_resource can't use a pointer to an incomplete pointer with MSVC.
19 #include "widgets/textbox.hpp"
20 
21 #include <memory>
22 #include <set>
23 
24 class game_display;
25 
26 namespace gui{
27 
28  class button;
29 
32 
34  public:
36 
37  TEXTBOX_MODE mode() const { return mode_; }
38  const std::unique_ptr<gui::button>& check() const { return check_; }
39  const std::unique_ptr<gui::textbox>& box() const { return box_; }
40 
41  void close(game_display& gui);
42  void update_location(game_display& gui);
43  void show(gui::TEXTBOX_MODE mode, const std::string& label,
44  const std::string& check_label, bool checked, game_display& gui);
45  void tab(const std::set<std::string>& dictionary);
46  bool active() const { return box_.get() != nullptr; }
47 
48  private:
49  std::unique_ptr<gui::textbox> box_;
50  std::unique_ptr<gui::button> check_;
51 
53 
54  std::string label_string_;
55  int label_;
56  };
57 }
General purpose widgets.
void update_location(game_display &gui)
const std::unique_ptr< gui::button > & check() const
TEXTBOX_MODE mode() const
std::unique_ptr< gui::button > check_
std::unique_ptr< gui::textbox > box_
void tab(const std::set< std::string > &dictionary)
void show(gui::TEXTBOX_MODE mode, const std::string &label, const std::string &check_label, bool checked, game_display &gui)
const std::unique_ptr< gui::textbox > & box() const
void close(game_display &gui)