25 struct builder_combobox;
117 void delete_char(
const bool before_cursor)
override;
200 static const std::string&
type();
250 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.
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)
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
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.
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)
unsigned text_y_offset_
The y offset in the widget where the text starts.
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
void signal_handler_left_button_double_click(const event::ui_event event, bool &handled)
void set_selected(unsigned selected, bool fire_event=true)
unsigned text_x_offset_
The x offset in the widget where the text starts.
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.
unsigned get_selected() const
virtual const std::string & get_control_type() const override
Inherited from styled_widget, implemented by REGISTER_WIDGET.
virtual void place(const point &origin, const point &size) override
See widget::place.
combobox(const implementation::builder_styled_widget &builder)
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.
bool fire_event(const ui_event event, const std::vector< std::pair< widget *, ui_event >> &event_chain, widget *dispatcher, widget *w, F &&... params)
Helper function for fire_event.
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.
map_location coordinate
Contains an x and y coordinate used for starting positions in maps.
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
resolution(const config &cfg)
typed_formula< unsigned > text_y_offset
typed_formula< unsigned > text_x_offset
combobox_definition(const config &cfg)
std::vector<::config > options_
builder_combobox(const config &cfg)
std::size_t max_input_length
virtual std::unique_ptr< widget > build() const override