[FIX] Bug in GraphicalMenu>>#initializeFor:withForms:coexist:
David N. Smith (IBM)
dnsmith at watson.ibm.com
Fri Feb 4 19:27:33 UTC 2000
There is a bug in GraphicalMenu>>#initializeFor:withForms:coexist: in the example in the first comment. No big deal. The same code is inline and attached.
Dave
'From Squeak2.7 of 5 January 2000 [latest update: #1789] on 4 February 2000 at 2:17:53 pm'!
!GraphicalMenu methodsFor: 'as yet unclassified' stamp: 'dns 2/4/2000 14:17'!
initializeFor: aTarget withForms: formList coexist: aBoolean
" World primaryHand attachMorph: (GraphicalMenu new initializeFor: nil
withForms: Form allInstances coexist: true) "
| buttons b anIndex buttonCage imageWrapper |
target _ aTarget.
coexistWithOriginal _ aBoolean.
color _ Color white.
borderColor _ Color blue darker.
borderWidth _ 1.
formChoices _ formList.
currentIndex _ 1.
self hResizing: #shrinkWrap; vResizing: #shrinkWrap.
b _ SimpleButtonMorph new target: self; borderColor: Color black.
buttons _ AlignmentMorph newRow.
buttons borderWidth: 0; inset: 0.
buttons hResizing: #shrinkWrap; vResizing: #shrinkWrap; extent: 5 at 5.
buttons centering: #topLeft.
buttonCage _ AlignmentMorph newColumn.
buttonCage hResizing: #shrinkWrap; vResizing: #spaceFill.
buttonCage addTransparentSpacerOfSize: (0 @ 10).
buttons addMorphBack: (b fullCopy label: 'Prev'; actionSelector: #downArrowHit; actWhen: #buttonDown).
buttons addTransparentSpacerOfSize: (5 at 0).
buttons addMorphBack: (b fullCopy label: 'Next'; actionSelector: #upArrowHit; actWhen: #buttonDown).
buttons addTransparentSpacerOfSize: (5 at 0).
buttons addUpDownArrowsFor: self.
buttons submorphs last color: Color white.
buttonCage addMorphBack: buttons.
buttonCage addTransparentSpacerOfSize: (0 @ 12).
buttons _ AlignmentMorph newRow.
buttons addMorphBack: (b fullCopy label: 'OK'; actionSelector: #okay).
buttons addTransparentSpacerOfSize: (5 at 0).
buttons addMorphBack: (b fullCopy label: 'Cancel'; actionSelector: #cancel).
buttonCage addMorphBack: buttons.
buttonCage addTransparentSpacerOfSize: (0 @ 10).
self addMorphFront: buttonCage.
imageWrapper _ Morph new color: Color transparent; extent: 102 @ 82.
imageWrapper addMorphBack: (formDisplayMorph _ ImageMorph new extent: 100 @ 100).
self addMorphBack: imageWrapper.
target ifNotNil: [(anIndex _ formList indexOf: target form ifAbsent: [nil]) ifNotNil:
[currentIndex _ anIndex]].
self updateThumbnail! !
-------------- next part --------------
Skipped content of type multipart/appledouble-------------- next part --------------
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author
and not of his employer.
More information about the Squeak-dev
mailing list
|