Class: MyFRenderer

Inherits:
Gtk::EventBox
  • Object
show all
Includes:
Conf
Defined in:
lib/ListHolder/ListPanel/ListFilter/FRenderer.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])

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Conf

#get_conf, #load_conf, #save_conf, #set_conf

Constructor Details

#initialize(list, column) ⇒ MyFRenderer

Returns a new instance of MyFRenderer.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 8

def initialize(list,column)
	@column=column
  @header=column.header
  @list=list
  @defval=defval
  super()
	case @header['type']
	  when 'gtk_text' then @renderer=MyFRendererText.new(self,@header)
	  when 'gtk_toggle' then @renderer=MyFRendererToggle.new(self,@header)
	  when 'gtk_const_combo' then
			@header['admin']=true
			@header['querySQL']="select * from scv where combo='"+@header['data']+"' order by cdisplay"
			@header['wantnew']=true
			@renderer=MyFRendererCombo.new(self,@header)
	  when 'gtk_combo' then 
			@header['wantnew']=true
			@renderer=MyFRendererCombo.new(self,@header)
	  else
			@renderer=MyFRendererText.new(self,@header)
	end

  add(renderer)
  @last_width=width_request
end

Instance Attribute Details

#defvalObject

Returns the value of attribute defval.



34
35
36
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 34

def defval
  @defval
end

#headerObject

Returns the value of attribute header.



32
33
34
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 32

def header
  @header
end

#listObject

Returns the value of attribute list.



33
34
35
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 33

def list
  @list
end

#rendererObject

Returns the value of attribute renderer.



35
36
37
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 35

def renderer
  @renderer
end

Instance Method Details

#get_list_idObject



51
52
53
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 51

def get_list_id
  list.get_id
end

#set_height_request(h) ⇒ Object



54
55
56
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 54

def set_height_request(h)
  renderer.set_height_request(h)
end

#set_width_request(new_width) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 41

def set_width_request(new_width)
	if width_request != new_width and @last_width != new_width
		@last_width=width_request
		renderer.set_width_request(new_width)
	end
	self
end

#update(newtext = "") ⇒ Object



38
39
40
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 38

def update(newtext="")
	renderer.update(newtext) if renderer
end

#width_requestObject



48
49
50
# File 'lib/ListHolder/ListPanel/ListFilter/FRenderer.rb', line 48

def width_request
  renderer.width_request
end