[squeak-dev] The Trunk: Graphics-dtl.96.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Dec 28 19:04:02 UTC 2009
David T. Lewis uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-dtl.96.mcz
==================== Summary ====================
Name: Graphics-dtl.96
Author: dtl
Time: 28 December 2009, 1:59:32 am
UUID: 0929fe05-6f03-4429-a5fb-4c0c17f836e7
Ancestors: Graphics-nice.95
Remove #isMorphic sends from Rectangle, supported by #pointerMoved in Project and MorphicProject.
=============== Diff against Graphics-nice.95 ===============
Item was changed:
----- Method: Rectangle>>newRectFrom: (in category 'transforming') -----
newRectFrom: newRectBlock
"Track the outline of a new rectangle until mouse button changes.
newFrameBlock produces each new rectangle from the previous"
+ | rect newRect buttonStart buttonNow delay |
- | rect newRect buttonStart buttonNow aHand delay |
delay := Delay forMilliseconds: 10.
buttonStart := buttonNow := Sensor anyButtonPressed.
rect := self.
Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
[buttonNow == buttonStart] whileTrue:
[delay wait.
buttonNow := Sensor anyButtonPressed.
newRect := newRectBlock value: rect.
newRect = rect ifFalse:
[Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
Display border: newRect width: 2 rule: Form reverse fillColor: Color gray.
rect := newRect]].
Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
+ Project current pointerMoved.
- " pay the price for reading the sensor directly ; get this party started "
- Smalltalk isMorphic
- ifTrue: [aHand := World activeHand.
- aHand newMouseFocus: nil;
- showTemporaryCursor: nil;
- flushEvents].
Sensor processEvent: Sensor createMouseEvent.
^ rect!
Item was changed:
----- Method: Rectangle>>newRectButtonPressedDo: (in category 'transforming') -----
newRectButtonPressedDo: newRectBlock
"Track the outline of a new rectangle until mouse button
changes. newFrameBlock produces each new rectangle from the
previous. Only tracks while mouse is down."
+ | rect newRect buttonNow delay |
- | rect newRect buttonNow aHand delay |
delay := Delay forMilliseconds: 10.
buttonNow := Sensor anyButtonPressed.
rect := self.
Display
border: rect
width: 2
rule: Form reverse
fillColor: Color gray.
[buttonNow]
whileTrue: [delay wait.
buttonNow := Sensor anyButtonPressed.
newRect := newRectBlock value: rect.
newRect = rect
ifFalse: [Display
border: rect
width: 2
rule: Form reverse
fillColor: Color gray.
Display
border: newRect
width: 2
rule: Form reverse
fillColor: Color gray.
rect := newRect]].
Display
border: rect
width: 2
rule: Form reverse
fillColor: Color gray.
+ Project current pointerMoved.
- " pay the price for reading the sensor directly ; get this party started "
- Smalltalk isMorphic
- ifTrue: [aHand := World activeHand.
- aHand newMouseFocus: nil;
- showTemporaryCursor: nil;
- flushEvents].
Sensor processEvent: Sensor createMouseEvent.
^ rect!
More information about the Squeak-dev
mailing list
|