Class: MyRendererList
- Inherits:
-
Gtk::VBox
- Object
- Gtk::VBox
- MyRendererList
- Includes:
- ManqodCommon, Observable
- Defined in:
- lib/FormHolder/Form/InputHolder/List.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])
Direct Known Subclasses
Defined Under Namespace
Classes: List, ListButton
Constant Summary
Constants included from ManqodCommon
ManqodCommon::CRITICAL, ManqodCommon::DEBUG, ManqodCommon::ERROR, ManqodCommon::INFO, ManqodCommon::NORMAL, ManqodCommon::WARNING
Constants included from Eprint
Instance Attribute Summary collapse
-
#form ⇒ Object
Returns the value of attribute form.
-
#list ⇒ Object
Returns the value of attribute list.
-
#model ⇒ Object
Returns the value of attribute model.
-
#pc ⇒ Object
signal_connect(‘key-press-event’){|me,key| list.model.update_filter(me,key)}.
-
#scroller ⇒ Object
signal_connect(‘key-press-event’){|me,key| list.model.update_filter(me,key)}.
Instance Method Summary collapse
-
#initialize(pc) ⇒ MyRendererList
constructor
A new instance of MyRendererList.
- #item ⇒ Object
- #parentM ⇒ Object
- #parentselected ⇒ Object
- #qrow ⇒ Object
- #query ⇒ Object
- #set_label(label) ⇒ Object
-
#set_model(model) ⇒ Object
update.
- #set_selected(id_to_select) ⇒ Object
- #set_sensitive(sens) ⇒ Object
- #target ⇒ Object
- #text ⇒ Object
- #to_s ⇒ Object
- #update(id_to_select = item['default']) ⇒ Object
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, #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(pc) ⇒ MyRendererList
Returns a new instance of MyRendererList.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 84 def initialize(pc) @pc=pc @list=List.new(self) @scroller=Gtk::ScrolledWindow.new =Gtk::HButtonBox.new.set_layout_style(Gtk::ButtonBox::END) super() pack_start(scroller) pack_start(,false,false) unless target.to_i == -1 =ListButton.new pc.add_observer() .signal_connect('clicked') do |c| @form=Myform::MyFormHolder.new("dialog",self,@pc.target_runmode,target) @form.set_parentM(parentM) ret=form.run(text.to_i) list.update(ret) if ret and ret>0 end .pack_start() scroller.(Gtk::POLICY_AUTOMATIC).add(list) list.set_model(@model=MyRendererModel.new(list)) list.selection.signal_connect('changed'){|me| if me.selected then edebug("#{self} selection changed by user: #{pc.default} -> #{me.selected[0]}. emiting signal","list-list","debug") pc.changed pc.notify_observers(pc) run_events(item['id'],'form_item-Action') end } # signal_connect('key-press-event'){|me,key| list.model.update_filter(me,key)} end |
Instance Attribute Details
#form ⇒ Object
Returns the value of attribute form.
116 117 118 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 116 def form @form end |
#list ⇒ Object
Returns the value of attribute list.
115 116 117 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 115 def list @list end |
#model ⇒ Object
Returns the value of attribute model.
115 116 117 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 115 def model @model end |
#pc ⇒ Object
signal_connect(‘key-press-event’){|me,key| list.model.update_filter(me,key)}
114 115 116 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 114 def pc @pc end |
#scroller ⇒ Object
signal_connect(‘key-press-event’){|me,key| list.model.update_filter(me,key)}
114 115 116 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 114 def scroller @scroller end |
Instance Method Details
#item ⇒ Object
118 119 120 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 118 def item pc.item end |
#parentM ⇒ Object
122 123 124 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 122 def parentM pc.parentM end |
#parentselected ⇒ Object
144 145 146 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 144 def parentselected pc.parentselected end |
#qrow ⇒ Object
166 167 168 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 166 def qrow parentM.qrow end |
#query ⇒ Object
162 163 164 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 162 def query parentM.query end |
#set_label(label) ⇒ Object
148 149 150 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 148 def set_label(label) pc.set_label(label) end |
#set_model(model) ⇒ Object
update
140 141 142 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 140 def set_model(model) list.set_model(model) end |
#set_selected(id_to_select) ⇒ Object
130 131 132 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 130 def set_selected(id_to_select) list.set_selected(id_to_select) end |
#set_sensitive(sens) ⇒ Object
156 157 158 159 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 156 def set_sensitive(sens) @list.set_sensitive(sens) self end |
#target ⇒ Object
152 153 154 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 152 def target pc.target end |
#text ⇒ Object
126 127 128 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 126 def text list.selection.selected[0] if !list.selection.selected.nil? end |
#to_s ⇒ Object
170 171 172 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 170 def to_s "List: (#{item['description']})" end |
#update(id_to_select = item['default']) ⇒ Object
134 135 136 137 138 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 134 def update(id_to_select=item['default']) run_events(item['id'],'form_item-BeforeUpdate') list.update(id_to_select) run_events(item['id'],'form_item-AfterUpdate') end |