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



1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
# File 'lib/rbcurse/rtable.rb', line 1291

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?
  @_events = [:PROPERTY_CHANGE]
end

Instance Attribute Details

#cell_editorObject

Returns the value of attribute cell_editor.



1285
1286
1287
# File 'lib/rbcurse/rtable.rb', line 1285

def cell_editor
  @cell_editor
end

#cell_rendererObject

Returns the value of attribute cell_renderer.



1270
1271
1272
# File 'lib/rbcurse/rtable.rb', line 1270

def cell_renderer
  @cell_renderer
end

#column_offsetObject

added column_offset on 2009-01-12 19:01



1284
1285
1286
# File 'lib/rbcurse/rtable.rb', line 1284

def column_offset
  @column_offset
end

#header_rendererObject

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



1273
1274
1275
# File 'lib/rbcurse/rtable.rb', line 1273

def header_renderer
  @header_renderer
end

#identifierObject (readonly)

Returns the value of attribute identifier.



1268
1269
1270
# File 'lib/rbcurse/rtable.rb', line 1268

def identifier
  @identifier
end

#is_resizableObject

Returns the value of attribute is_resizable.



1269
1270
1271
# File 'lib/rbcurse/rtable.rb', line 1269

def is_resizable
  @is_resizable
end

#max_widthObject

Returns the value of attribute max_width.



1269
1270
1271
# File 'lib/rbcurse/rtable.rb', line 1269

def max_width
  @max_width
end

#min_widthObject

Returns the value of attribute min_width.



1269
1270
1271
# File 'lib/rbcurse/rtable.rb', line 1269

def min_width
  @min_width
end

#model_indexObject

index inside TableModel



1271
1272
1273
# File 'lib/rbcurse/rtable.rb', line 1271

def model_index
  @model_index
end

Instance Method Details

#fire_property_change(text, oldval, newval) ⇒ Object



1303
1304
1305
1306
1307
# File 'lib/rbcurse/rtable.rb', line 1303

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