Class: SKUI::Checkbox
Overview
Instance Attribute Summary
Attributes inherited from Control
#rect
Attributes inherited from Base
#properties, #window
Instance Method Summary
collapse
Methods inherited from Control
#enabled, #left, #name, #position, #release, #size, #stretch, #tab_index, #tooltip, #visible, #width, #z_index
Methods inherited from Base
#background_color, #font, #foreground_color, #inspect, #parent, #release, #to_js, #typename, #ui_id
Methods included from Events
#add_event_handler, included, #release_events, #trigger_event
Constructor Details
#initialize(label, checked = false) ⇒ Checkbox
Returns a new instance of Checkbox.
25
26
27
28
29
|
# File 'src/SKUI/checkbox.rb', line 25
def initialize( label, checked = false )
super()
@properties[ :label ] = label
@properties[ :checked ] = checked
end
|
Instance Method Details
#check ⇒ Boolean
33
34
35
|
# File 'src/SKUI/checkbox.rb', line 33
def check
self.checked = true
end
|
#checked ⇒ Boolean
15
|
# File 'src/SKUI/checkbox.rb', line 15
prop_writer( :checked, &TypeCheck::BOOLEAN )
|
#checked? ⇒ Boolean
39
40
41
|
# File 'src/SKUI/checkbox.rb', line 39
def checked?
self.checked = window.bridge.get_checkbox_state( ui_id )
end
|
#label ⇒ String
11
|
# File 'src/SKUI/checkbox.rb', line 11
prop( :label, &TypeCheck::STRING )
|
#toggle ⇒ Boolean
45
46
47
|
# File 'src/SKUI/checkbox.rb', line 45
def toggle
self.checked = !checked?
end
|
#uncheck ⇒ Boolean
51
52
53
|
# File 'src/SKUI/checkbox.rb', line 51
def uncheck
self.checked = false
end
|