HScrBar.st
changeset 205 6814c0bf8df8
parent 174 d80a6cc3f9b2
child 585 8f395aba0173
--- a/HScrBar.st	Thu Nov 23 18:48:50 1995 +0100
+++ b/HScrBar.st	Thu Nov 23 19:19:24 1995 +0100
@@ -11,10 +11,10 @@
 "
 
 ScrollBar subclass:#HorizontalScrollBar
-       instanceVariableNames:''
-       classVariableNames:''
-       poolDictionaries:''
-       category:'Views-Interactors'
+	 instanceVariableNames:''
+	 classVariableNames:''
+	 poolDictionaries:''
+	 category:'Views-Interactors'
 !
 
 !HorizontalScrollBar class methodsFor:'documentation'!
@@ -33,10 +33,6 @@
 "
 !
 
-version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/HScrBar.st,v 1.15 1995-11-11 16:20:38 cg Exp $'
-!
-
 documentation
 "
     this class implements horizontal scrollbars with scroller and
@@ -45,53 +41,6 @@
 "
 ! !
 
-!HorizontalScrollBar methodsFor:'initialization'!
-
-createElements
-    "private: create my elements"
-
-    button1 := ArrowButton leftIn:self.
-    button2 := ArrowButton rightIn:self.
-    thumb := HorizontalScroller in:self.
-!
-
-setElementPositions
-    "position sub-components"
-
-    |bwn|
-
-    bwn := borderWidth negated + margin.
-
-    (buttonLayout == #bottom) ifTrue:[
-	"buttons at left"
-	button1 origin:(bwn @ bwn).
-	button1 viewGravity:#West.
-	button2 origin:(button1 width @ bwn).
-	button2 viewGravity:#West.
-	thumb origin:((button1 width 
-		       + borderWidth 
-		       + button2 width 
-		       + elementSpacing + elementSpacing) @ bwn).
-	thumb viewGravity:#West.
-	^ self
-    ].
-
-    (buttonLayout == #top) ifTrue:[
-	"buttons at right"
-	button1 viewGravity:#West.
-	button2 viewGravity:#West.
-	thumb origin:(bwn @ bwn).
-	thumb viewGravity:#West
-    ].
-
-    "buttonLayout == #around "
-    button1 origin:(bwn @ bwn).
-    button1 viewGravity:#West.
-    button2 viewGravity:#West.
-    thumb origin:((button1 width + elementSpacing) @ bwn).
-    thumb viewGravity:#West
-! !
-
 !HorizontalScrollBar methodsFor:'accessing-behavior'!
 
 scrollLeftAction
@@ -118,47 +67,6 @@
     button2 action:aBlock
 ! !
 
-!HorizontalScrollBar methodsFor:'queries'!
-
-preferredExtent
-    "compute my extent from sub-components"
-
-    |w h leftForm rightForm wLeft hLeft wRight hRight style|
-
-    "need fix - this is a kludge;
-     the if should not be needed ..."
-    style := styleSheet name.
-    style == #mswindows ifTrue:[
-	h := button1 height max:button2 height.
-	w := button1 width + button2 width + (Scroller defaultExtent x).
-    ] ifFalse:[
-	leftForm  := ArrowButton leftArrowButtonForm:style on:device.
-	rightForm := ArrowButton rightArrowButtonForm:style on:device.
-	"
-	 just in case ...
-	"
-	leftForm isNil ifTrue:[
-	    wLeft := hLeft := 16
-	] ifFalse:[
-	    wLeft := leftForm width.
-	    hLeft := leftForm height
-	].
-	rightForm isNil ifTrue:[
-	    wRight := hRight := 16
-	] ifFalse:[
-	    wRight := rightForm width.
-	    hRight := rightForm height
-	].
-	w := wLeft + wRight + (1 * 2) + (HorizontalScroller defaultExtent x).
-	h := hLeft max:hRight.
-	(style ~~ #normal) ifTrue:[
-	    h := h + 4.
-	    w := w + 4
-	].
-    ].
-    ^ w @ h.
-! !
-
 !HorizontalScrollBar methodsFor:'event handling'!
 
 sizeChanged:how
@@ -289,3 +197,97 @@
 	thumb origin:((leftWidth - borderWidth + elementSpacing) @ bwn)
     ].
 ! !
+
+!HorizontalScrollBar methodsFor:'initialization'!
+
+createElements
+    "private: create my elements"
+
+    button1 := ArrowButton leftIn:self.
+    button2 := ArrowButton rightIn:self.
+    thumb := HorizontalScroller in:self.
+!
+
+setElementPositions
+    "position sub-components"
+
+    |bwn|
+
+    bwn := borderWidth negated + margin.
+
+    (buttonLayout == #bottom) ifTrue:[
+	"buttons at left"
+	button1 origin:(bwn @ bwn).
+	button1 viewGravity:#West.
+	button2 origin:(button1 width @ bwn).
+	button2 viewGravity:#West.
+	thumb origin:((button1 width 
+		       + borderWidth 
+		       + button2 width 
+		       + elementSpacing + elementSpacing) @ bwn).
+	thumb viewGravity:#West.
+	^ self
+    ].
+
+    (buttonLayout == #top) ifTrue:[
+	"buttons at right"
+	button1 viewGravity:#West.
+	button2 viewGravity:#West.
+	thumb origin:(bwn @ bwn).
+	thumb viewGravity:#West
+    ].
+
+    "buttonLayout == #around "
+    button1 origin:(bwn @ bwn).
+    button1 viewGravity:#West.
+    button2 viewGravity:#West.
+    thumb origin:((button1 width + elementSpacing) @ bwn).
+    thumb viewGravity:#West
+! !
+
+!HorizontalScrollBar methodsFor:'queries'!
+
+preferredExtent
+    "compute my extent from sub-components"
+
+    |w h leftForm rightForm wLeft hLeft wRight hRight style|
+
+    "need fix - this is a kludge;
+     the if should not be needed ..."
+    style := styleSheet name.
+    style == #mswindows ifTrue:[
+	h := button1 height max:button2 height.
+	w := button1 width + button2 width + (Scroller defaultExtent x).
+    ] ifFalse:[
+	leftForm  := ArrowButton leftArrowButtonForm:style on:device.
+	rightForm := ArrowButton rightArrowButtonForm:style on:device.
+	"
+	 just in case ...
+	"
+	leftForm isNil ifTrue:[
+	    wLeft := hLeft := 16
+	] ifFalse:[
+	    wLeft := leftForm width.
+	    hLeft := leftForm height
+	].
+	rightForm isNil ifTrue:[
+	    wRight := hRight := 16
+	] ifFalse:[
+	    wRight := rightForm width.
+	    hRight := rightForm height
+	].
+	w := wLeft + wRight + (1 * 2) + (HorizontalScroller defaultExtent x).
+	h := hLeft max:hRight.
+	(style ~~ #normal) ifTrue:[
+	    h := h + 4.
+	    w := w + 4
+	].
+    ].
+    ^ w @ h.
+! !
+
+!HorizontalScrollBar class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/HScrBar.st,v 1.16 1995-11-23 18:18:49 cg Exp $'
+! !