41 class slider_impl :
public widget<>
48 slider_impl(slider_orientation aOrientation = slider_orientation::Horizontal);
49 slider_impl(i_widget& aParent, slider_orientation aOrientation = slider_orientation::Horizontal);
50 slider_impl(i_layout& aLayout, slider_orientation aOrientation = slider_orientation::Horizontal);
53 void set_orientation(slider_orientation aOrientation,
bool aUpdateLayout =
true);
54 void set_bar_color(
const optional_color_or_gradient& aBarColor);
56 neogfx::size_policy size_policy()
const override;
57 size minimum_size(optional_size
const& aAvailableSpace = optional_size{})
const override;
59 void paint(i_graphics_context& aGc)
const override;
61 void mouse_button_pressed(mouse_button aButton,
const point& aPosition, key_modifiers_e aKeyModifiers)
override;
62 void mouse_button_double_clicked(mouse_button aButton,
const point& aPosition, key_modifiers_e aKeyModifiers)
override;
63 void mouse_button_released(mouse_button aButton,
const point& aPosition)
override;
64 bool mouse_wheel_scrolled(mouse_wheel aWheel,
const point& aPosition, delta aDelta, key_modifiers_e aKeyModifiers)
override;
65 void mouse_moved(
const point& aPosition, key_modifiers_e aKeyModifiers)
override;
67 virtual double normalized_step_value()
const = 0;
68 virtual double normalized_value()
const = 0;
69 virtual void set_normalized_value(
double aValue);
71 bool handling_event()
const;
75 rect indicator_box()
const;
76 double normalized_value_from_position(
const point& aPosition)
const;
77 point normalized_value_to_position(
double aValue)
const;
81 double iNormalizedValue;
87 class basic_slider :
public slider_impl
92 basic_slider(slider_orientation aOrientation = slider_orientation::Horizontal);
93 basic_slider(i_widget& aParent, slider_orientation aOrientation = slider_orientation::Horizontal);
94 basic_slider(i_layout& aLayout, slider_orientation aOrientation = slider_orientation::Horizontal);
96 value_type minimum()
const;
97 void set_minimum(value_type aMinimum);
98 value_type maximum()
const;
99 void set_maximum(value_type aMaximum);
100 value_type step()
const;
101 void set_step(value_type aStep);
102 value_type value()
const;
103 void set_value(value_type aValue);
105 virtual double normalized_step_value()
const;
106 virtual double normalized_value()
const;
107 virtual void set_normalized_value(
double aValue);
113 bool iSettingNormalizedValue;
116 extern template basic_slider<int8_t>;
117 extern template basic_slider<uint8_t>;
118 extern template basic_slider<int16_t>;
119 extern template basic_slider<uint16_t>;
120 extern template basic_slider<int32_t>;
121 extern template basic_slider<uint32_t>;
122 extern template basic_slider<int64_t>;
123 extern template basic_slider<uint64_t>;
124 extern template basic_slider<float>;
125 extern template basic_slider<double>;
127 typedef basic_slider<int32_t> slider;
128 typedef basic_slider<double> double_slider;
#define end_declare_enum(enumName)
#define declare_enum_string(enumName, enumEnumerator)
#define begin_declare_enum(enumName)
optional< point > optional_point
neolib::optional< color_or_gradient > optional_color_or_gradient
basic_point< coordinate > point
basic_size< coordinate > size
#define define_event(name, declName,...)