summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-05-31 11:18:24 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-20 17:03:09 +0200
commitff97b0ed3dec3e156c9400dba745660643557fd2 (patch)
treeb60fc1eb00d9a02785a2c3664aff616cf3c358df
parent89102ecbd3bb99c996d7b34fbbb55900686200bc (diff)
Efl.Ui.Radio: Update docs
Ref T7867 Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9061
-rw-r--r--src/lib/elementary/efl_ui_radio.eo38
-rw-r--r--src/lib/elementary/efl_ui_radio_box.eo8
-rw-r--r--src/lib/elementary/efl_ui_radio_group.eo46
-rw-r--r--src/lib/elementary/efl_ui_radio_group_impl.eo2
4 files changed, 63 insertions, 31 deletions
diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo
index bd7475775c..790d2237f6 100644
--- a/src/lib/elementary/efl_ui_radio.eo
+++ b/src/lib/elementary/efl_ui_radio.eo
@@ -1,22 +1,36 @@
1class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Action 1class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Action
2{ 2{
3 [[Elementary radio class]] 3 [[Elementary radio button class.
4
5 Radio buttons are like check boxes in that they can be either checked or unchecked.
6 However, radio buttons are always bunched together in groups, and only one button in
7 each group can be checked at any given time. Pressing a different button in the group
8 will automatically uncheck any previously checked button.
9
10 They are a common way to allow a user to select one option among a list.
11
12 To handle button grouping, you can either use an @Efl.Ui.Radio_Group object (obtained
13 through @.group_create) or use more convenient widgets like @Efl.Ui.Radio_Box.
14 ]]
4 methods { 15 methods {
5 @property state_value { 16 @property state_value {
6 set { 17 [[Integer value that this radio button represents.
7 [[Set the integer value that this radio object represents.
8 18
9 This sets the value of the radio. 19 Each radio button in a group must have a unique value. The selected button in a group
10 ]] 20 can then be set or retrieved through the @Efl.Ui.Radio_Group.selected_value property.
11 } 21 This value is also informed through the @[Efl.Ui.Radio_Group.value,changed] event.
12 get {
13 [[Get the integer value that this radio object represents.
14 22
15 This gets the value of the radio. 23 All non-negative values are legal but keep in mind that 0 is the starting value for all new groups:
16 ]] 24 If no button in the group has this value, then no button in the group is initially
17 } 25 selected. -1 is the value that @Efl.Ui.Radio_Group.selected_value returns when no button
26 is selected and therefore cannot be used.
27 ]]
28 set {}
29 get {}
18 values { 30 values {
19 value: int; [[The value to use if this radio object is selected.]] 31 value: int; [[The value to use when this radio button is selected.
32 Any value can be used but 0 and -1 have special meanings as described
33 above.]]
20 } 34 }
21 } 35 }
22 } 36 }
diff --git a/src/lib/elementary/efl_ui_radio_box.eo b/src/lib/elementary/efl_ui_radio_box.eo
index 07cfb81bbc..aa2d91c835 100644
--- a/src/lib/elementary/efl_ui_radio_box.eo
+++ b/src/lib/elementary/efl_ui_radio_box.eo
@@ -1,7 +1,11 @@
1class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box implements Efl.Ui.Radio_Group 1class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box implements Efl.Ui.Radio_Group
2{ 2{
3 methods { 3 [[A standard @Efl.Ui.Box container which automatically handles grouping of any @Efl.Ui.Radio
4 } 4 widget added to it.
5
6 All @Efl.Ui.Radio widgets are added to the same internal group which you only indirectly
7 access through this object.
8 ]]
5 implements { 9 implements {
6 Efl.Pack.pack_clear; 10 Efl.Pack.pack_clear;
7 Efl.Pack.unpack_all; 11 Efl.Pack.unpack_all;
diff --git a/src/lib/elementary/efl_ui_radio_group.eo b/src/lib/elementary/efl_ui_radio_group.eo
index c19636308c..34f0d7b907 100644
--- a/src/lib/elementary/efl_ui_radio_group.eo
+++ b/src/lib/elementary/efl_ui_radio_group.eo
@@ -1,50 +1,62 @@
1interface @beta Efl.Ui.Radio_Group 1interface @beta Efl.Ui.Radio_Group
2{ 2{
3 [[A object for organising a group of radio buttons 3 [[Interface for manually handling a group of @Efl.Ui.Radio buttons.
4 4
5 A group of radio buttons is a set of pair-wise different values. (Where values are the assosiated values of each radio button) 5 See the documentation of @Efl.Ui.Radio for an explanation of radio button grouping.
6 At any point of time only 1 or 0 buttons can be selected. If a new button is selected, the previous selected button will be unselected.
7 ]] 6 ]]
8 methods { 7 methods {
9 @property selected_object { 8 @property selected_object {
10 [[Which object is currently selected in the group 9 [[Currently selected button in a radio button group, or $NULL if no button is selected.
11 10
12 $NULL if no object is selected. 11 See also @.selected_value.
13 ]] 12 ]]
14 values { 13 values {
15 selected_object : Efl.Ui.Radio; [[The selected radio button in the group, $NULL for no object]] 14 selected_object : Efl.Ui.Radio; [[The currently selected radio button in the group, or $NULL.]]
16 } 15 }
17 } 16 }
18 @property selected_value { 17 @property selected_value {
19 [[Each group has a selected value, representing which radio group is selected. 18 [[The value associated with the currently selected button in the group.
19 Give each radio button in the group a different value using @Efl.Ui.Radio.state_value.
20 20
21 A value of -1 here does represent that no button is selected. 21 A value of -1 means that no button is selected.
22 Possible values here are only those that are assisiated with a registered radio button. 22 Only values associated with the buttons in the group (and -1) can be used.
23 ]] 23 ]]
24 values { 24 values {
25 selected_value : int; [[The value of the selection state]] 25 selected_value : int; [[The value of the currently selected radio button, or -1.]]
26 } 26 }
27 } 27 }
28 register { 28 register {
29 [[Register a new radio button to this group. 29 [[Register a new @Efl.Ui.Radio button to this group.
30 Keep in mind that registering to a group will only handle button grouping, you still
31 need to add the button to a layout for it to be rendered.
30 32
31 The assosiated value of the radio button must not collide with any other assosiated value of registered buttons. 33 If the @Efl.Ui.Radio.state_value of the new button is already used by a previous
34 button in the group, the button will not be added.
35
36 See also @.unregister.
32 ]] 37 ]]
33 params { 38 params {
34 radio : Efl.Ui.Radio; [[The radio button to regsiter]] 39 radio : Efl.Ui.Radio; [[The radio button to add to the group.]]
35 } 40 }
36 } 41 }
37 unregister { 42 unregister {
38 [[Unregsiter a before registered button from this group. 43 [[Unregister an @Efl.Ui.Radio button from this group.
44 This will unlink the behavior of this button from the other buttons in the group,
45 but if it still belongs to a layout, it will still be rendered.
46
47 If the button was not registered in the group the call is ignored.
48 If the button was selected, no button will be selected in the group after this call.
39 49
40 if the button was selected before, no object will be selected afterwards. 50 See also @.register.
41 ]] 51 ]]
42 params { 52 params {
43 radio : Efl.Ui.Radio; [[The radio button to unregister]] 53 radio : Efl.Ui.Radio; [[The radio button to remove from the group.]]
44 } 54 }
45 } 55 }
46 } 56 }
47 events { 57 events {
48 value,changed : int; [[Emitted each time the $selected_value has changed.]] 58 value,changed : int; [[Emitted each time the $selected_value changes. The event information
59 contains the @Efl.Ui.Radio.state_value of the newly selected button or
60 -1 if no button is now selected.]]
49 } 61 }
50} 62}
diff --git a/src/lib/elementary/efl_ui_radio_group_impl.eo b/src/lib/elementary/efl_ui_radio_group_impl.eo
index 82204cf386..bc41093526 100644
--- a/src/lib/elementary/efl_ui_radio_group_impl.eo
+++ b/src/lib/elementary/efl_ui_radio_group_impl.eo
@@ -1,5 +1,7 @@
1class @beta Efl.Ui.Radio_Group_Impl extends Efl.Object implements Efl.Ui.Radio_Group 1class @beta Efl.Ui.Radio_Group_Impl extends Efl.Object implements Efl.Ui.Radio_Group
2{ 2{
3 [[Object with the default implementation for @Efl.Ui.Radio_Group.
4 ]]
3 implements { 5 implements {
4 class.constructor; 6 class.constructor;
5 Efl.Object.destructor; 7 Efl.Object.destructor;