Class: RubyCurses::DirectoryListCellRenderer
- Inherits:
-
ListCellRenderer
- Object
- ListCellRenderer
- RubyCurses::DirectoryListCellRenderer
- Defined in:
- lib/rbcurse/extras/directorylist.rb
Instance Method Summary collapse
-
#repaint(graphic, r = @row, c = @col, row_index = -1,, value = @text, focussed = false, selected = false) ⇒ Object
paint a list box cell 2010-09-02 15:38 changed focussed to take true, false and :SOFT_FOCUS SOFT_FOCUS means the form focus is no longer on this field, but this row was focussed when use was last on this field.
Methods inherited from ListCellRenderer
#create_color_pairs, #getvalue, #init_vars, #initialize, #prepare_default_colors, #select_colors
Methods included from Utils
#_process_key, #bind_key, #clean_string!, #get_color, #keycode_tos, #repeatm, #view, #wrap_text
Methods included from ConfigSetup
#cget, #config_setup, #configure, #variable_set
Constructor Details
This class inherits a constructor from RubyCurses::ListCellRenderer
Instance Method Details
#repaint(graphic, r = @row, c = @col, row_index = -1,, value = @text, focussed = false, selected = false) ⇒ Object
paint a list box cell
2010-09-02 15:38 changed focussed to take true, false and :SOFT_FOCUS
SOFT_FOCUS means the form focus is no longer on this field, but this row
was focussed when use was last on this field. This row will take focus
when field is focussed again
@param [Buffer] window or buffer object used for printing
@param [Fixnum] row
@param [Fixnum] column
@param [Fixnum] actual index into data, some lists may have actual data elsewhere and
display data separate. e.g. rfe_renderer (directory listing)
@param [String] text to print in cell
@param [Boolean, :SOFT_FOCUS] cell focussed, not focussed, cell focussed but field is not focussed
@param [Boolean] cell selected or not
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/rbcurse/extras/directorylist.rb', line 445 def repaint graphic, r=@row,c=@col, row_index=-1,value=@text, focussed=false, selected=false prepare_default_colors focussed, selected if row_index == 0 #nvalue = " %s %8s %19s %s %s " % value.split(",") graphic.printstring r, c, "%-s" % value, @color_pair,@attr else $log.debug " CELL XXX GTETING #{row_index} ,#{value}" # ensure we do not exceed if !@display_length.nil? if value.length > @display_length value = value[0..@display_length-1] end end len = @display_length || value.length graphic.printstring r, c, "%-*s" % [len, value], @color_pair,@attr end end |