18 SimpleView subclass:#VariablePanel |
18 SimpleView subclass:#VariablePanel |
19 instanceVariableNames:'barHeight barWidth barLevel separatingLine shadowForm lightForm |
19 instanceVariableNames:'barHeight barWidth barLevel separatingLine shadowForm lightForm |
20 showHandle showHandleWhenEntered handlePosition handleColor |
20 showHandle showHandleWhenEntered handlePosition handleColor |
21 handleStyle handleLevel noColor trackLine redrawLocked |
21 handleStyle handleLevel noColor trackLine redrawLocked |
22 orientation handleLabels knobHeight realRelativeSizes |
22 orientation handleLabels knobHeight realRelativeSizes |
23 snapAdornment' |
23 snapAdornment barSideLineColor' |
24 classVariableNames:'DefaultShowHandle DefaultHandleStyle DefaultHandlePosition |
24 classVariableNames:'DefaultShowHandle DefaultHandleStyle DefaultHandlePosition |
25 DefaultTrackingLine DefaultSeparatingLine DefaultHandleColor |
25 DefaultTrackingLine DefaultSeparatingLine DefaultHandleColor |
26 DefaultHandleLevel DefaultVCursor DefaultHCursor |
26 DefaultHandleLevel DefaultVCursor DefaultHCursor |
27 DefaultHandleImage DefaultSnapIcons DefaultSnapHandlePosition |
27 DefaultHandleImage DefaultSnapIcons DefaultSnapHandlePosition |
28 DefaultShowHandleWhenEntered' |
28 DefaultShowHandleWhenEntered DefaultSideLineColor DefaultBarWidth |
|
29 DefaultBackgroundColor' |
29 poolDictionaries:'' |
30 poolDictionaries:'' |
30 category:'Views-Layout' |
31 category:'Views-Layout' |
31 ! |
32 ! |
32 |
33 |
33 Object subclass:#SnapAdornment |
34 Object subclass:#SnapAdornment |
738 #'variablePanel.handleLevel' |
739 #'variablePanel.handleLevel' |
739 #'variablePanel.snapHandlePosition' |
740 #'variablePanel.snapHandlePosition' |
740 #'variablePanel.trackingLine' |
741 #'variablePanel.trackingLine' |
741 #'variablePanel.trackingStyle' |
742 #'variablePanel.trackingStyle' |
742 #'variablePanel.separatingLine' |
743 #'variablePanel.separatingLine' |
743 #'variablePanel.handleColor')> |
744 #'variablePanel.handleColor' |
|
745 #'variablePanel.backgroundColor' |
|
746 #'variablePanel.barSideLineColor')> |
744 |
747 |
745 |lineModeBoolean| |
748 |lineModeBoolean| |
746 |
749 |
747 DefaultSnapIcons := nil. |
750 DefaultSnapIcons := nil. |
748 DefaultVCursor := DefaultHCursor := nil. |
751 DefaultVCursor := DefaultHCursor := nil. |
1973 |
1979 |
1974 redrawHandlesFrom:start to:stop |
1980 redrawHandlesFrom:start to:stop |
1975 "redraw some handles and snaps" |
1981 "redraw some handles and snaps" |
1976 |
1982 |
1977 subViews size ~~ 0 ifTrue:[ |
1983 subViews size ~~ 0 ifTrue:[ |
1978 showHandle ifTrue:[ |
1984 (showHandle or:[barSideLineColor notNil]) ifTrue:[ |
1979 self handleOriginsWithIndexFrom:start to:stop do:[:hPoint :hIndex | |
1985 self handleOriginsWithIndexFrom:start to:stop do:[:hPoint :hIndex | |
1980 |hx hy| |
1986 |hx hy| |
1981 |
1987 |
1982 hx := hPoint x. |
1988 hx := hPoint x. |
1983 hy := hPoint y. |
1989 hy := hPoint y. |
|
1990 |
1984 barLevel notNil ifTrue:[ |
1991 barLevel notNil ifTrue:[ |
1985 self drawEdgesForX:0 y:hy width:width height:barHeight level:barLevel. |
1992 self drawEdgesForX:0 y:hy width:width height:barHeight level:barLevel. |
|
1993 ] ifFalse:[ |
|
1994 barSideLineColor notNil ifTrue:[ |
|
1995 self paint:barSideLineColor. |
|
1996 self isHorizontal ifTrue:[ |
|
1997 self displayLineFromX:0 y:0 toX:width-1 y:0. |
|
1998 self displayLineFromX:0 y:barHeight-1 toX:width-1 y:barHeight-1. |
|
1999 ] ifFalse:[ |
|
2000 self displayLineFromX:0 y:0 toX:0 y:height-1. |
|
2001 self displayLineFromX:width-1 y:0 toX:width-1 y:height-1. |
|
2002 ]. |
|
2003 ]. |
1986 ]. |
2004 ]. |
1987 |
2005 |
1988 "/ do not draw handle, if there is a snapper ... |
2006 "/ do not draw handle, if there is a snapper ... |
1989 self hasSnapHandle ifTrue:[ |
2007 self hasSnapHandle ifTrue:[ |
1990 self drawSnapAt:hIndex-1 |
2008 self drawSnapAt:hIndex-1 |
2020 |
2038 |
2021 !VariablePanel methodsFor:'event handling'! |
2039 !VariablePanel methodsFor:'event handling'! |
2022 |
2040 |
2023 pointerEnter:buttonState x:x y:y |
2041 pointerEnter:buttonState x:x y:y |
2024 "/ not called - see controller |
2042 "/ not called - see controller |
2025 showHandleWhenEntered == true ifTrue:[ |
2043 showHandleWhenEntered ifTrue:[ |
2026 self showHandle:true |
2044 self showHandle:true |
2027 ]. |
2045 ]. |
2028 super pointerEnter:buttonState x:x y:y. |
2046 super pointerEnter:buttonState x:x y:y. |
2029 |
2047 |
2030 "Created: / 19-12-2010 / 09:29:51 / cg" |
2048 "Created: / 19-12-2010 / 09:29:51 / cg" |
2031 "Modified (comment): / 22-10-2018 / 23:39:46 / Claus Gittinger" |
2049 "Modified (comment): / 22-10-2018 / 23:39:46 / Claus Gittinger" |
2032 ! |
2050 ! |
2033 |
2051 |
2034 pointerLeave:buttonState |
2052 pointerLeave:buttonState |
2035 "/ not called - see controller |
2053 "/ not called - see controller |
2036 showHandleWhenEntered == true ifTrue:[ |
2054 showHandleWhenEntered ifTrue:[ |
2037 self showHandle:false |
2055 self showHandle:false |
2038 ]. |
2056 ]. |
2039 super pointerLeave:buttonState. |
2057 super pointerLeave:buttonState. |
2040 |
2058 |
2041 "Created: / 19-12-2010 / 09:30:20 / cg" |
2059 "Created: / 19-12-2010 / 09:30:20 / cg" |
2132 ! |
2150 ! |
2133 |
2151 |
2134 initStyle |
2152 initStyle |
2135 "setup viewStyle specifics" |
2153 "setup viewStyle specifics" |
2136 |
2154 |
2137 |mm| |
2155 |mm computedBarWidth| |
2138 |
2156 |
2139 super initStyle. |
2157 super initStyle. |
2140 |
2158 |
|
2159 viewBackground := DefaultBackgroundColor ? viewBackground. |
2141 handleColor := DefaultHandleColor onDevice:device. |
2160 handleColor := DefaultHandleColor onDevice:device. |
2142 |
2161 |
2143 DefaultHandleStyle isNil ifTrue:[ |
2162 DefaultHandleStyle isNil ifTrue:[ |
2144 handleStyle := styleSheet name |
2163 handleStyle := styleSheet name |
2145 ] ifFalse:[ |
2164 ] ifFalse:[ |
2146 handleStyle := DefaultHandleStyle |
2165 handleStyle := DefaultHandleStyle |
2147 ]. |
2166 ]. |
2148 |
2167 |
2149 handleLevel := DefaultHandleLevel. |
2168 handleLevel := DefaultHandleLevel. |
2150 showHandle := DefaultShowHandle. |
2169 showHandle := DefaultShowHandle. |
2151 showHandleWhenEntered := DefaultShowHandleWhenEntered. |
2170 showHandleWhenEntered := DefaultShowHandleWhenEntered ? false. |
2152 handlePosition := DefaultHandlePosition. |
2171 handlePosition := DefaultHandlePosition. |
2153 "/ snapHandlePosition := DefaultSnapHandlePosition. |
2172 "/ snapHandlePosition := DefaultSnapHandlePosition. |
2154 trackLine := DefaultTrackingLine. |
2173 trackLine := DefaultTrackingLine. |
2155 separatingLine := DefaultSeparatingLine. |
2174 separatingLine := DefaultSeparatingLine. |
2156 |
2175 |
2157 DefaultHandleImage notNil ifTrue:[ |
2176 DefaultHandleImage notNil ifTrue:[ |
2158 shadowForm := DefaultHandleImage onDevice:device. |
2177 shadowForm := DefaultHandleImage onDevice:device. |
2159 barWidth := shadowForm width. |
2178 computedBarWidth := shadowForm width. |
2160 ] ifFalse:[ |
2179 ] ifFalse:[ |
2161 handleStyle == #next ifTrue:[ |
2180 handleStyle == #next ifTrue:[ |
2162 DefaultHandleImage notNil ifTrue:[ |
2181 DefaultHandleImage notNil ifTrue:[ |
2163 shadowForm := DefaultHandleImage onDevice:device. |
2182 shadowForm := DefaultHandleImage onDevice:device. |
2164 ] ifFalse:[ |
2183 ] ifFalse:[ |
2165 shadowForm := self class shadowFormOn:device. |
2184 shadowForm := self class shadowFormOn:device. |
2166 lightForm := self class lightFormOn:device. |
2185 lightForm := self class lightFormOn:device. |
2167 ]. |
2186 ]. |
2168 barWidth := shadowForm width. |
2187 computedBarWidth := shadowForm width. |
2169 ] ifFalse:[ |
2188 ] ifFalse:[ |
2170 shadowForm := lightForm := nil. |
2189 shadowForm := lightForm := nil. |
2171 |
2190 |
2172 mm := device verticalPixelPerMillimeter. |
2191 mm := device verticalPixelPerMillimeter. |
2173 barWidth := (1.5 * mm) rounded. "motif style width" |
2192 computedBarWidth := (1.5 * mm) rounded. "motif style width" |
2174 ]. |
2193 ]. |
2175 ]. |
2194 ]. |
2176 barWidth := styleSheet at:#'variablePanel.barWidth' default:barWidth. |
2195 barWidth := DefaultBarWidth ? computedBarWidth. |
2177 |
2196 barSideLineColor := DefaultSideLineColor. |
|
2197 |
2178 self computeBarHeight. |
2198 self computeBarHeight. |
2179 |
2199 |
2180 handleStyle == #mswindows ifTrue:[ |
2200 handleStyle == #mswindows ifTrue:[ |
2181 barWidth := (ArrowButton new direction:#up) width + 1 |
2201 barWidth := (ArrowButton new direction:#up) width + 1 |
2182 ]. |
2202 ]. |
2183 showHandleWhenEntered == true ifTrue:[ |
2203 showHandleWhenEntered ifTrue:[ |
2184 self enableEnterLeaveEvents |
2204 self enableEnterLeaveEvents |
2185 ]. |
2205 ]. |
2186 |
2206 |
2187 "Modified: / 19-12-2010 / 09:31:29 / cg" |
2207 "Modified: / 19-12-2010 / 09:31:29 / cg" |
2188 "Modified: / 22-10-2018 / 23:32:10 / Claus Gittinger" |
2208 "Modified: / 22-10-2018 / 23:32:10 / Claus Gittinger" |