1 Delta define: #PreferenceModifier as: (
\r
2 (Class subclassOf: 'PreferenceCaching |> VisualWrapper' instanceVariables: 'prefsBlock <[PreferenceModifier]>
\r
3 "Is called whenever the preferences need to be computed. The block takes the receiver
\r
4 as its argumetn, and should compute
\r
5 the min,max, and natural, and use the #natural:min:max: message to store
\r
6 them in the receiver."
\r
7 gridBlock <[PreferenceModifier,Point, ^Rectangle]>
\r
10 (Delta mirrorFor: #PreferenceModifier) revision: '$Revision: 1.1 $'!
\r
12 (Delta mirrorFor: #PreferenceModifier) group: 'ui'!
\r
14 (Delta mirrorFor: #PreferenceModifier)
\r
16 'Modifies the preferences of its child based on a block that computes the new
\r
21 (c) 1995-1997 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
\r
22 Use and distribution of this software is subject to the terms of the attached source license. $Revision: 1.1
\r
25 ! (Delta mirrorFor: #PreferenceModifier) methodsFor: 'accessing' !
\r
28 continuousGridFor: p <Point> ^<Rect>
\r
30 "This method is here to make the inherited method public"
\r
31 ^super continuousGridFor: p!
\r
33 gridBlock ^<[PreferenceModifier,Point, ^Rectangle]>
\r
37 gridBlock: b <[PreferenceModifier,Point, ^Rectangle]>
\r
41 natural: nat <Region> min: mn <Region> max: mx <Region>
\r
43 self natural: nat; min: mn; max: mx!
\r
45 newNatural: nat <Rect>
\r
46 "This sets the prefsBlock to one that changes the natural size of the child only. The min and max are left the
\r
47 same, other than making sure that min <= natural <= max."
\r
50 [ :pm <PreferenceModifier> |
\r
53 min: (pm part min enclosingRect intersect: nat)
\r
54 max: (pm part max enclosingRect merge: nat).
\r
57 prefsBlock ^<[PreferenceModifier]>
\r
61 prefsBlock: blk <[PreferenceModifier]>
\r
63 prefsBlock := blk! !
\r
65 ! (Delta mirrorFor: #PreferenceModifier) methodsFor: 'private' !
\r
70 self prefsBlock value: self!
\r
72 skipCheckLayout ^<Boolean>
\r
76 ! (Delta mirrorFor: #PreferenceModifier) methodsFor: 'initialization' !
\r
83 [ :pm <PreferenceModifier> |
\r
84 pm natural: pm part natural
\r
88 [ :pm <PreferenceModifier> :loc <Point> |
\r
89 pm part gridFor: loc ]! !
\r