ETxtView.st
changeset 24 966098a893f8
parent 19 a696fb528758
child 25 975bead4571a
equal deleted inserted replaced
23:69f1ba57f67a 24:966098a893f8
    29 EditTextView comment:'
    29 EditTextView comment:'
    30 
    30 
    31 COPYRIGHT (c) 1989 by Claus Gittinger
    31 COPYRIGHT (c) 1989 by Claus Gittinger
    32             All Rights Reserved
    32             All Rights Reserved
    33 
    33 
    34 $Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.8 1994-01-08 17:24:08 claus Exp $
    34 $Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.9 1994-01-13 00:15:09 claus Exp $
    35 
    35 
    36 written jun-89 by claus
    36 written jun-89 by claus
    37 '!
    37 '!
    38 
    38 
    39 !EditTextView class methodsFor:'documentation'!
    39 !EditTextView class methodsFor:'documentation'!
   324                 srcY := topMargin + (visLine * fontHeight).
   324                 srcY := topMargin + (visLine * fontHeight).
   325                 self copyFrom:self x:textStartLeft y:srcY
   325                 self copyFrom:self x:textStartLeft y:srcY
   326                                  toX:textStartLeft y:(srcY + fontHeight)
   326                                  toX:textStartLeft y:(srcY + fontHeight)
   327                                width:w
   327                                width:w
   328                               height:((nLinesShown - visLine - 1) * fontHeight).
   328                               height:((nLinesShown - visLine - 1) * fontHeight).
       
   329                 self catchExpose.
   329                 self redrawLine:lineNr.
   330                 self redrawLine:lineNr.
   330                 self redrawLine:(lineNr + 1).
   331                 self redrawLine:(lineNr + 1).
   331                 exposePending := true.
       
   332                 self waitForExpose
   332                 self waitForExpose
   333             ]
   333             ]
   334         ]
   334         ]
   335     ]
   335     ]
   336 !
   336 !
   391         dstY := topMargin + ((visLine ) * fontHeight).
   391         dstY := topMargin + ((visLine ) * fontHeight).
   392         self copyFrom:self x:textStartLeft y:(dstY - fontHeight)
   392         self copyFrom:self x:textStartLeft y:(dstY - fontHeight)
   393                          toX:textStartLeft y:dstY
   393                          toX:textStartLeft y:dstY
   394                        width:w
   394                        width:w
   395                       height:((nLinesShown - visLine "- 1") * fontHeight).
   395                       height:((nLinesShown - visLine "- 1") * fontHeight).
       
   396         self catchExpose.
   396         self redrawVisibleLine:visLine.
   397         self redrawVisibleLine:visLine.
   397         exposePending := true.
       
   398         self waitForExpose
   398         self waitForExpose
   399     ]
   399     ]
   400 !
   400 !
   401 
   401 
   402 insertLines:someText from:start to:end before:lineNr
   402 insertLines:someText from:start to:end before:lineNr
   425             dstY := srcY + (nLines * fontHeight).
   425             dstY := srcY + (nLines * fontHeight).
   426             self copyFrom:self x:textStartLeft y:srcY
   426             self copyFrom:self x:textStartLeft y:srcY
   427                              toX:textStartLeft y:dstY
   427                              toX:textStartLeft y:dstY
   428                            width:w
   428                            width:w
   429                           height:(height - dstY).
   429                           height:(height - dstY).
       
   430             self catchExpose.
   430             self redrawFromVisibleLine:visLine to:(visLine + nLines - 1).
   431             self redrawFromVisibleLine:visLine to:(visLine + nLines - 1).
   431             exposePending := true.
       
   432             self waitForExpose
   432             self waitForExpose
   433         ]
   433         ]
   434     ]
   434     ]
   435 !
   435 !
   436 
   436 
   875     visLine notNil ifTrue:[
   875     visLine notNil ifTrue:[
   876         srcY :=  margin + topMargin + (visLine * fontHeight).
   876         srcY :=  margin + topMargin + (visLine * fontHeight).
   877         self copyFrom:self x:textStartLeft y:srcY
   877         self copyFrom:self x:textStartLeft y:srcY
   878                          toX:textStartLeft y:(srcY - fontHeight)
   878                          toX:textStartLeft y:(srcY - fontHeight)
   879                        width:w height:((nLinesShown - visLine) * fontHeight).
   879                        width:w height:((nLinesShown - visLine) * fontHeight).
       
   880         self catchExpose.
   880         self redrawVisibleLine:nFullLinesShown.
   881         self redrawVisibleLine:nFullLinesShown.
   881         (nFullLinesShown ~~ nLinesShown) ifTrue:[
   882         (nFullLinesShown ~~ nLinesShown) ifTrue:[
   882             self redrawVisibleLine:nLinesShown
   883             self redrawVisibleLine:nLinesShown
   883         ].
   884         ].
   884         exposePending := true.
       
   885         self waitForExpose
   885         self waitForExpose
   886     ]
   886     ]
   887 !
   887 !
   888 
   888 
   889 deleteCursorLine
   889 deleteCursorLine
  1841 !
  1841 !
  1842 
  1842 
  1843 searchBwd:pattern
  1843 searchBwd:pattern
  1844     "do the backward search"
  1844     "do the backward search"
  1845 
  1845 
  1846     self searchBackwardFor:pattern startingAtLine:cursorLine col:cursorCol
  1846     self searchBackwardFor:pattern startingAtLine:(cursorLine min:list size) col:cursorCol
  1847     ifFound:[:line :col |
  1847     ifFound:[:line :col |
  1848         self cursorLine:line col:col.
  1848         self cursorLine:line col:col.
  1849         self selectFromLine:line col:col
  1849         self selectFromLine:line col:col
  1850                      toLine:line col:(col + pattern size - 1).
  1850                      toLine:line col:(col + pattern size - 1).
  1851         self makeLineVisible:cursorLine
  1851         self makeLineVisible:cursorLine