class MyRendererToggle

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)

Attributes

pc[RW]

Public Class Methods

new(pc) click to toggle source
Calls superclass method
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 7
def initialize(pc)
        @pc=pc
        super(pc.item['description'],false)
        signal_connect('toggled'){
                run_events(pc.item['id'],'form_item-Action')
        }
end

Public Instance Methods

inspect() click to toggle source
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 37
def inspect
        "ToggleButton(#{item['description']})"
end
item() click to toggle source
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 31
def item
      @pc.item
end
method_missing(sym,*args) click to toggle source
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 34
def method_missing(sym,*args)
        text
end
parentM() click to toggle source
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 28
def parentM
        pc.parentM
end
text() click to toggle source
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 25
def text
        self.active?.to_s
end
to_s() click to toggle source
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 40
def to_s
        inspect
end
update(new_value=pc.item['default']) click to toggle source
# File lib/FormHolder/Form/InputHolder/Toggle.rb, line 16
        def update(new_value=pc.item['default'])
                run_events(pc.item['id'],'form_item-BeforeUpdate')
                item['default']=new_value
                pc.run_query
#       set_inconsistent(pc.item['editable']!="true")
#               set_sensitive(pc.item['editable']=="true")
                set_active(pc.item['default']=="true")
                run_events(pc.item['id'],'form_item-AfterUpdate')
        end