Class: CWM::RadioButtons
- Inherits:
-
AbstractWidget
- Object
- AbstractWidget
- CWM::RadioButtons
- Includes:
- ItemsSelection
- Defined in:
- library/cwm/src/lib/cwm/common_widgets.rb
Overview
if radio buttons are modified during runtime, like with #change_items then handle won't work correctly unless handle_all_events specified
A selection of a value via radio buttons. The AbstractWidget#label method is mandatory.
Instance Attribute Summary
Attributes inherited from AbstractWidget
#handle_all_events, #widget_id
Instance Method Summary collapse
-
#cwm_definition ⇒ WidgetHash
See AbstractWidget#cwm_definition In addition to the base definition, this honors possible
vspacing
andhspacing
methods. -
#hspacing ⇒ Fixnum
Margin at both sides of the options list.
-
#value ⇒ Object
Get widget value.
-
#value=(val) ⇒ Object
Set widget value.
-
#vspacing ⇒ Fixnum
Space between the options.
Methods included from ItemsSelection
Methods inherited from AbstractWidget
#cleanup, #disable, #displayed?, #enable, #enabled?, #focus, #fun_ref, #handle, #help, #init, #label, #my_event?, #opt, #refresh_help, #store, #validate, widget_type=
Instance Method Details
#cwm_definition ⇒ WidgetHash
See AbstractWidget#cwm_definition
In addition to the base definition, this honors possible
vspacing
and hspacing
methods
345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 345 def cwm_definition additional = {} additional["vspacing"] = vspacing if respond_to?(:vspacing) additional["hspacing"] = hspacing if respond_to?(:hspacing) # handle_events are by default widget_id, but in radio buttons, events are # in fact single RadioButton if !handle_all_events event_ids = items.map(&:first) additional["handle_events"] = event_ids end super.merge(additional) end |
#hspacing ⇒ Fixnum
Returns margin at both sides of the options list.
|
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 311
|
#value ⇒ Object
Get widget value
Calling this method only make sense when the widget is displayed (see #displayed?).
318 319 320 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 318 def value Yast::UI.QueryWidget(Id(), :CurrentButton) end |
#value=(val) ⇒ Object
Set widget value
Calling this method only make sense when the widget is displayed (see #displayed?).
327 328 329 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 327 def value=(val) Yast::UI.ChangeWidget(Id(), :CurrentButton, val) end |
#vspacing ⇒ Fixnum
Returns space between the options.
|
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 308
|