27 struct builder_slider;
49 virtual void set_value(
int value)
override;
161 return current.x - original.x;
200 static const std::string&
type();
251 virtual std::unique_ptr<widget>
build()
const override;
A config object defines a single node in a WML file, with access to child nodes.
Basic template class to generate new items.
Small abstract helper class.
Base class for a scroll bar.
unsigned slider_get_item_last() const
unsigned get_slider_position() const
void set_step_size(int step_size)
virtual void child_callback_positioner_moved() override
Inherited from scrollbar_base.
t_string maximum_value_label_
When the slider shows the maximum value can show a special text.
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
void handle_key_decrease(bool &handled)
Handlers for keyboard input.
unsigned best_slider_length_
The best size for the slider part itself, if 0 ignored.
unsigned offset_before() const override
Inherited from scrollbar_base.
void signal_handler_sdl_key_down(const event::ui_event event, bool &handled, const SDL_Keycode key)
Signal handlers:
unsigned get_step_size() const
void set_maximum_value_label(const t_string &maximum_value_label)
int minimum_value_
The minimum value the slider holds.
virtual int get_minimum_value() const override
Inherited from integer_selector.
int on_bar(const point &coordinate) const override
Inherited from scrollbar_base.
void handle_key_increase(bool &handled)
std::function< t_string(int, int)> label_generator
virtual void set_value(int value) override
Inherited from integer_selector.
virtual point calculate_best_size() const override
See widget::calculate_best_size.
virtual int get_maximum_value() const override
Inherited from integer_selector.
void set_value_range(int min_value, int max_value)
virtual int get_value() const override
Inherited from integer_selector.
label_generator value_label_generator_
Function to output custom value labels for the slider.
int get_item_count() const
t_string get_value_label() const
Returns the label shown for the current value.
int positioner_length() const override
Inherited from scrollbar_base.
point current_item_mouse_position_
When initially pressing the positioner and every time a new value is chosen through dragging,...
virtual unsigned get_length() const override
Inherited from scrollbar_base.
int get_length_difference(const point &original, const point ¤t) const override
Inherited from scrollbar_base.
slider(const implementation::builder_slider &builder)
t_string minimum_value_label_
When the slider shows the minimum value can show a special text.
bool on_positioner(const point &coordinate) const override
Inherited from scrollbar_base.
void signal_handler_left_button_up(const event::ui_event event, bool &handled)
void set_minimum_value_label(const t_string &minimum_value_label)
virtual const std::string & get_control_type() const override
Inherited from styled_widget, implemented by REGISTER_WIDGET.
void set_value_labels(const label_generator &generator)
virtual void update_canvas() override
Inherited from scrollbar_base.
void set_value_labels(const std::vector< t_string > &value_labels)
unsigned offset_after() const override
Inherited from scrollbar_base.
void set_best_slider_length(const unsigned length)
ui_event
The event sent to the dispatcher.
Contains the implementation details for lexical_cast and shouldn't be used directly.
rng * generator
This generator is automatically synced during synced context.
map_location coordinate
Contains an x and y coordinate used for starting positions in maps.
builder_slider(const config &cfg)
virtual std::unique_ptr< widget > build() const override
unsigned best_slider_length_
std::vector< t_string > value_labels_
t_string maximum_value_label_
t_string minimum_value_label_
resolution(const config &cfg)
unsigned positioner_length
slider_definition(const config &cfg)