equal
deleted
inserted
replaced
7 inclusion of the above copyright notice. This software may not |
7 inclusion of the above copyright notice. This software may not |
8 be provided or otherwise made available to, or used by, any |
8 be provided or otherwise made available to, or used by, any |
9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
|
12 |
|
13 'From Smalltalk/X, Version:3.2.1 on 20-oct-1997 at 5:48:38 pm' ! |
12 |
14 |
13 SimpleView subclass:#ScrollableView |
15 SimpleView subclass:#ScrollableView |
14 instanceVariableNames:'scrolledView vScrollBar hScrollBar scrollBarPosition lockUpdates |
16 instanceVariableNames:'scrolledView vScrollBar hScrollBar scrollBarPosition lockUpdates |
15 hideScrollBars hasHorizontalScrollBar hasVerticalScrollBar |
17 hideScrollBars hasHorizontalScrollBar hasVerticalScrollBar |
16 horizontalMini verticalMini vScrollBarHidden hScrollBarHidden |
18 horizontalMini verticalMini vScrollBarHidden hScrollBarHidden |
859 !ScrollableView class methodsFor:'defaults'! |
861 !ScrollableView class methodsFor:'defaults'! |
860 |
862 |
861 updateStyleCache |
863 updateStyleCache |
862 "extract values from the styleSheet and cache them in class variables" |
864 "extract values from the styleSheet and cache them in class variables" |
863 |
865 |
864 <resource: #style (#scrolledViewLevel #scrolledViewMargin)> |
866 <resource: #style (#'scrolledView.level' #'scrolledView.margin' |
|
867 #'scrolledView.borderWidth' |
|
868 #'scrollBarSpacing' #'scrollBarLevel' |
|
869 #'scrollableViewLevel' #'scrollableViewBackgroundColor' )> |
865 |
870 |
866 |defLevel defMargin defSpacing| |
871 |defLevel defMargin defSpacing| |
867 |
872 |
868 StyleSheet is3D ifTrue:[ |
873 StyleSheet is3D ifTrue:[ |
869 defLevel := -1. |
874 defLevel := -1. |
872 ] ifFalse:[ |
877 ] ifFalse:[ |
873 defLevel := 0. |
878 defLevel := 0. |
874 defMargin := 0. |
879 defMargin := 0. |
875 defSpacing := 0 |
880 defSpacing := 0 |
876 ]. |
881 ]. |
877 DefaultScrolledViewLevel := StyleSheet at:'scrolledViewLevel' default:defLevel. |
882 DefaultScrolledViewLevel := StyleSheet at:'scrolledView.level' default:defLevel. |
878 DefaultScrolledViewBorderWidth := StyleSheet at:'scrolledViewBorderWidth' default:nil. |
883 DefaultScrolledViewBorderWidth := StyleSheet at:'scrolledView.borderWidth' default:nil. |
879 DefaultScrolledViewMargin := StyleSheet at:'scrolledViewMargin' default:defMargin. |
884 DefaultScrolledViewMargin := StyleSheet at:'scrolledView.margin' default:defMargin. |
880 DefaultScrollBarSpacing := StyleSheet at:'scrollBarSpacing' default:defSpacing. |
885 DefaultScrollBarSpacing := StyleSheet at:'scrollBarSpacing' default:defSpacing. |
881 DefaultLevel := StyleSheet at:'scrollableViewLevel' default:nil. |
886 DefaultLevel := StyleSheet at:'scrollableViewLevel' default:nil. |
882 DefaultScrollBarLevel := StyleSheet at:'scrollBarLevel' default:nil. |
887 DefaultScrollBarLevel := StyleSheet at:'scrollBarLevel' default:nil. |
883 MyDefaultViewBackgroundColor := StyleSheet at:'scrollableViewBackgroundColor' default:DefaultViewBackgroundColor. |
888 MyDefaultViewBackgroundColor := StyleSheet at:'scrollableViewBackgroundColor' default:DefaultViewBackgroundColor. |
884 |
889 |
885 " |
890 " |
886 self updateStyleCache |
891 self updateStyleCache |
887 " |
892 " |
888 |
893 |
889 "Modified: 7.3.1997 / 15:03:37 / cg" |
894 "Modified: 20.10.1997 / 15:13:10 / cg" |
890 ! ! |
895 ! ! |
891 |
896 |
892 !ScrollableView methodsFor:'accessing-behavior'! |
897 !ScrollableView methodsFor:'accessing-behavior'! |
893 |
898 |
894 autoHideScrollBars:aBoolean |
899 autoHideScrollBars:aBoolean |
1572 scrolledViewLayout leftOffset:sLeftOffs. |
1577 scrolledViewLayout leftOffset:sLeftOffs. |
1573 scrolledViewLayout rightOffset:sRightOffs. |
1578 scrolledViewLayout rightOffset:sRightOffs. |
1574 scrolledViewLayout topOffset:sTopOffs. |
1579 scrolledViewLayout topOffset:sTopOffs. |
1575 scrolledViewLayout bottomOffset:sBottomOffs. |
1580 scrolledViewLayout bottomOffset:sBottomOffs. |
1576 |
1581 |
1577 ((hScrollBar isNil or:[hScrollBarHidden]) |
1582 (hideScrollBars not |
1578 and:[(vScrollBar isNil or:[vScrollBarHidden])]) ifTrue:[ |
1583 and:[(hScrollBar isNil or:[hScrollBarHidden]) |
|
1584 and:[(vScrollBar isNil or:[vScrollBarHidden])]]) ifTrue:[ |
1579 scrolledView level:0 |
1585 scrolledView level:0 |
1580 ] ifFalse:[ |
1586 ] ifFalse:[ |
1581 scrolledView level:DefaultScrolledViewLevel. |
1587 scrolledView level:DefaultScrolledViewLevel. |
1582 ]. |
1588 ]. |
1583 scrolledView layout:scrolledViewLayout. |
1589 scrolledView layout:scrolledViewLayout. |
1600 vScrollBar level:DefaultScrollBarLevel. |
1606 vScrollBar level:DefaultScrollBarLevel. |
1601 vScrollBar layout:vScrollBarLayout |
1607 vScrollBar layout:vScrollBarLayout |
1602 ]. |
1608 ]. |
1603 |
1609 |
1604 "Created: 6.3.1997 / 18:06:23 / cg" |
1610 "Created: 6.3.1997 / 18:06:23 / cg" |
1605 "Modified: 19.3.1997 / 16:33:56 / cg" |
1611 "Modified: 20.10.1997 / 17:47:46 / cg" |
1606 ! |
1612 ! |
1607 |
1613 |
1608 setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
1614 setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
1609 "setup scrollbars as specified in the arguments" |
1615 "setup scrollbars as specified in the arguments" |
1610 |
1616 |
1879 ! ! |
1885 ! ! |
1880 |
1886 |
1881 !ScrollableView class methodsFor:'documentation'! |
1887 !ScrollableView class methodsFor:'documentation'! |
1882 |
1888 |
1883 version |
1889 version |
1884 ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.72 1997-10-11 15:56:51 cg Exp $' |
1890 ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.73 1997-10-21 18:12:28 cg Exp $' |
1885 ! ! |
1891 ! ! |