Class: MyRendererMultiline

Inherits:
Gtk::ScrolledWindow
  • Object
show all
Includes:
ManqodCommon
Defined in:
lib/FormHolder/Form/InputHolder/MultiLine.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

Eprint::DOMAIN, Eprint::LEVEL

Instance Attribute Summary collapse

Instance Method Summary collapse

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(pc) ⇒ MyRendererMultiline

Returns a new instance of MyRendererMultiline.



7
8
9
10
11
12
13
14
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 7

def initialize(pc)
	@pc=pc
	super(nil,nil)
	set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC)
	@tv=Gtk::TextView.new(@source_buffer = Gtk::TextBuffer.new)
	add(@tv)
	@tv.modify_font(Pango::FontDescription.new('Monospace 10'))
end

Instance Attribute Details

#pcObject

Returns the value of attribute pc.



16
17
18
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 16

def pc
  @pc
end

#tvObject

Returns the value of attribute tv.



15
16
17
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 15

def tv
  @tv
end

Instance Method Details

#editableObject



21
22
23
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 21

def editable
	@tv.editable
end

#inspectObject



55
56
57
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 55

def inspect
	"Multiline(#{item['description']})"
end

#itemObject



18
19
20
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 18

def item
	@pc.item
end

#modify_font(f) ⇒ Object



25
26
27
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 25

def modify_font(f)
	@tv.modify_font(f)
end

#parentMObject



52
53
54
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 52

def parentM
	@pc.parentM
end

#parentselectedObject



48
49
50
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 48

def parentselected
	@pc.parentselected
end

#set_sensitive(sens) ⇒ Object



33
34
35
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 33

def set_sensitive(sens)
	@tv.set_sensitive(sens)
end

#textObject



29
30
31
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 29

def text
	@tv.buffer.text
end

#to_sObject



58
59
60
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 58

def to_s
	inspect
end

#update(new_value) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/FormHolder/Form/InputHolder/MultiLine.rb', line 37

def update(new_value)
	run_events(item['id'],'form_item-BeforeUpdate')
	pc.run_query

	@source_buffer.delete(*@source_buffer.bounds)
	@source_buffer.insert(@source_buffer.get_iter_at_offset(0),"#{item['default']}")
	@tv.set_buffer(@source_buffer)
	edebug("#{self} updated to #{item['default']}","form","info")
	run_events(item['id'],'form_item-AfterUpdate')
end