ListView.st
changeset 2707 810c994db0b5
parent 2687 b6e87b6b88a1
child 2731 0f3c02f592d0
equal deleted inserted replaced
2706:e133fcf7bd29 2707:810c994db0b5
   615 !
   615 !
   616 
   616 
   617 characterAtCharacterPosition:charPos
   617 characterAtCharacterPosition:charPos
   618     "return the character at a 1-based character position. 
   618     "return the character at a 1-based character position. 
   619      Return a space character if nothing is there
   619      Return a space character if nothing is there
   620      (i.e. behond the end of the line or below the last line)"
   620      (i.e. beyond the end of the line or below the last line)"
   621 
   621 
   622     |line col|
   622     |line col|
   623 
   623 
   624     line := self lineOfCharacterPosition:charPos.
   624     line := self lineOfCharacterPosition:charPos.
   625     col := charPos - (self characterPositionOfLine:line col:1) + 1.
   625     col := charPos - (self characterPositionOfLine:line col:1) + 1.
   629 
   629 
   630 characterAtLine:lineNr col:colNr
   630 characterAtLine:lineNr col:colNr
   631     "return the character at physical line/col. 
   631     "return the character at physical line/col. 
   632      The lineNr and colNr arguments start at 1, for the top-left cgaracter.
   632      The lineNr and colNr arguments start at 1, for the top-left cgaracter.
   633      Return a space character if nothing is there
   633      Return a space character if nothing is there
   634      (i.e. behond the end of the line or below the last line)"
   634      (i.e. beyond the end of the line or below the last line)"
   635 
   635 
   636     |line|
   636     |line|
   637 
   637 
   638     list notNil ifTrue:[
   638     list notNil ifTrue:[
   639 	line := self listAt:lineNr.
   639 	line := self listAt:lineNr.
  1094 stringAtLine:lineNr from:col1 to:col2
  1094 stringAtLine:lineNr from:col1 to:col2
  1095     "return the substring starting at physical line/col1, up-to and
  1095     "return the substring starting at physical line/col1, up-to and
  1096      including col2. 
  1096      including col2. 
  1097      The lineNr and colNr arguments start at 1, for the top-left character.
  1097      The lineNr and colNr arguments start at 1, for the top-left character.
  1098      Fills the string with space characters at the right.
  1098      Fills the string with space characters at the right.
  1099      (i.e. behond the end of the line or below the last line)"
  1099      (i.e. beyond the end of the line or below the last line)"
  1100 
  1100 
  1101     |line len s|
  1101     |line len s|
  1102 
  1102 
  1103     len := col2 - col1 + 1.
  1103     len := col2 - col1 + 1.
  1104     list notNil ifTrue:[
  1104     list notNil ifTrue:[
  4458 ! !
  4458 ! !
  4459 
  4459 
  4460 !ListView class methodsFor:'documentation'!
  4460 !ListView class methodsFor:'documentation'!
  4461 
  4461 
  4462 version
  4462 version
  4463     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.279 2003-02-20 13:52:09 penk Exp $'
  4463     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.280 2003-03-19 11:21:14 cg Exp $'
  4464 ! !
  4464 ! !