25struct builder_combobox;
93 void set_values(
const std::vector<::config>& values,
unsigned selected = 0);
94 void set_selected(
unsigned selected,
bool fire_event =
true);
121 void delete_char(
const bool before_cursor)
override;
203 static const std::string&
type();
214 const point& coordinate);
253 virtual std::unique_ptr<widget>
build()
const override;
A config object defines a single node in a WML file, with access to child nodes.
void set_hint_data(const std::string &text, const std::string &image)
void signal_handler_mouse_enter(const event::ui_event, bool &)
void signal_handler_left_button_up(const event::ui_event event, bool &handled)
std::size_t max_input_length_
The maximum length of the text input.
std::string get_preset_value(const size_t index) const
Get the index-th value from the preset values that area shown in the dropdown.
void update_mouse_cursor()
Update the mouse cursor based on whether it is over button area or text area.
void delete_selection() override
Deletes the current selection.
void goto_start_of_line(const bool select=false) override
Moves the cursor to the beginning of the line.
void update_offsets()
Updates text_x_offset_ and text_y_offset_.
void goto_end_of_line(const bool select=false) override
Moves the cursor to the end of the line.
std::string get_hint_text() const
bool dragging_
Is the mouse in dragging mode, this affects selection in mouse move.
void set_max_input_length(const std::size_t length)
void signal_handler_mouse_motion(const event::ui_event event, bool &handled, const point &coordinate)
void handle_mouse_selection(point mouse, const bool start_selection)
std::string get_hint_image() const
virtual void update_canvas() override
Updates the canvas(ses).
unsigned const ICON_SIZE
Size of the dropdown icon TODO : Should be dynamically loaded from image.
void handle_key_clear_line(SDL_Keymod modifier, bool &handled) override
Inherited from text_box_base.
std::size_t get_max_input_length() const
std::string hint_image_
Image (such as a magnifying glass) that accompanies the help text.
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
void handle_key_down_arrow(SDL_Keymod, bool &handled) override
Inherited from text_box_base.
void set_hint_image(const std::string &image)
void set_values(const std::vector<::config > &values, unsigned selected=0)
int get_selected() const
Returned last selected entry's index or -1 if typed value that does not matches any preset value.
void set_hint_text(const std::string &text)
void signal_handler_left_button_down(const event::ui_event event, bool &handled)
void delete_char(const bool before_cursor) override
Deletes the character.
std::vector<::config > values_
int get_item_count() const
point text_offset_
The x, y offset in the widget where the text starts.
void signal_handler_left_button_double_click(const event::ui_event event, bool &handled)
void set_selected(unsigned selected, bool fire_event=true)
void handle_key_up_arrow(SDL_Keymod, bool &handled) override
Inherited from text_box_base.
std::string hint_text_
Helper text to display (such as "Search") if the combo box is empty.
unsigned text_height_
The height of the text itself.
virtual void place(const point &origin, const point &size) override
See widget::place.
virtual const std::string & get_control_type() const override
Inherited from styled_widget, implemented by REGISTER_WIDGET.
Abstract base class for text items.
const std::string & text() const
virtual void set_value(const std::string &text)
The set_value is virtual for the password_box class.
virtual void goto_end_of_data(const bool select=false)
Moves the cursor to the end of all text.
virtual void goto_start_of_data(const bool select=false)
Moves the cursor to the beginning of the data.
ui_event
The event sent to the dispatcher.
Functions to load and save images from/to disk.
Contains the implementation details for lexical_cast and shouldn't be used directly.
typed_formula< unsigned > text_y_offset
typed_formula< unsigned > text_x_offset
std::vector<::config > options_
std::size_t max_input_length
virtual std::unique_ptr< widget > build() const override