13 View subclass:#Scroller |
13 View subclass:#Scroller |
14 instanceVariableNames:'thumbOrigin thumbHeight thumbColor thumbFrameColor scrollAction |
14 instanceVariableNames:'thumbOrigin thumbHeight thumbColor thumbFrameColor scrollAction |
15 orientation thumbFrame thumbLevel scrolling pressOffset |
15 orientation thumbFrame thumbLevel scrolling pressOffset |
16 synchronousOperation shadowForm lightForm inset thumbShadowColor |
16 synchronousOperation shadowForm lightForm inset thumbShadowColor |
17 thumbLightColor thumbEdgeStyle thumbHalfShadowColor |
17 thumbLightColor thumbEdgeStyle thumbHalfShadowColor |
18 thumbHalfLightColor thumbFrameSizeDifference tallyLevel |
18 thumbHalfLightColor thumbEnteredColor thumbFrameSizeDifference |
19 tallyMarks fixThumbHeight frameBeforeMove ghostColor |
19 tallyLevel tallyMarks fixThumbHeight frameBeforeMove ghostColor |
20 ghostFrameColor ghostLevel rangeStart rangeEnd rangeStep' |
20 ghostFrameColor ghostLevel rangeStart rangeEnd rangeStep entered' |
21 classVariableNames:'HandleShadowForm HandleLightForm DefaultViewBackground |
21 classVariableNames:'HandleShadowForm HandleLightForm DefaultViewBackground |
22 DefaultShadowColor DefaultLightColor DefaultThumbColor |
22 DefaultShadowColor DefaultLightColor DefaultThumbColor |
23 DefaultThumbShadowColor DefaultThumbLightColor |
23 DefaultThumbShadowColor DefaultThumbLightColor |
24 DefaultThumbHalfShadowColor DefaultThumbHalfLightColor |
24 DefaultThumbHalfShadowColor DefaultThumbHalfLightColor |
25 DefaultHalfShadowColor DefaultHalfLightColor DefaultTallyMarks |
25 DefaultHalfShadowColor DefaultHalfLightColor DefaultTallyMarks |
26 DefaultTallyLevel DefaultLevel DefaultBorderWidth |
26 DefaultTallyLevel DefaultLevel DefaultBorderWidth |
27 DefaultThumbLevel DefaultInset DefaultThumbFrameColor |
27 DefaultThumbLevel DefaultInset DefaultThumbFrameColor |
28 DefaultGhostColor DefaultGhostFrameColor DefaultGhostLevel |
28 DefaultGhostColor DefaultGhostFrameColor DefaultGhostLevel |
29 DefaultFixThumbHeight DefaultEdgeStyle DefaultFullViewBackground' |
29 DefaultFixThumbHeight DefaultEdgeStyle DefaultFullViewBackground |
|
30 DefaultThumbEnteredColor' |
30 poolDictionaries:'' |
31 poolDictionaries:'' |
31 category:'Views-Interactors' |
32 category:'Views-Interactors' |
32 ! |
33 ! |
33 |
34 |
34 !Scroller class methodsFor:'documentation'! |
35 !Scroller class methodsFor:'documentation'! |
317 |
318 |
318 updateStyleCache |
319 updateStyleCache |
319 "extract values from the styleSheet and cache them in class variables" |
320 "extract values from the styleSheet and cache them in class variables" |
320 |
321 |
321 <resource: #style (#scrollerViewBackground #scrollerFullViewBackground |
322 <resource: #style (#scrollerViewBackground #scrollerFullViewBackground |
322 #scrollerThumbColor |
323 #scrollerThumbColor |
323 #scrollerShadowColor #scrollerLightColor |
324 #scrollerShadowColor #scrollerLightColor |
324 #scrollerThumbShadowColor #scrollerThumbLightColor |
325 #scrollerThumbShadowColor #scrollerThumbLightColor |
325 #scrollerThumbHalfShadowColor #scrollerThumbHalfLightColor |
326 #scrollerThumbHalfShadowColor #scrollerThumbHalfLightColor |
326 #scrollerThumbFrameColor #scrollerGhostColor |
327 #scrollerThumbFrameColor #scrollerGhostColor |
327 #scrollerGhostLevel #scrollerGhostFrameColor |
328 #scrollerGhostLevel #scrollerGhostFrameColor |
328 #scrollerNTallyMarks #scrollerTallyLevel |
329 #scrollerNTallyMarks #scrollerTallyLevel |
329 #scrollerLevel #scrollerBorderWidth |
330 #scrollerLevel #scrollerBorderWidth |
330 #scrollerThumbLevel #scrollerThumbInset |
331 #scrollerThumbLevel #scrollerThumbInset |
331 #scrollerThumbFixHeight #scrollerThumbEdgeStyle)> |
332 #scrollerThumbFixHeight #scrollerThumbEdgeStyle)> |
332 |
333 |
333 DefaultViewBackground := StyleSheet colorAt:'scrollerViewBackground'. |
334 DefaultViewBackground := StyleSheet colorAt:'scrollerViewBackground'. |
334 DefaultFullViewBackground := StyleSheet colorAt:'scrollerFullViewBackground'. |
335 DefaultFullViewBackground := StyleSheet colorAt:'scrollerFullViewBackground'. |
335 DefaultThumbColor := StyleSheet colorAt:'scrollerThumbColor'. |
336 DefaultThumbColor := StyleSheet colorAt:'scrollerThumbColor'. |
|
337 DefaultThumbEnteredColor := StyleSheet colorAt:'scrollerThumbEnteredColor'. |
336 DefaultShadowColor := StyleSheet colorAt:'scrollerShadowColor'. |
338 DefaultShadowColor := StyleSheet colorAt:'scrollerShadowColor'. |
337 DefaultLightColor := StyleSheet colorAt:'scrollerLightColor'. |
339 DefaultLightColor := StyleSheet colorAt:'scrollerLightColor'. |
338 DefaultThumbShadowColor := StyleSheet colorAt:'scrollerThumbShadowColor'. |
340 DefaultThumbShadowColor := StyleSheet colorAt:'scrollerThumbShadowColor'. |
339 DefaultThumbLightColor := StyleSheet colorAt:'scrollerThumbLightColor'. |
341 DefaultThumbLightColor := StyleSheet colorAt:'scrollerThumbLightColor'. |
340 DefaultThumbHalfShadowColor := StyleSheet colorAt:'scrollerThumbHalfShadowColor'. |
342 DefaultThumbHalfShadowColor := StyleSheet colorAt:'scrollerThumbHalfShadowColor'. |
344 DefaultGhostFrameColor := StyleSheet colorAt:'scrollerGhostFrameColor' default:nil. |
346 DefaultGhostFrameColor := StyleSheet colorAt:'scrollerGhostFrameColor' default:nil. |
345 DefaultGhostLevel := StyleSheet at:'scrollerGhostLevel' default:0. |
347 DefaultGhostLevel := StyleSheet at:'scrollerGhostLevel' default:0. |
346 DefaultTallyMarks := StyleSheet at:'scrollerNTallyMarks' default:0. |
348 DefaultTallyMarks := StyleSheet at:'scrollerNTallyMarks' default:0. |
347 DefaultTallyLevel := 0. |
349 DefaultTallyLevel := 0. |
348 DefaultTallyMarks ~~ 0 ifTrue:[ |
350 DefaultTallyMarks ~~ 0 ifTrue:[ |
349 DefaultTallyLevel := StyleSheet at:'scrollerTallyLevel' default:1. |
351 DefaultTallyLevel := StyleSheet at:'scrollerTallyLevel' default:1. |
350 ]. |
352 ]. |
351 DefaultLevel := StyleSheet at:'scrollerLevel' default:0. |
353 DefaultLevel := StyleSheet at:'scrollerLevel' default:0. |
352 DefaultBorderWidth := StyleSheet at:'scrollerBorderWidth' default:(StyleSheet at:'borderWidth'). |
354 DefaultBorderWidth := StyleSheet at:'scrollerBorderWidth' default:(StyleSheet at:'borderWidth'). |
353 DefaultThumbLevel := StyleSheet at:'scrollerThumbLevel' default:0. |
355 DefaultThumbLevel := StyleSheet at:'scrollerThumbLevel' default:0. |
354 DefaultInset := StyleSheet at:'scrollerThumbInset' default:0. |
356 DefaultInset := StyleSheet at:'scrollerThumbInset' default:0. |
355 DefaultFixThumbHeight := StyleSheet at:'scrollerThumbFixHeight' default:false. |
357 DefaultFixThumbHeight := StyleSheet at:'scrollerThumbFixHeight' default:false. |
356 DefaultEdgeStyle := StyleSheet at:'scrollerThumbEdgeStyle'. |
358 DefaultEdgeStyle := StyleSheet at:'scrollerThumbEdgeStyle'. |
357 |
359 |
358 StyleSheet fileReadFailed ifTrue:[ |
360 StyleSheet fileReadFailed ifTrue:[ |
359 DefaultViewBackground := Grey. |
361 DefaultViewBackground := Grey. |
360 DefaultThumbColor := White. |
362 DefaultThumbColor := White. |
361 DefaultThumbFrameColor := Black. |
363 DefaultThumbFrameColor := Black. |
362 DefaultInset := 1. |
364 DefaultInset := 1. |
363 ] |
365 ] |
364 |
366 |
365 "Modified: 1.3.1996 / 13:48:45 / cg" |
367 "Modified: 6.3.1996 / 17:22:25 / cg" |
366 ! ! |
368 ! ! |
367 |
369 |
368 !Scroller methodsFor:'accessing'! |
370 !Scroller methodsFor:'accessing'! |
369 |
371 |
370 start |
372 start |
798 y "{ Class: SmallInteger }" |
800 y "{ Class: SmallInteger }" |
799 mm xL xR yT yB color1 color2| |
801 mm xL xR yT yB color1 color2| |
800 |
802 |
801 (thumbHeight >= 100) ifTrue:[^ self]. |
803 (thumbHeight >= 100) ifTrue:[^ self]. |
802 orientation == #vertical ifTrue:[ |
804 orientation == #vertical ifTrue:[ |
803 thumbFrame height >= height ifTrue:[^ self]. |
805 thumbFrame height >= height ifTrue:[^ self]. |
804 ] ifFalse:[ |
806 ] ifFalse:[ |
805 thumbFrame width >= width ifTrue:[^ self]. |
807 thumbFrame width >= width ifTrue:[^ self]. |
806 ]. |
808 ]. |
807 |
809 |
808 l := thumbFrame left. |
810 l := thumbFrame left. |
809 t := thumbFrame top. |
811 t := thumbFrame top. |
810 w := thumbFrame width. |
812 w := thumbFrame width. |
811 h := thumbFrame height. |
813 h := thumbFrame height. |
812 self paint:thumbColor. |
814 |
|
815 self paint:(entered ifTrue:[thumbEnteredColor] ifFalse:[thumbColor]). |
813 self fillRectangleX:l y:t width:w-1 height:h. |
816 self fillRectangleX:l y:t width:w-1 height:h. |
814 |
817 |
815 thumbLevel == 0 ifTrue:[ |
818 thumbLevel == 0 ifTrue:[ |
816 thumbFrameColor notNil ifTrue:[ |
819 thumbFrameColor notNil ifTrue:[ |
817 self paint:thumbFrameColor. |
820 self paint:thumbFrameColor. |
818 self displayRectangle:thumbFrame. |
821 self displayRectangle:thumbFrame. |
819 ]. |
822 ]. |
820 ^ self |
823 ^ self |
821 ]. |
824 ]. |
822 |
825 |
823 "what a kludge - must be a parameter to drawEdge..." |
826 "what a kludge - must be a parameter to drawEdge..." |
824 self drawEdgesForX:l y:t width:w height:h level:thumbLevel |
827 self drawEdgesForX:l y:t width:w height:h level:thumbLevel |
825 shadow:thumbShadowColor light:thumbLightColor |
828 shadow:thumbShadowColor light:thumbLightColor |
826 halfShadow:thumbHalfShadowColor halfLight:thumbHalfLightColor |
829 halfShadow:thumbHalfShadowColor halfLight:thumbHalfLightColor |
827 style:thumbEdgeStyle. |
830 style:thumbEdgeStyle. |
828 |
831 |
829 thumbFrameColor notNil ifTrue:[ |
832 thumbFrameColor notNil ifTrue:[ |
830 self paint:thumbFrameColor. |
833 self paint:thumbFrameColor. |
831 orientation == #vertical ifTrue:[ |
834 orientation == #vertical ifTrue:[ |
832 self displayRectangleX:l y:t width:w"-1" height:h. |
835 self displayRectangleX:l y:t width:w"-1" height:h. |
833 ] ifFalse:[ |
836 ] ifFalse:[ |
834 self displayRectangleX:l y:t width:w height:h"-1". |
837 self displayRectangleX:l y:t width:w height:h"-1". |
835 ] |
838 ] |
836 ]. |
839 ]. |
837 |
840 |
838 (tallyLevel == 0 or:[tallyMarks == 0]) ifTrue:[ |
841 (tallyLevel == 0 or:[tallyMarks == 0]) ifTrue:[ |
839 shadowForm notNil ifTrue:[ |
842 shadowForm notNil ifTrue:[ |
840 handleX := l + ((w - 8) // 2). |
843 handleX := l + ((w - 8) // 2). |
841 handleY := t + ((h - 8) // 2). |
844 handleY := t + ((h - 8) // 2). |
842 self drawHandleFormAtX:handleX y:handleY |
845 self drawHandleFormAtX:handleX y:handleY |
843 ]. |
846 ]. |
844 ^ self |
847 ^ self |
845 ]. |
848 ]. |
846 |
849 |
847 "iris style - draw tallys" |
850 "iris style - draw tallys" |
848 |
851 |
849 tallyLevel > 0 ifTrue:[ |
852 tallyLevel > 0 ifTrue:[ |
850 color1 := thumbLightColor. |
853 color1 := thumbLightColor. |
851 color2 := thumbShadowColor. |
854 color2 := thumbShadowColor. |
852 ] ifFalse:[ |
855 ] ifFalse:[ |
853 color1 := thumbShadowColor. |
856 color1 := thumbShadowColor. |
854 color2 := thumbLightColor. |
857 color2 := thumbLightColor. |
855 ]. |
858 ]. |
856 |
859 |
857 "draw tally marks" |
860 "draw tally marks" |
858 |
861 |
859 (orientation == #vertical) ifTrue:[ |
862 (orientation == #vertical) ifTrue:[ |
860 self paint:color1. |
863 self paint:color1. |
861 y := t + (h // 2) - 1. |
864 y := t + (h // 2) - 1. |
862 xL := l + thumbLevel - 1. |
865 xL := l + thumbLevel - 1. |
863 xR := l + w - thumbLevel "+ 1". |
866 xR := l + w - thumbLevel "+ 1". |
864 self displayLineFromX:xL y:y toX:xR y:y. |
867 self displayLineFromX:xL y:y toX:xR y:y. |
865 y := y + 1. |
868 y := y + 1. |
866 self paint:color2. |
869 self paint:color2. |
867 self displayLineFromX:xL y:y toX:xR y:y. |
870 self displayLineFromX:xL y:y toX:xR y:y. |
868 |
871 |
869 tallyMarks > 1 ifTrue:[ |
872 tallyMarks > 1 ifTrue:[ |
870 "dont draw other marks if there is not enough space" |
873 "dont draw other marks if there is not enough space" |
871 |
874 |
872 mm := device verticalPixelPerMillimeter rounded. |
875 mm := device verticalPixelPerMillimeter rounded. |
873 h > (mm * (tallyMarks * 2)) ifTrue:[ |
876 h > (mm * (tallyMarks * 2)) ifTrue:[ |
874 y := y - 1 - mm. |
877 y := y - 1 - mm. |
875 self paint:color1. |
878 self paint:color1. |
876 self displayLineFromX:xL y:y toX:xR y:y. |
879 self displayLineFromX:xL y:y toX:xR y:y. |
877 y := y + 1. |
880 y := y + 1. |
878 self paint:color2. |
881 self paint:color2. |
879 self displayLineFromX:xL y:y toX:xR y:y. |
882 self displayLineFromX:xL y:y toX:xR y:y. |
880 |
883 |
881 y := y - 1 + mm + mm. |
884 y := y - 1 + mm + mm. |
882 self paint:color1. |
885 self paint:color1. |
883 self displayLineFromX:xL y:y toX:xR y:y. |
886 self displayLineFromX:xL y:y toX:xR y:y. |
884 y := y + 1. |
887 y := y + 1. |
885 self paint:color2. |
888 self paint:color2. |
886 self displayLineFromX:xL y:y toX:xR y:y |
889 self displayLineFromX:xL y:y toX:xR y:y |
887 ] |
890 ] |
888 ] |
891 ] |
889 ] ifFalse:[ |
892 ] ifFalse:[ |
890 x := l + (w // 2) - 1. |
893 x := l + (w // 2) - 1. |
891 yT := t + thumbLevel - 1. |
894 yT := t + thumbLevel - 1. |
892 yB := t + h - thumbLevel "+ 1". |
895 yB := t + h - thumbLevel "+ 1". |
893 self paint:color1. |
896 self paint:color1. |
894 self displayLineFromX:x y:yT toX:x y:yB. |
897 self displayLineFromX:x y:yT toX:x y:yB. |
895 self paint:color2. |
898 self paint:color2. |
896 x := x + 1. |
899 x := x + 1. |
897 self displayLineFromX:x y:yT toX:x y:yB. |
900 self displayLineFromX:x y:yT toX:x y:yB. |
898 |
901 |
899 tallyMarks > 1 ifTrue:[ |
902 tallyMarks > 1 ifTrue:[ |
900 "dont draw other marks if there is not enough space" |
903 "dont draw other marks if there is not enough space" |
901 |
904 |
902 mm := device horizontalPixelPerMillimeter rounded. |
905 mm := device horizontalPixelPerMillimeter rounded. |
903 w > (mm * (tallyMarks * 2)) ifTrue:[ |
906 w > (mm * (tallyMarks * 2)) ifTrue:[ |
904 x := x - 1 - mm. |
907 x := x - 1 - mm. |
905 self paint:color1. |
908 self paint:color1. |
906 self displayLineFromX:x y:yT toX:x y:yB. |
909 self displayLineFromX:x y:yT toX:x y:yB. |
907 x := x + 1. |
910 x := x + 1. |
908 self paint:color2. |
911 self paint:color2. |
909 self displayLineFromX:x y:yT toX:x y:yB. |
912 self displayLineFromX:x y:yT toX:x y:yB. |
910 |
913 |
911 x := x - 1 + mm + mm. |
914 x := x - 1 + mm + mm. |
912 self paint:color1. |
915 self paint:color1. |
913 self displayLineFromX:x y:yT toX:x y:yB. |
916 self displayLineFromX:x y:yT toX:x y:yB. |
914 x := x + 1. |
917 x := x + 1. |
915 self paint:color2. |
918 self paint:color2. |
916 self displayLineFromX:x y:yT toX:x y:yB |
919 self displayLineFromX:x y:yT toX:x y:yB |
917 ] |
920 ] |
918 ] |
921 ] |
919 ] |
922 ] |
|
923 |
|
924 "Modified: 6.3.1996 / 17:27:43 / cg" |
920 ! |
925 ! |
921 |
926 |
922 drawThumbBackgroundInX:x y:y width:w height:h |
927 drawThumbBackgroundInX:x y:y width:w height:h |
923 "draw part of the thumbs background; defined as a separate |
928 "draw part of the thumbs background; defined as a separate |
924 method, to allow drawing of arbitrary patterns under thumb |
929 method, to allow drawing of arbitrary patterns under thumb |
955 buttonMotion:state x:x y:y |
960 buttonMotion:state x:x y:y |
956 "mouse-button was moved while pressed; |
961 "mouse-button was moved while pressed; |
957 redraw thumb at its new position and, if scroll-mode is asynchronous, |
962 redraw thumb at its new position and, if scroll-mode is asynchronous, |
958 the scroll action is performed" |
963 the scroll action is performed" |
959 |
964 |
960 |pos curr limit prevOrigin newOrigin| |
965 |pos curr limit prevOrigin newOrigin in| |
961 |
966 |
962 scrolling ifFalse: [^ self]. "should not happen" |
967 scrolling ifFalse: [ |
963 |
968 self highlightThumbForPointerX:x y:y. |
|
969 ^ self |
|
970 ]. |
|
971 |
|
972 entered := true. |
964 frameBeforeMove isNil ifTrue:[ |
973 frameBeforeMove isNil ifTrue:[ |
965 (ghostColor notNil |
974 (ghostColor notNil |
966 or:[ghostFrameColor notNil |
975 or:[ghostFrameColor notNil |
967 or:[ghostLevel ~~ 0]]) ifTrue:[ |
976 or:[ghostLevel ~~ 0]]) ifTrue:[ |
968 frameBeforeMove := thumbFrame insetBy:1@1 |
977 frameBeforeMove := thumbFrame insetBy:1@1 |
969 ] |
978 ] |
970 ]. |
979 ]. |
971 |
980 |
972 (orientation == #vertical) ifTrue:[ |
981 (orientation == #vertical) ifTrue:[ |
973 curr := y. |
982 curr := y. |
974 limit := height |
983 limit := height |
975 ] ifFalse:[ |
984 ] ifFalse:[ |
976 curr := x. |
985 curr := x. |
977 limit := width |
986 limit := width |
978 ]. |
987 ]. |
979 |
988 |
980 (curr < 0) ifTrue:[ "check against limits" |
989 (curr < 0) ifTrue:[ "check against limits" |
981 pos := 0 |
990 pos := 0 |
982 ] ifFalse:[ |
991 ] ifFalse:[ |
983 (curr > limit) ifTrue:[ |
992 (curr > limit) ifTrue:[ |
984 pos := limit |
993 pos := limit |
985 ] ifFalse:[ |
994 ] ifFalse:[ |
986 pos := curr |
995 pos := curr |
987 ] |
996 ] |
988 ]. |
997 ]. |
989 |
998 |
990 prevOrigin := self thumbOrigin. |
999 prevOrigin := self thumbOrigin. |
991 newOrigin := self percentFromAbs:(pos - pressOffset). |
1000 newOrigin := self percentFromAbs:(pos - pressOffset). |
992 prevOrigin ~= newOrigin ifTrue:[ |
1001 prevOrigin ~= newOrigin ifTrue:[ |
993 self thumbOrigin:newOrigin. |
1002 self thumbOrigin:newOrigin. |
994 |
1003 |
995 synchronousOperation ifTrue: [ |
1004 synchronousOperation ifTrue: [ |
996 self tellOthers. |
1005 self tellOthers. |
997 ] |
1006 ] |
998 ] |
1007 ] |
|
1008 |
|
1009 "Modified: 6.3.1996 / 17:35:26 / cg" |
999 ! |
1010 ! |
1000 |
1011 |
1001 buttonMultiPress:button x:x y:y |
1012 buttonMultiPress:button x:x y:y |
1002 ^ self buttonPress:button x:x y:y |
1013 ^ self buttonPress:button x:x y:y |
1003 ! |
1014 ! |
1202 "initialize style dep. stuff" |
1264 "initialize style dep. stuff" |
1203 |
1265 |
1204 super initStyle. |
1266 super initStyle. |
1205 |
1267 |
1206 DefaultViewBackground notNil ifTrue:[ |
1268 DefaultViewBackground notNil ifTrue:[ |
1207 viewBackground := DefaultViewBackground on:device. |
1269 viewBackground := DefaultViewBackground on:device. |
1208 ]. |
1270 ]. |
1209 DefaultShadowColor notNil ifTrue:[ |
1271 DefaultShadowColor notNil ifTrue:[ |
1210 shadowColor := DefaultShadowColor on:device. |
1272 shadowColor := DefaultShadowColor on:device. |
1211 ]. |
1273 ]. |
1212 DefaultLightColor notNil ifTrue:[ |
1274 DefaultLightColor notNil ifTrue:[ |
1213 lightColor := DefaultLightColor on:device. |
1275 lightColor := DefaultLightColor on:device. |
1214 ]. |
1276 ]. |
1215 |
1277 |
1216 tallyMarks := DefaultTallyMarks. |
1278 tallyMarks := DefaultTallyMarks. |
1217 tallyLevel := DefaultTallyLevel. |
1279 tallyLevel := DefaultTallyLevel. |
1218 DefaultLevel ~~ level ifTrue:[ |
1280 DefaultLevel ~~ level ifTrue:[ |
1219 self level:DefaultLevel. |
1281 self level:DefaultLevel. |
1220 ]. |
1282 ]. |
1221 DefaultBorderWidth ~~ borderWidth ifTrue:[ |
1283 DefaultBorderWidth ~~ borderWidth ifTrue:[ |
1222 self borderWidth:DefaultBorderWidth. |
1284 self borderWidth:DefaultBorderWidth. |
1223 ]. |
1285 ]. |
1224 thumbLevel := DefaultThumbLevel. |
1286 thumbLevel := DefaultThumbLevel. |
1225 inset := DefaultInset. |
1287 inset := DefaultInset. |
1226 fixThumbHeight := DefaultFixThumbHeight. |
1288 fixThumbHeight := DefaultFixThumbHeight. |
1227 thumbEdgeStyle := DefaultEdgeStyle. |
1289 thumbEdgeStyle := DefaultEdgeStyle. |
1228 |
1290 |
1229 DefaultGhostColor notNil ifTrue:[ |
1291 DefaultGhostColor notNil ifTrue:[ |
1230 ghostColor := DefaultGhostColor on:device. |
1292 ghostColor := DefaultGhostColor on:device. |
1231 ]. |
1293 ]. |
1232 DefaultGhostFrameColor notNil ifTrue:[ |
1294 DefaultGhostFrameColor notNil ifTrue:[ |
1233 ghostFrameColor := DefaultGhostFrameColor on:device. |
1295 ghostFrameColor := DefaultGhostFrameColor on:device. |
1234 ]. |
1296 ]. |
1235 ghostLevel := DefaultGhostLevel. |
1297 ghostLevel := DefaultGhostLevel. |
1236 |
1298 |
1237 DefaultThumbFrameColor notNil ifTrue:[ |
1299 DefaultThumbFrameColor notNil ifTrue:[ |
1238 thumbFrameColor := DefaultThumbFrameColor on:device. |
1300 thumbFrameColor := DefaultThumbFrameColor on:device. |
1239 ]. |
1301 ]. |
1240 DefaultThumbShadowColor notNil ifTrue:[ |
1302 DefaultThumbShadowColor notNil ifTrue:[ |
1241 thumbShadowColor := DefaultThumbShadowColor |
1303 thumbShadowColor := DefaultThumbShadowColor |
1242 ] ifFalse:[ |
1304 ] ifFalse:[ |
1243 thumbShadowColor := shadowColor. |
1305 thumbShadowColor := shadowColor. |
1244 ]. |
1306 ]. |
1245 DefaultThumbLightColor notNil ifTrue:[ |
1307 DefaultThumbLightColor notNil ifTrue:[ |
1246 thumbLightColor := DefaultThumbLightColor |
1308 thumbLightColor := DefaultThumbLightColor |
1247 ] ifFalse:[ |
1309 ] ifFalse:[ |
1248 thumbLightColor := lightColor. |
1310 thumbLightColor := lightColor. |
1249 ]. |
1311 ]. |
1250 |
1312 |
1251 thumbEdgeStyle notNil ifTrue:[ |
1313 thumbEdgeStyle notNil ifTrue:[ |
1252 DefaultThumbHalfShadowColor notNil ifTrue:[ |
1314 DefaultThumbHalfShadowColor notNil ifTrue:[ |
1253 thumbHalfShadowColor := DefaultThumbHalfShadowColor |
1315 thumbHalfShadowColor := DefaultThumbHalfShadowColor |
1254 ]. |
1316 ]. |
1255 DefaultThumbHalfLightColor notNil ifTrue:[ |
1317 DefaultThumbHalfLightColor notNil ifTrue:[ |
1256 thumbHalfLightColor := DefaultThumbHalfLightColor |
1318 thumbHalfLightColor := DefaultThumbHalfLightColor |
1257 ]. |
1319 ]. |
1258 ]. |
1320 ]. |
1259 |
1321 |
1260 device hasGreyscales ifFalse:[ |
1322 device hasGreyscales ifFalse:[ |
1261 thumbEdgeStyle notNil ifTrue:[ |
1323 thumbEdgeStyle notNil ifTrue:[ |
1262 thumbHalfShadowColor := Color darkGrey. |
1324 thumbHalfShadowColor := Color darkGrey. |
1263 thumbHalfLightColor := White |
1325 thumbHalfLightColor := White |
1264 ]. |
1326 ]. |
1265 |
1327 |
1266 thumbShadowColor := Black. |
1328 thumbShadowColor := Black. |
1267 "/ thumbLightColor := White. |
1329 "/ thumbLightColor := White. |
1268 |
1330 |
1269 styleSheet name = #motif ifTrue:[ |
1331 styleSheet name = #motif ifTrue:[ |
1270 DefaultThumbColor isNil ifTrue:[ |
1332 DefaultThumbColor isNil ifTrue:[ |
1271 thumbColor := White . |
1333 thumbColor := White . |
1272 ]. |
1334 ]. |
1273 ] |
1335 ] |
1274 ]. |
1336 ]. |
1275 |
1337 |
1276 DefaultThumbColor notNil ifTrue:[ |
1338 DefaultThumbColor notNil ifTrue:[ |
1277 thumbColor := DefaultThumbColor on:device |
1339 thumbColor := DefaultThumbColor on:device |
1278 ] ifFalse:[ |
1340 ] ifFalse:[ |
1279 thumbColor := White. |
1341 thumbColor := White. |
1280 styleSheet name ~= #normal ifTrue:[ |
1342 styleSheet name ~= #normal ifTrue:[ |
1281 device hasGreyscales ifFalse:[ |
1343 device hasGreyscales ifFalse:[ |
1282 thumbColor := Color grey |
1344 thumbColor := Color grey |
1283 ]. |
1345 ]. |
1284 ]. |
1346 ]. |
1285 ]. |
1347 ]. |
1286 |
1348 |
1287 thumbColor := thumbColor on:device. |
1349 thumbColor := thumbColor on:device. |
1288 thumbShadowColor notNil ifTrue:[ |
1350 thumbShadowColor notNil ifTrue:[ |
1289 thumbShadowColor := thumbShadowColor on:device. |
1351 thumbShadowColor := thumbShadowColor on:device. |
1290 ]. |
1352 ]. |
1291 thumbLightColor notNil ifTrue:[ |
1353 thumbLightColor notNil ifTrue:[ |
1292 thumbLightColor := thumbLightColor on:device. |
1354 thumbLightColor := thumbLightColor on:device. |
1293 ]. |
1355 ]. |
1294 thumbHalfShadowColor notNil ifTrue:[ |
1356 thumbHalfShadowColor notNil ifTrue:[ |
1295 thumbHalfShadowColor := thumbHalfShadowColor on:device. |
1357 thumbHalfShadowColor := thumbHalfShadowColor on:device. |
1296 ]. |
1358 ]. |
1297 thumbHalfLightColor notNil ifTrue:[ |
1359 thumbHalfLightColor notNil ifTrue:[ |
1298 thumbHalfLightColor := thumbHalfLightColor on:device. |
1360 thumbHalfLightColor := thumbHalfLightColor on:device. |
1299 ]. |
1361 ]. |
1300 thumbEdgeStyle notNil ifTrue:[ |
1362 thumbEdgeStyle notNil ifTrue:[ |
1301 thumbHalfShadowColor isNil ifTrue:[ |
1363 thumbHalfShadowColor isNil ifTrue:[ |
1302 thumbHalfShadowColor := thumbShadowColor lightened on:device |
1364 thumbHalfShadowColor := thumbShadowColor lightened on:device |
1303 ] |
1365 ] |
|
1366 ]. |
|
1367 |
|
1368 DefaultThumbEnteredColor notNil ifTrue:[ |
|
1369 thumbEnteredColor := DefaultThumbEnteredColor on:device. |
|
1370 self enableMotionEvents. |
|
1371 self enableEnterLeaveEvents. |
|
1372 ] ifFalse:[ |
|
1373 thumbEnteredColor := thumbColor. |
1304 ]. |
1374 ]. |
1305 |
1375 |
1306 styleSheet name = #next ifTrue:[ |
1376 styleSheet name = #next ifTrue:[ |
1307 shadowForm := self class handleShadowFormOn:device. |
1377 shadowForm := self class handleShadowFormOn:device. |
1308 lightForm := self class handleLightFormOn:device |
1378 lightForm := self class handleLightFormOn:device |
1309 ] ifFalse:[ |
1379 ] ifFalse:[ |
1310 shadowForm := lightForm := nil |
1380 shadowForm := lightForm := nil |
1311 ]. |
1381 ]. |
1312 |
1382 |
1313 drawableId notNil ifTrue:[ |
1383 drawableId notNil ifTrue:[ |
1314 self computeThumbFrame |
1384 self computeThumbFrame |
1315 ] |
1385 ] |
|
1386 |
|
1387 "Modified: 6.3.1996 / 17:31:35 / cg" |
1316 ! |
1388 ! |
1317 |
1389 |
1318 initialize |
1390 initialize |
1319 "initialize - setup instvars from defaults" |
1391 "initialize - setup instvars from defaults" |
1320 |
1392 |
1321 super initialize. |
1393 super initialize. |
1322 |
1394 |
1323 orientation := #vertical. |
1395 orientation := #vertical. |
1324 |
1396 |
1325 scrolling := false. |
1397 scrolling := false. |
|
1398 entered := false. |
1326 synchronousOperation := true. |
1399 synchronousOperation := true. |
1327 |
1400 |
1328 thumbOrigin := 0. |
1401 thumbOrigin := 0. |
1329 thumbHeight := 100. |
1402 thumbHeight := 100. |
1330 thumbFrameSizeDifference := 0. |
1403 thumbFrameSizeDifference := 0. |