TabView.st
changeset 548 db06a43229a8
parent 545 d01d14358b07
child 550 f4c65aff6387
equal deleted inserted replaced
547:39f824c20c68 548:db06a43229a8
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 
    13 
    14 View subclass:#TabView
    14 View subclass:#TabView
    15 	instanceVariableNames:'list listHolder selection enabled action tabStyle useIndex
    15         instanceVariableNames:'list listHolder selection enabled action tabStyle useIndex
    16 		maxRawNr direction fitLastRow moveSelectedRow enableChannel
    16                 maxRawNr direction fitLastRow moveSelectedRow enableChannel
    17 		oldExtent oneTabPerLine'
    17                 oldExtent oneTabPerLine'
    18 	classVariableNames:''
    18         classVariableNames:''
    19 	poolDictionaries:''
    19         poolDictionaries:''
    20 	category:'Views-Interactors'
    20         category:'Views-Interactors'
    21 !
    21 !
    22 
    22 
    23 !TabView class methodsFor:'documentation'!
    23 !TabView class methodsFor:'documentation'!
    24 
    24 
    25 copyright
    25 copyright
   638     "redraw raw at a number; all contained tabs are drawn unselected
   638     "redraw raw at a number; all contained tabs are drawn unselected
   639     "
   639     "
   640     list reverseDo:[:aTab|aTab lineNr == aRawNr ifTrue:[aTab redraw:false]].
   640     list reverseDo:[:aTab|aTab lineNr == aRawNr ifTrue:[aTab redraw:false]].
   641 !
   641 !
   642 
   642 
       
   643 redrawRawAt:aRawNr in:aRectangle
       
   644     "redraw raw at a number; all contained tabs are drawn unselected
       
   645     "
       
   646     |rectangle|
       
   647 
       
   648     list reverseDo:[:aTab|
       
   649         aTab lineNr == aRawNr ifTrue:[
       
   650             (aTab intersects:aRectangle) ifTrue:[
       
   651                 aTab redraw:false
       
   652             ]
       
   653         ]
       
   654     ].
       
   655 !
       
   656 
   643 redrawSelection
   657 redrawSelection
   644     "redraw current selection
   658     "redraw current selection
   645     "
   659     "
   646     |tab idx|
   660     |tab idx|
   647 
   661 
   654 !
   668 !
   655 
   669 
   656 redrawX:x y:y width:w height:h
   670 redrawX:x y:y width:w height:h
   657     "a region must be redrawn
   671     "a region must be redrawn
   658     "
   672     "
   659     |oldSelect|
   673     |rectangle oldSelect prevClipArea|
   660 
   674 
   661     self shown ifTrue:[
   675     self shown ifFalse:[
   662         self paint:(self viewBackground).
   676         ^ self
   663         self clearRectangleX:x y:y width:w height:h.
   677     ].
   664 
   678 
   665         list size ~~ 0 ifTrue:[
   679     self paint:(self viewBackground).
   666             maxRawNr to:1 by:-1 do:[:i| self redrawRawAt:i ].
   680     self clearRectangleX:x y:y width:w height:h.
   667 
   681 
   668             selection notNil ifTrue:[
   682     list size == 0 ifTrue:[^ self].
   669                 oldSelect := selection.
   683 
   670                 selection := nil.
   684 
   671                 self setSelection:oldSelect.
   685     prevClipArea := clipRect.
   672             ]
   686     clipRect     := nil.
   673         ]
   687     device setClipX:x y:y width:w height:h in:drawableId gc:gcId.
   674     ]
   688     rectangle := Rectangle left:x top:y width:w height:h.
       
   689 
       
   690     maxRawNr to:1 by:-1 do:[:i| self redrawRawAt:i in:rectangle].
       
   691 
       
   692     selection notNil ifTrue:[
       
   693         oldSelect := selection.
       
   694         selection := nil.
       
   695         self setSelection:oldSelect.
       
   696     ].
       
   697 
       
   698     prevClipArea isNil ifTrue:[device noClipIn:drawableId  gc:gcId]
       
   699                       ifFalse:[self clippingRectangle:prevClipArea].
   675 
   700 
   676 !
   701 !
   677 
   702 
   678 selectedTab:aTab redrawBlock:aRedrawBlock
   703 selectedTab:aTab redrawBlock:aRedrawBlock
   679     "calculate extent of selection and evaluate the block which will
   704     "calculate extent of selection and evaluate the block which will
   786     "setup default attributes
   811     "setup default attributes
   787     "
   812     "
   788     |widget|
   813     |widget|
   789 
   814 
   790     super initialize.
   815     super initialize.
       
   816     self bitGravity:#NorthWest.
   791 
   817 
   792     widget          := TabWidget widgetClass:(self class defaultTabWidget).
   818     widget          := TabWidget widgetClass:(self class defaultTabWidget).
   793     tabStyle        := widget tabStyleOn:self.
   819     tabStyle        := widget tabStyleOn:self.
   794     useIndex        := false.
   820     useIndex        := false.
   795     oneTabPerLine   := false.
   821     oneTabPerLine   := false.
  1160 ! !
  1186 ! !
  1161 
  1187 
  1162 !TabView class methodsFor:'documentation'!
  1188 !TabView class methodsFor:'documentation'!
  1163 
  1189 
  1164 version
  1190 version
  1165     ^ '$Header: /cvs/stx/stx/libwidg2/TabView.st,v 1.23 1997-10-10 19:47:28 cg Exp $'
  1191     ^ '$Header: /cvs/stx/stx/libwidg2/TabView.st,v 1.24 1997-10-11 11:03:00 ca Exp $'
  1166 ! !
  1192 ! !