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.
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 114 115 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 86 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.
118 119 120 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 118 def form @form end |
#list ⇒ Object
Returns the value of attribute list.
117 118 119 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 117 def list @list end |
#model ⇒ Object
Returns the value of attribute model.
117 118 119 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 117 def model @model end |
#pc ⇒ Object
signal_connect(‘key-press-event’){|me,key| list.model.update_filter(me,key)}
116 117 118 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 116 def pc @pc end |
#scroller ⇒ Object
signal_connect(‘key-press-event’){|me,key| list.model.update_filter(me,key)}
116 117 118 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 116 def scroller @scroller end |
Instance Method Details
#item ⇒ Object
120 121 122 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 120 def item pc.item end |
#parentM ⇒ Object
124 125 126 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 124 def parentM pc.parentM end |
#parentselected ⇒ Object
146 147 148 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 146 def parentselected pc.parentselected end |
#qrow ⇒ Object
168 169 170 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 168 def qrow parentM.qrow end |
#query ⇒ Object
164 165 166 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 164 def query parentM.query end |
#set_label(label) ⇒ Object
150 151 152 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 150 def set_label(label) pc.set_label(label) end |
#set_model(model) ⇒ Object
update
142 143 144 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 142 def set_model(model) list.set_model(model) end |
#set_selected(id_to_select) ⇒ Object
132 133 134 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 132 def set_selected(id_to_select) list.set_selected(id_to_select) end |
#set_sensitive(sens) ⇒ Object
158 159 160 161 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 158 def set_sensitive(sens) @list.set_sensitive(sens) self end |
#target ⇒ Object
154 155 156 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 154 def target pc.target end |
#text ⇒ Object
128 129 130 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 128 def text list.selection.selected[0] if !list.selection.selected.nil? end |
#to_s ⇒ Object
172 173 174 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 172 def to_s "List: (#{item['description']})" end |
#update(id_to_select = item['default']) ⇒ Object
136 137 138 139 140 |
# File 'lib/FormHolder/Form/InputHolder/List.rb', line 136 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 |