Class: RubyCurses::TableColumn

Inherits:
Object
  • Object
show all
Includes:
EventHandler
Defined in:
lib/rbcurse/rtable.rb

Overview

XXX Seems we are not using min_width and max_width. min should be used for when resizing,, max should not be used. we are using width which is updated as changed

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from EventHandler

#bind, #fire_handler

Constructor Details

#initialize(model_index, identifier, header_value, width, config = {}, &block) ⇒ TableColumn

width is used as initial and preferred width. It has actual value at any time width must never be directly set, use preferred width later



1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
# File 'lib/rbcurse/rtable.rb', line 1204

def initialize model_index, identifier, header_value, width, config={}, &block
  @width = width
  @preferred_width = width
  @min_width = 4
  @max_width = 1000
  @model_index = model_index
  @identifier = identifier
  @header_value = header_value
  @config={}
  instance_eval &block if block_given?
end

Instance Attribute Details

#cell_editorObject

Returns the value of attribute cell_editor.



1198
1199
1200
# File 'lib/rbcurse/rtable.rb', line 1198

def cell_editor
  @cell_editor
end

#cell_rendererObject

Returns the value of attribute cell_renderer.



1183
1184
1185
# File 'lib/rbcurse/rtable.rb', line 1183

def cell_renderer
  @cell_renderer
end

#column_offsetObject

added column_offset on 2009-01-12 19:01



1197
1198
1199
# File 'lib/rbcurse/rtable.rb', line 1197

def column_offset
  @column_offset
end

#header_rendererObject

user may override or set for this column, else headers default will be used



1186
1187
1188
# File 'lib/rbcurse/rtable.rb', line 1186

def header_renderer
  @header_renderer
end

#identifierObject (readonly)

Returns the value of attribute identifier.



1181
1182
1183
# File 'lib/rbcurse/rtable.rb', line 1181

def identifier
  @identifier
end

#is_resizableObject

Returns the value of attribute is_resizable.



1182
1183
1184
# File 'lib/rbcurse/rtable.rb', line 1182

def is_resizable
  @is_resizable
end

#max_widthObject

Returns the value of attribute max_width.



1182
1183
1184
# File 'lib/rbcurse/rtable.rb', line 1182

def max_width
  @max_width
end

#min_widthObject

Returns the value of attribute min_width.



1182
1183
1184
# File 'lib/rbcurse/rtable.rb', line 1182

def min_width
  @min_width
end

#model_indexObject

index inside TableModel



1184
1185
1186
# File 'lib/rbcurse/rtable.rb', line 1184

def model_index
  @model_index
end

Instance Method Details

#fire_property_change(text, oldval, newval) ⇒ Object



1215
1216
1217
1218
1219
# File 'lib/rbcurse/rtable.rb', line 1215

def fire_property_change(text, oldval, newval)
  #$log.debug "TC: def fire_property_change(#{text}, #{oldval}, #{newval})"
  # need to send changeevent FIXME XXX maybe dsl_prop should do this.
  fire_handler :PROPERTY_CHANGE, self
end