28 #define ERR_DP LOG_STREAM(err, log_display) 63 const int border_size = 10;
65 const int ypos = area.y+area.h-30 - (
check_ !=
nullptr ?
check_->height() + border_size : 0);
82 const int textbox_width = area.w - label_area.w - border_size*3;
84 if(textbox_width <= 0) {
90 box_->set_volatile(
true);
92 area.x + label_area.w + border_size * 2
98 box_->set_location(rect);
102 check_->set_volatile(
true);
103 check_->set_location(
box_->location().x,
box_->location().y +
box_->location().h + border_size);
115 if(!check_label.empty()) {
117 check_->set_check(checked);
132 std::string text =
box_->text();
133 std::vector<std::string> matches(dictionary.begin(), dictionary.end());
136 if (matches.empty())
return;
138 text.append(line_start ?
": " :
" ");
139 }
else if (matches.size() > 1) {
140 std::string completion_list =
utils::join(matches,
" ");
144 box_->set_text(text);
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
void set_clip_rect(const SDL_Rect &r)
void remove_floating_label(int handle)
removes the floating label given by 'handle' from the screen
void add_chat_message(const std::time_t &time, const std::string &speaker, int side, const std::string &msg, events::chat_handler::MESSAGE_TYPE type, bool bell)
std::string label_string_
void set_alignment(ALIGN align)
void update_location(game_display &gui)
TEXTBOX_MODE mode() const
void set_position(double xpos, double ypos)
const color_t YELLOW_COLOR
void invalidate_all()
Function to invalidate all tiles.
void set_message_private(bool value)
void set_color(const color_t &color)
std::unique_ptr< gui::button > check_
std::unique_ptr< gui::textbox > box_
const SDL_Rect & map_outside_area() const
Returns the available area for a map, this may differ from the above.
void tab(const std::set< std::string > &dictionary)
int add_floating_label(const floating_label &flabel)
add a label floating on the screen above everything else.
SDL_Rect get_floating_label_rect(int handle)
void show(gui::TEXTBOX_MODE mode, const std::string &label, const std::string &check_label, bool checked, game_display &gui)
static lg::log_domain log_display("display")
display_chat_manager & get_chat_manager()
Standard logging facilities (interface).
CVideo & video()
Gets the underlying screen object.
void close(game_display &gui)
bool word_completion(std::string &text, std::vector< std::string > &wordlist)
Try to complete the last word of 'text' with the 'wordlist'.
static game_display * get_singleton()