ListModelView.st
changeset 2659 3af857eb52fb
parent 2645 b3d3e7c3ee40
child 2670 27dacfff1d6d
equal deleted inserted replaced
2658:04f9fdd74b8e 2659:3af857eb52fb
   360     "set a new font
   360     "set a new font
   361     "
   361     "
   362     |oldWidth oldHeight|
   362     |oldWidth oldHeight|
   363 
   363 
   364     (aFont isNil or:[aFont = font]) ifFalse:[
   364     (aFont isNil or:[aFont = font]) ifFalse:[
   365 	oldWidth  := font width.
   365         oldWidth  := font width.
   366 	oldHeight := font height.
   366         oldHeight := font height.
   367 
   367 
   368 	super font:aFont.
   368         super font:aFont.
   369 
   369 
   370 	(font widthOn:device) ~~ oldWidth ifTrue:[       "/ force a recomputation
   370         (font widthOn:device) ~~ oldWidth ifTrue:[       "/ force a recomputation
   371 	    preferredExtent := nil.
   371             preferredExtent := nil.
   372 	    widthOfContents := nil.
   372             widthOfContents := nil.
   373 	].
   373         ].
   374 	oldHeight ~~ (font heightOn:device) ifTrue:[
   374         oldHeight ~~ (font heightOn:device) ifTrue:[
   375 	    self recomputeHeightOfContents.
   375             self recomputeHeightOfContents.
   376 	].
   376         ].
   377 	shown ifTrue:[ self invalidate ]
   377         self invalidate
   378     ].
   378     ].
   379 !
   379 !
   380 
   380 
   381 foregroundColor
   381 foregroundColor
   382     "get the foreground color
   382     "get the foreground color
   408 lineSpacing:aNumber
   408 lineSpacing:aNumber
   409     "set the lineSpacing - thats an additional number of pixels,
   409     "set the lineSpacing - thats an additional number of pixels,
   410      by which lines are vertically separated.
   410      by which lines are vertically separated.
   411     "
   411     "
   412     lineSpacing ~= aNumber ifTrue:[
   412     lineSpacing ~= aNumber ifTrue:[
   413 	lineSpacing := aNumber.
   413         lineSpacing := aNumber.
   414 
   414 
   415 	self recomputeHeightOfContents.
   415         self recomputeHeightOfContents.
   416 
   416         self invalidate
   417 	shown ifTrue:[
       
   418 	    self invalidate
       
   419 	]
       
   420     ]
   417     ]
   421 !
   418 !
   422 
   419 
   423 viewBackground:aColor
   420 viewBackground:aColor
   424     "set the background color
   421     "set the background color
  1568     (   (dX ~~ 0 and:[dY ~~ 0])                         "/ scroll vertical & horizontal
  1565     (   (dX ~~ 0 and:[dY ~~ 0])                         "/ scroll vertical & horizontal
  1569      or:[(innerHG - dY < 20 or:[innerWT - dX < 20])]    "/ faster to invalidate screen
  1566      or:[(innerHG - dY < 20 or:[innerWT - dX < 20])]    "/ faster to invalidate screen
  1570     ) ifTrue:[
  1567     ) ifTrue:[
  1571         viewOrigin := newOrg.
  1568         viewOrigin := newOrg.
  1572         self originChanged:dltOrg.
  1569         self originChanged:dltOrg.
  1573       ^ self invalidate
  1570         self invalidate.
       
  1571         ^ self
  1574     ].
  1572     ].
  1575 
  1573 
  1576     (winGrp := self windowGroup) notNil ifTrue:[
  1574     (winGrp := self windowGroup) notNil ifTrue:[
  1577         winGrp processRealExposeEventsFor:self.
  1575         winGrp processRealExposeEventsFor:self.
  1578     ].
  1576     ].
  1579 
  1577 
  1580     self originWillChange.
  1578     self originWillChange.
  1581 
  1579 
  1582     doRedraw ifFalse:[
  1580     doRedraw ifFalse:[
  1583         viewOrigin := newOrg.
  1581         viewOrigin := newOrg.
  1584         ^ self originChanged:dltOrg
  1582         self originChanged:dltOrg.
       
  1583         ^ self 
  1585     ].
  1584     ].
  1586 
  1585 
  1587     self catchExpose.
  1586     self catchExpose.
  1588     viewOrigin := newOrg.
  1587     viewOrigin := newOrg.
  1589 
  1588 
  1611     self waitForExpose.
  1610     self waitForExpose.
  1612 
  1611 
  1613     winGrp notNil ifTrue:[
  1612     winGrp notNil ifTrue:[
  1614         winGrp processRealExposeEventsFor:self.
  1613         winGrp processRealExposeEventsFor:self.
  1615     ].
  1614     ].
  1616 
       
  1617 !
  1615 !
  1618 
  1616 
  1619 scrollToLine:aLineNumber
  1617 scrollToLine:aLineNumber
  1620     "make line visible
  1618     "make line visible
  1621     "
  1619     "
  1821 ! !
  1819 ! !
  1822 
  1820 
  1823 !ListModelView class methodsFor:'documentation'!
  1821 !ListModelView class methodsFor:'documentation'!
  1824 
  1822 
  1825 version
  1823 version
  1826     ^ '$Header: /cvs/stx/stx/libwidg2/ListModelView.st,v 1.92 2004-02-20 11:36:40 ca Exp $'
  1824     ^ '$Header: /cvs/stx/stx/libwidg2/ListModelView.st,v 1.93 2004-02-26 12:19:31 cg Exp $'
  1827 ! !
  1825 ! !
  1828 
  1826 
  1829 ListModelView initialize!
  1827 ListModelView initialize!