TextView.st
changeset 503 468d4a36ed67
parent 502 6f3d0d7a782c
child 504 36599ce06054
equal deleted inserted replaced
502:6f3d0d7a782c 503:468d4a36ed67
  1984     "unselect - if there was a selection redraw that area"
  1984     "unselect - if there was a selection redraw that area"
  1985 
  1985 
  1986     |startLine endLine startVisLine endVisLine|
  1986     |startLine endLine startVisLine endVisLine|
  1987 
  1987 
  1988     selectionStartLine notNil ifTrue:[
  1988     selectionStartLine notNil ifTrue:[
  1989 	startLine := selectionStartLine.
  1989         startLine := selectionStartLine.
  1990 	endLine := selectionEndLine.
  1990         endLine := selectionEndLine.
  1991 	selectionStartLine := nil.
  1991 
  1992 
  1992         self unselectWithoutRedraw.
  1993 	"if selection is not visible, we are done"
  1993 
  1994 	startLine >= (firstLineShown + nLinesShown) ifTrue:[^ self].
  1994         "if selection is not visible, we are done"
  1995 	endLine < firstLineShown ifTrue:[^ self].
  1995         startLine >= (firstLineShown + nLinesShown) ifTrue:[^ self].
  1996 
  1996         endLine < firstLineShown ifTrue:[^ self].
  1997 	startLine < firstLineShown ifTrue:[
  1997 
  1998 	    startVisLine := 1
  1998         startLine < firstLineShown ifTrue:[
  1999 	] ifFalse:[
  1999             startVisLine := 1
  2000 	    startVisLine := self listLineToVisibleLine:startLine
  2000         ] ifFalse:[
  2001 	].
  2001             startVisLine := self listLineToVisibleLine:startLine
  2002 	endLine >= (firstLineShown + nLinesShown) ifTrue:[
  2002         ].
  2003 	    endVisLine := nLinesShown
  2003         endLine >= (firstLineShown + nLinesShown) ifTrue:[
  2004 	] ifFalse:[
  2004             endVisLine := nLinesShown
  2005 	    endVisLine := self listLineToVisibleLine:endLine
  2005         ] ifFalse:[
  2006 	].
  2006             endVisLine := self listLineToVisibleLine:endLine
  2007 	"if its only part of a line, just redraw what has to be"
  2007         ].
  2008 	(startVisLine == endVisLine) ifTrue:[
  2008         "if its only part of a line, just redraw what has to be"
  2009 	    super redrawVisibleLine:startVisLine from:selectionStartCol to:selectionEndCol
  2009         (startVisLine == endVisLine) ifTrue:[
  2010 	] ifFalse:[
  2010             super redrawVisibleLine:startVisLine from:selectionStartCol to:selectionEndCol
  2011 	    super redrawFromVisibleLine:startVisLine to:endVisLine
  2011         ] ifFalse:[
  2012 	].
  2012             super redrawFromVisibleLine:startVisLine to:endVisLine
  2013 	self unselectWithoutRedraw
  2013         ].
  2014     ].
  2014     ].
  2015     selectStyle := nil
  2015     selectStyle := nil
       
  2016 
       
  2017     "Modified: 18.3.1996 / 17:19:51 / cg"
  2016 !
  2018 !
  2017 
  2019 
  2018 unselectWithoutRedraw
  2020 unselectWithoutRedraw
  2019     "forget selection but do not redraw the selection area
  2021     "forget selection but do not redraw the selection area
  2020      - can be done when the selected area is redrawn anyway or
  2022      - can be done when the selected area is redrawn anyway or
  2071 ! !
  2073 ! !
  2072 
  2074 
  2073 !TextView class methodsFor:'documentation'!
  2075 !TextView class methodsFor:'documentation'!
  2074 
  2076 
  2075 version
  2077 version
  2076     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.44 1996-03-18 16:19:09 cg Exp $'
  2078     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.45 1996-03-18 16:20:04 cg Exp $'
  2077 ! !
  2079 ! !