Class: TT::GUI::Checkbox
Overview
Instance Attribute Summary collapse
Attributes inherited from Control
#bottom, #font_bold, #font_italic, #font_name, #font_size, #height, #left, #name, #parent, #right, #tooltip, #top, #ui_id, #width, #window
Instance Method Summary
collapse
Methods inherited from Control
#add_event_handler, #call_event, #disabled=, #disabled?, #enabled=, #enabled?, events, has_event?, #inspect, #move, #position, #positioned?, #properties, #release!, #size
included
Constructor Details
#initialize(label, checked = false) ⇒ Checkbox
Returns a new instance of Checkbox
616
617
618
619
620
|
# File 'TT_Lib2/gui.rb', line 616
def initialize( label, checked = false )
super
@label = label
@checked = checked
end
|
Instance Attribute Details
#label ⇒ Object
607
608
609
|
# File 'TT_Lib2/gui.rb', line 607
def label
@label
end
|
Instance Method Details
#check! ⇒ Boolean
624
625
626
|
# File 'TT_Lib2/gui.rb', line 624
def check!
checked = true
end
|
#checked ⇒ Boolean
Also known as:
checked?
642
643
644
|
# File 'TT_Lib2/gui.rb', line 642
def checked
@checked = self.window.get_checkbox_state( self.ui_id )
end
|
#checked=(value) ⇒ Boolean
651
652
653
654
655
|
# File 'TT_Lib2/gui.rb', line 651
def checked=( value )
@checked = value
update_html_element( { :checked => value } )
value
end
|
#custom_properties ⇒ TT::JSON
669
670
671
672
673
674
|
# File 'TT_Lib2/gui.rb', line 669
def custom_properties
prop = TT::JSON.new
prop['label'] = @label
prop['checked'] = @checked
prop
end
|
#toggle! ⇒ Boolean
636
637
638
|
# File 'TT_Lib2/gui.rb', line 636
def toggle!
checked = !checked
end
|
#uncheck! ⇒ Boolean
630
631
632
|
# File 'TT_Lib2/gui.rb', line 630
def uncheck!
checked = false
end
|