Class: CWM::CheckBox
- Inherits:
-
AbstractWidget
- Object
- AbstractWidget
- CWM::CheckBox
- Includes:
- ValueBasedWidget
- Defined in:
- library/cwm/src/lib/cwm/common_widgets.rb
Overview
A CheckBox widget. The AbstractWidget#label method is mandatory.
Instance Attribute Summary
Attributes inherited from AbstractWidget
#handle_all_events, #widget_id
Instance Method Summary collapse
-
#check ⇒ void
Checks the box.
-
#checked? ⇒ Boolean
True if the box is checked.
-
#uncheck ⇒ void
Unchecks the box.
-
#unchecked? ⇒ Boolean
True if the box is unchecked.
Methods included from ValueBasedWidget
Methods inherited from AbstractWidget
#cleanup, #cwm_definition, #disable, #displayed?, #enable, #enabled?, #focus, #fun_ref, #handle, #help, #init, #label, #my_event?, #opt, #refresh_help, #store, #validate, widget_type=
Instance Method Details
#check ⇒ void
This method returns an undefined value.
Checks the box
149 150 151 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 149 def check self.value = true end |
#checked? ⇒ Boolean
Returns true if the box is checked.
136 137 138 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 136 def checked? value == true end |
#uncheck ⇒ void
This method returns an undefined value.
Unchecks the box
155 156 157 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 155 def uncheck self.value = false end |
#unchecked? ⇒ Boolean
Returns true if the box is unchecked.
141 142 143 144 145 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 141 def unchecked? # explicit check as the value can be also nil, # which is shown as a grayed-out box, with "indeterminate" meaning value == false end |