Class: MyFRendererToggle
- Inherits:
-
Gtk::Alignment
- Object
- Gtk::Alignment
- MyFRendererToggle
- Includes:
- Conf, ManqodCommon
- Defined in:
- lib/ListHolder/ListPanel/ListFilter/FRenderer/Toggle.rb
Overview
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])
Constant Summary
Constants included from ManqodCommon
ManqodCommon::CRITICAL, ManqodCommon::DEBUG, ManqodCommon::ERROR, ManqodCommon::INFO, ManqodCommon::NORMAL, ManqodCommon::WARNING
Constants included from Eprint
Instance Method Summary collapse
-
#initialize(caller, header) ⇒ MyFRendererToggle
constructor
A new instance of MyFRendererToggle.
- #update(newvalue = @filter) ⇒ Object
Methods included from Conf
#get_conf, #load_conf, #save_conf, #set_conf
Methods included from ManqodCommon
#add_where, #admin, #admin_cache, #admin_qrow, #admin_rows, #backtrace_to_debug, #cache, #changed_ids_of_base, #client, #client_fields, #client_image_of_id, #client_qrow, #client_query, #client_rows, #eeval, #escape_string, #getBinding, #guess_base, #guess_table, #image_of_id, #lzero, #manqod_db, #measure, #myexec, #nick, #nick_id, #number_format, #qrow, #query, #reconnect_manqod_db, #rows, #run_events, #send_message, #sendmail, #set_manqod_db_uri, #set_nick
Methods included from Eprint
#ecode, #edebug, #eerror, #einfo, #enormal, #eprint, #ewarn, #gtk_set_edebug, #set_edebug, #tell_exception
Constructor Details
#initialize(caller, header) ⇒ MyFRendererToggle
Returns a new instance of MyFRendererToggle.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer/Toggle.rb', line 8 def initialize(caller,header) @caller=caller @header=header @filter=get_conf(caller.list.get_id,header["id"],"filter") || "" @renderer=Gtk::CheckButton.new super(@header['align'].to_f,0.5,0,0) add(@renderer) case @filter when "=true" then @renderer.set_active(true).set_inconsistent(false); when "=false" then @renderer.set_active(false).set_inconsistent(false); else @renderer.set_active(false).set_inconsistent(true); end @renderer.signal_connect("released"){|me| if @filter=="" then @filter="=true" else if @filter=="=true" then @filter="=false" else @filter="" end end case @filter when "=true" then @renderer.set_active(true).set_inconsistent(false); when "=false" then @renderer.set_active(false).set_inconsistent(false); else @renderer.set_active(false).set_inconsistent(true); end edebug("active: #{@renderer.active?},inconsistent: #{@renderer.inconsistent?}|#{@filter}|","filter-toggle") set_conf(caller.list.get_id,header['id'],"filter",@filter) @caller.list.refilter } end |
Instance Method Details
#update(newvalue = @filter) ⇒ Object
36 37 38 39 |
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer/Toggle.rb', line 36 def update(newvalue=@filter) einfo("updated"+newvalue.to_s,"filter-toggle") @filter=newvalue end |