Method: RubyCurses::TextView#set_form_col

Defined in:
lib/rbcurse/core/widgets/rtextview.rb

#set_form_col(col1 = @curpos) ⇒ Object

set cursor on correct column tview



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File 'lib/rbcurse/core/widgets/rtextview.rb', line 374

def set_form_col col1=@curpos #:nodoc:
  @cols_panned ||= 0
  @pad_offset ||= 0 # added 2010-02-11 21:54 since padded widgets get an offset.
  @curpos = col1
  maxlen = @maxlen || @width-@internal_width
  #@curpos = maxlen if @curpos > maxlen
  if @curpos > maxlen
    @pcol = @curpos - maxlen
    @curpos = maxlen - 1
    @repaint_required = true # this is required so C-e can pan screen
  else
    @pcol = 0
  end
  # the rest only determines cursor placement
  win_col = 0 # 2010-02-07 23:19 new cursor stuff
  col2 = win_col + @col + @col_offset + @curpos + @cols_panned + @pad_offset
  $log.debug "TV SFC #{@name} setting c to #{col2} #{win_col} #{@col} #{@col_offset} #{@curpos} "
  #@form.setrowcol @form.row, col
  setrowcol nil, col2
  @repaint_footer_required = true
end