allow hooking me to a masterView.
authorClaus Gittinger <cg@exept.de>
Mon, 12 Jul 1999 17:10:29 +0200
changeset 1445 b272f318bdef
parent 1444 0b7cd00e2537
child 1446 fb46beba2d0c
allow hooking me to a masterView.
TabSpecRuler.st
--- a/TabSpecRuler.st	Sat Jul 10 13:30:31 1999 +0200
+++ b/TabSpecRuler.st	Mon Jul 12 17:10:29 1999 +0200
@@ -13,7 +13,7 @@
 SimpleView subclass:#TabSpecRuler
 	instanceVariableNames:'tabSpec titles handleStyle handleCursor movedTabIndex movedTabX
 		synchronousOperation handleWidth fixedTabs tabsAreVariable
-		hiddenTabs'
+		hiddenTabs masterView'
 	classVariableNames:'DefaultHandleStyle'
 	poolDictionaries:''
 	category:'Views-Misc'
@@ -147,6 +147,19 @@
     "Modified: 28.3.1997 / 15:36:24 / cg"
 !
 
+masterView:aView
+    "set my master view - if non-nil, I will follow the masters scroll-offset"
+
+    masterView notNil ifTrue:[
+        masterView removeDependent:self
+    ].
+    masterView := aView.
+    masterView notNil ifTrue:[
+        masterView addDependent:self
+    ].
+
+!
+
 synchronousOperation
     "return the synchronousOperation mode settings value"
 
@@ -289,6 +302,14 @@
     self cursor:(Cursor normal).
 
     "Created: 28.3.1997 / 13:37:52 / cg"
+!
+
+update:something with:aParameter from:changedObject
+    changedObject == masterView ifTrue:[
+        something == #originOfContents ifTrue:[
+            self scrollTo:(masterView viewOrigin x @ 0).
+        ].
+    ].
 ! !
 
 !TabSpecRuler methodsFor:'initialization'!
@@ -373,6 +394,14 @@
     "Modified: 28.3.1997 / 14:54:58 / cg"
 ! !
 
+!TabSpecRuler methodsFor:'queries'!
+
+widthOfContents
+    masterView notNil ifTrue:[^ masterView heightOfContents].
+    ^ super heightOfContents.
+
+! !
+
 !TabSpecRuler methodsFor:'redrawing'!
 
 drawHandleAtX:x type:handleType
@@ -401,6 +430,7 @@
     tabSpec isNil ifTrue:[^ self].
     shown ifFalse:[^ self].
 
+    self clear.
     1 to:tabSpec size do:[:idx |
         self redrawTabAtIndex:idx.
     ]
@@ -458,5 +488,5 @@
 !TabSpecRuler class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/TabSpecRuler.st,v 1.15 1998-09-30 17:09:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/TabSpecRuler.st,v 1.16 1999-07-12 15:10:29 cg Exp $'
 ! !