2017-11-20 02:12:49 -08:00
|
|
|
class Elm.Spinner (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Focus.Composition,
|
2017-11-15 18:31:26 -08:00
|
|
|
Efl.Access.Value, Efl.Access.Widget.Action)
|
2014-03-26 06:12:34 -07:00
|
|
|
{
|
2016-11-24 02:50:22 -08:00
|
|
|
[[Elementary spinner class]]
|
2016-05-12 09:06:04 -07:00
|
|
|
legacy_prefix: elm_spinner;
|
2017-09-06 19:12:52 -07:00
|
|
|
eo_prefix: elm_obj_spinner;
|
2016-05-17 09:14:47 -07:00
|
|
|
event_prefix: elm_spinner;
|
2015-05-07 09:32:53 -07:00
|
|
|
methods {
|
|
|
|
@property wrap {
|
2015-08-10 06:17:49 -07:00
|
|
|
[[Control whether the spinner should wrap when it reaches its minimum or maximum value.
|
|
|
|
|
|
|
|
Disabled by default. If disabled, when the user tries to increment the
|
|
|
|
value,
|
|
|
|
but displayed value plus step value is bigger than maximum value,
|
|
|
|
the new value will be the maximum value.
|
|
|
|
The same happens when the user tries to decrement it,
|
|
|
|
but the value less step is less than minimum value. In this case,
|
|
|
|
the new displayed value will be the minimum value.
|
|
|
|
|
|
|
|
When wrap is enabled, when the user tries to increment the value,
|
|
|
|
but displayed value plus step value is bigger than maximum value,
|
|
|
|
the new value will be the minimum value. When the the user tries to
|
|
|
|
decrement it, but the value less step is less than minimum value,
|
|
|
|
the new displayed value will be the maximum value.
|
|
|
|
|
|
|
|
E.g.:
|
|
|
|
$min = 10
|
|
|
|
$max = 50
|
|
|
|
$step = 20
|
|
|
|
$displayed = 20
|
|
|
|
|
|
|
|
When the user decrement value (using left or bottom arrow), it will
|
|
|
|
displays $50.]]
|
2014-03-26 06:12:34 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-10 06:17:49 -07:00
|
|
|
wrap: bool; [[$true to enable wrap or $false to disable it.]]
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
}
|
2017-11-20 02:12:49 -08:00
|
|
|
@property interval {
|
|
|
|
[[Control the interval on time updates for an user mouse button hold on spinner widgets' arrows.
|
|
|
|
|
|
|
|
This interval value is decreased while the user holds the
|
|
|
|
mouse pointer either incrementing or decrementing spinner's value.
|
|
|
|
|
|
|
|
This helps the user to get to a given value distant from the
|
|
|
|
current one easier/faster, as it will start to change quicker and
|
|
|
|
quicker on mouse button holds.
|
|
|
|
|
|
|
|
The calculation for the next change interval value, starting from
|
|
|
|
the one set with this call, is the previous interval divided by
|
|
|
|
$1.05, so it decreases a little bit.
|
|
|
|
|
|
|
|
The default starting interval value for automatic changes is
|
|
|
|
$0.85 seconds.]]
|
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
|
|
|
interval: double; [[The (first) interval value in seconds.]]
|
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property round {
|
2015-08-10 06:17:49 -07:00
|
|
|
[[Control the round value for rounding
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Sets the rounding value used for value rounding in the spinner.]]
|
|
|
|
set {
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-10 06:17:49 -07:00
|
|
|
rnd: int; [[The rounding value]]
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property editable {
|
2015-08-10 06:17:49 -07:00
|
|
|
[[Control whether the spinner can be directly edited by the user or not.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Spinner objects can have edition disabled, in which state they will
|
|
|
|
be changed only by arrows.
|
|
|
|
Useful for contexts
|
|
|
|
where you don't want your users to interact with it writing the value.
|
|
|
|
Specially
|
|
|
|
when using special values, the user can see real value instead
|
|
|
|
of special label on edition.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
It's enabled by default.]]
|
|
|
|
set {
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-10 06:17:49 -07:00
|
|
|
editable: bool; [[$true to allow users to edit it or $false to don't allow users to edit it directly.]]
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property base {
|
2015-08-10 06:17:49 -07:00
|
|
|
[[Control the base for rounding
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Rounding works as follows:
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
rounded_val = base + (double)(((value - base) / round) * round)
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Where rounded_val, value and base are doubles, and round is an integer.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
This means that things will be rounded to increments (or decrements) of
|
|
|
|
"round" starting from value $base. The default base for rounding is 0.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Example: round = 3, base = 2
|
|
|
|
Values: ..., -2, 0, 2, 5, 8, 11, 14, ...
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Example: round = 2, base = 5.5
|
|
|
|
Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, 11.5, ...]]
|
|
|
|
set {
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-10 06:17:49 -07:00
|
|
|
base: double; [[The base value]]
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property label_format {
|
2015-08-10 06:17:49 -07:00
|
|
|
[[Control the format string of the displayed label.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
If $NULL, this sets the format to "%.0f". If not it sets the format
|
|
|
|
string for the label text. The label text is provided a floating point
|
|
|
|
value, so the label text can display up to 1 floating point value.
|
|
|
|
Note that this is optional.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Use a format string such as "%1.2f meters" for example, and it will
|
|
|
|
display values like: "3.14 meters" for a value equal to 3.14159.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Default is "%0.f".]]
|
|
|
|
set {
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2016-05-31 08:02:26 -07:00
|
|
|
fmt: string @nullable; [[The format string for the label display.]]
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
special_value_add {
|
2015-08-10 06:17:49 -07:00
|
|
|
[[Control special string to display in the place of the numerical value.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
It's useful for cases when a user should select an item that is
|
|
|
|
better indicated by a label than a value. For example, weekdays or months.
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2015-08-10 06:17:49 -07:00
|
|
|
Note: If another label was previously set to $value, it will be replaced
|
|
|
|
by the new label.]]
|
|
|
|
|
|
|
|
/* FIXME-doc
|
2014-03-26 06:12:34 -07:00
|
|
|
E.g.:
|
|
|
|
@code
|
|
|
|
sp = elm_spinner_add(win);
|
|
|
|
elm_spinner_min_max_set(sp, 1, 3);
|
|
|
|
elm_spinner_special_value_add(sp, 1, "January");
|
|
|
|
elm_spinner_special_value_add(sp, 2, "February");
|
|
|
|
elm_spinner_special_value_add(sp, 3, "March");
|
|
|
|
evas_object_show(sp);
|
|
|
|
@endcode
|
2015-08-10 06:17:49 -07:00
|
|
|
*/
|
2014-03-26 06:12:34 -07:00
|
|
|
params {
|
2015-08-10 06:17:49 -07:00
|
|
|
@in value: double; [[The value to be replaced.]]
|
2016-05-31 08:02:26 -07:00
|
|
|
@in label: string; [[The label to be used.]]
|
2015-08-10 06:17:49 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
implements {
|
2014-06-20 02:47:39 -07:00
|
|
|
class.constructor;
|
2016-08-10 07:23:04 -07:00
|
|
|
Efl.Object.constructor;
|
2015-04-22 04:33:10 -07:00
|
|
|
Elm.Widget.theme_apply;
|
2017-08-23 23:31:05 -07:00
|
|
|
Elm.Widget.on_access_update;
|
2017-08-30 23:20:33 -07:00
|
|
|
Elm.Widget.on_focus_update;
|
2017-01-01 23:48:17 -08:00
|
|
|
Elm.Widget.widget_event;
|
2017-11-20 02:12:49 -08:00
|
|
|
Efl.Ui.Range.range_min_max { get; set; }
|
|
|
|
Efl.Ui.Range.range_step { get; set; }
|
|
|
|
Efl.Ui.Range.range_value { get; set; }
|
2017-10-18 18:13:54 -07:00
|
|
|
Efl.Access.name { get; }
|
2017-09-11 23:36:24 -07:00
|
|
|
Efl.Access.Value.value_and_text { get; set; }
|
|
|
|
Efl.Access.Value.range { get; }
|
|
|
|
Efl.Access.Value.increment { get; }
|
2017-11-15 18:31:26 -08:00
|
|
|
Efl.Access.Widget.Action.elm_actions { get; }
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
events {
|
2016-11-24 02:50:22 -08:00
|
|
|
changed; [[Called when spinner changed]]
|
|
|
|
delay,changed; [[Called when spinner delay changed]]
|
|
|
|
spinner,drag,start; [[Called when spinner drag started]]
|
|
|
|
spinner,drag,stop; [[Called when spinner drag stopped]]
|
spinner: Add signal to notify the value of spinner has been reached at min, max.
Summary: The User requires this signal to handle spinner widget easily on their app.
Test Plan: Spinner test on elementary_test.
Reviewers: cedric, jpeg, Hermet, woohyun, Jaehyun, myoungwoon, Jaehyun_Cho
Reviewed By: myoungwoon, Jaehyun_Cho
Subscribers: myoungwoon, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4886
2017-05-23 21:31:14 -07:00
|
|
|
min,reached; [[Called when spinner value reached min]]
|
|
|
|
max,reached; [[Called when spinner value reached max]]
|
2014-03-26 06:12:34 -07:00
|
|
|
}
|
|
|
|
}
|