allow for forced scrollBar width/height (instead of computing)
authorClaus Gittinger <cg@exept.de>
Wed, 28 Apr 1999 19:52:56 +0200
changeset 1887 3e9d0074808d
parent 1886 cb557485dfcb
child 1888 5a6d274027bf
allow for forced scrollBar width/height (instead of computing)
ScrollBar.st
Scroller.st
--- a/ScrollBar.st	Wed Apr 28 19:15:50 1999 +0200
+++ b/ScrollBar.st	Wed Apr 28 19:52:56 1999 +0200
@@ -13,7 +13,8 @@
 SimpleView subclass:#ScrollBar
 	instanceVariableNames:'thumb button1 button2 buttonLayout elementSpacing'
 	classVariableNames:'DefaultButtonPositions DefaultLevel DefaultElementSpacing
-		DefaultScrollerBordered'
+		DefaultScrollerBordered DefaultHScrollBarHeight
+		DefaultVScrollBarWidth'
 	poolDictionaries:''
 	category:'Views-Interactors'
 !
@@ -78,15 +79,22 @@
     <resource: #style (#'scrollBar.buttonPositions' 
                        #'scrollBar.level'
                        #'scrollBar.scrollerBordered' 
-                       #'scrollBar.elementSpacing')>
+                       #'scrollBar.elementSpacing'
+                       #'scrollBar.vScrollBarWidth'
+                       #'scrollBar.vScrollBarWidth' 
+                      )>
 
-    DefaultButtonPositions := StyleSheet at:'scrollBar.buttonPositions' default:#bottom.
-    DefaultLevel := StyleSheet at:'scrollBar.level'.
-    DefaultScrollerBordered := StyleSheet at:'scrollBar.scrollerBordered' default:false.
-    DefaultElementSpacing := StyleSheet at:'scrollBar.elementSpacing' 
-                                        default:(StyleSheet is3D ifTrue:[1] ifFalse:[0]).
+    DefaultButtonPositions := StyleSheet at:#'scrollBar.buttonPositions' default:#bottom.
+    DefaultLevel := StyleSheet at:#'scrollBar.level'.
+    DefaultScrollerBordered := StyleSheet at:#'scrollBar.scrollerBordered' default:false.
+    DefaultElementSpacing := StyleSheet 
+                                at:#'scrollBar.elementSpacing' 
+                                default:(StyleSheet is3D ifTrue:[1] ifFalse:[0]).
 
-    "Modified: / 21.5.1998 / 01:28:16 / cg"
+    DefaultVScrollBarWidth  := StyleSheet at:#'scrollBar.vScrollBarWidth' default:nil.
+    DefaultHScrollBarHeight := StyleSheet at:#'scrollBar.hScrollBarHeight' default:nil.
+
+    "Modified: / 28.4.1999 / 19:27:53 / cg"
 ! !
 
 !ScrollBar methodsFor:'accessing'!
@@ -972,10 +980,11 @@
 
     <resource: #style (#name)>
 
-    |w h form1 form2
+    |w h form1 form2 style
      height1   "{ Class: SmallInteger }"
-     height2 "{ Class: SmallInteger }"
-     width1 width2 style|
+     height2   "{ Class: SmallInteger }"
+     width1    "{ Class: SmallInteger }"
+     width2    "{ Class: SmallInteger }" |
 
     "/ If I have an explicit preferredExtent ..
 
@@ -1010,21 +1019,30 @@
     ].
 
     self orientation == #horizontal ifTrue:[
+        DefaultHScrollBarHeight notNil ifTrue:[
+            h := DefaultHScrollBarHeight
+        ] ifFalse:[
+            h := height1 max:height2.
+        ].
         w := width1 + width2 + (1 * 2) + (HorizontalScroller defaultExtent x).
-        h := height1 max:height2.
     ] ifFalse:[
+        DefaultVScrollBarWidth notNil ifTrue:[
+            w := DefaultVScrollBarWidth
+        ] ifFalse:[
+            w := width1 max:width2.
+        ].
         h := height1 + height2 + (1 * 2) + (Scroller defaultExtent y).
-        w := width1 max:width2.
     ].
+
     style ~~ #normal ifTrue:[
-        h := h + 4.
-        w := w + 4
+        DefaultHScrollBarHeight isNil ifTrue:[h := h + 4].
+        DefaultVScrollBarWidth isNil ifTrue:[w := w + 4].
     ].
 
     preferredExtent := w @ h.
     ^ preferredExtent
 
-    "Modified: 28.5.1997 / 15:16:56 / cg"
+    "Modified: / 28.4.1999 / 19:33:45 / cg"
 ! !
 
 !ScrollBar methodsFor:'queries - internal'!
@@ -1042,5 +1060,5 @@
 !ScrollBar class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ScrollBar.st,v 1.58 1999-04-17 22:26:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ScrollBar.st,v 1.59 1999-04-28 17:52:40 cg Exp $'
 ! !
--- a/Scroller.st	Wed Apr 28 19:15:50 1999 +0200
+++ b/Scroller.st	Wed Apr 28 19:52:56 1999 +0200
@@ -356,7 +356,9 @@
                        #'scroller.thumbEnteredColor' #'scroller.thumbActiveLevel'
                        #'scroller.middleButtonJump' 
                        #'scroller.newCursors' 
-                       #'scroller.thumbImage' #'scroller.handleImage')>
+                       #'scroller.thumbImage' #'scroller.handleImage'
+                       #'scroller.vScrollerWidth' #'scroller.hScrollerHeight' 
+                     )>
 
     DefaultViewBackground := StyleSheet colorAt:#'scroller.viewBackground'.
     DefaultFullViewBackground := StyleSheet colorAt:#'scroller.fullViewBackground'.
@@ -405,7 +407,7 @@
      self updateStyleCache
     "
 
-    "Modified: / 28.4.1999 / 18:26:42 / cg"
+    "Modified: / 28.4.1999 / 19:23:24 / cg"
 ! !
 
 !Scroller methodsFor:'accessing'!
@@ -2319,5 +2321,5 @@
 !Scroller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.126 1999-04-28 17:15:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.127 1999-04-28 17:52:56 cg Exp $'
 ! !