Method: CDK::MATRIX#highlightCell

Defined in:
lib/cdk/matrix.rb

#highlightCellObject

Highlight the new field.



622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/cdk/matrix.rb', line 622

def highlightCell
  disptype = @colvalues[@col]
  highlight = @highlight
  infolen = @info[@row][@col].size
  
  # Given the dominance of the color/attributes, we need to set the
  # current cell attribute.
  if @dominant == CDK::ROW
    highlight = (@rowtitle[@crow][0] || 0) & Ncurses::A_ATTRIBUTES
  elsif @dominant == CDK::COL
    highlight = (@coltitle[@ccol][0] || 0) & Ncurses::A_ATTRIBUTES
  end

  # If the column is only one char.
  (1..@colwidths[@ccol]).each do |x|
    ch = if x <= infolen && !Display.isHiddenDisplayType(disptype)
         then CDK.CharOf(@info[@row][@col][x - 1])
         else @filler
         end
    self.CurMatrixCell.mvwaddch(1, x, ch.ord | highlight)
  end
  self.CurMatrixCell.wmove(1, infolen + 1)
  self.CurMatrixCell.wrefresh
end