'From Squeak3.6beta of ''4 July 2003'' [latest update: #5411] on 21 October 2003 at 6:17:44 pm'! "Change Set: SlowResizeCPU-JMM Date: 21 October 2003 Author: johnmci@smalltalkconsulting.com In the browser window CPU usage would go to 100% when we enter the resize pane area, or resize the pane. This was due to zero step time for NewHandleMorph a subclass of HandleMorph which looks at cursor location to change the cursor shape. Change step time to 10 ms in HandleMorph to solve this. Then issue is at actual resize time CPU usage goes to 100%. Issue in resize retangle logic (three places) where it watchs the cursor. Change to delay for 10 ms between cursor lookups"! !HandleMorph methodsFor: 'testing' stamp: 'JMM 10/21/2003 18:15'! stepTime "Update every hundredth of a second." ^ 10 ! ! !Rectangle methodsFor: 'transforming' stamp: 'JMM 10/21/2003 17:26'! 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 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. " 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! ! !Rectangle methodsFor: 'transforming' stamp: 'JMM 10/21/2003 17:28'! 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 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. " 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! ! !View methodsFor: 'miscellaneous' stamp: 'JMM 10/21/2003 18:12'! stretchFrame: newFrameBlock startingWith: startFrame "Track the outline of a newFrame as long as mouse drags it. Maintain max and min constraints throughout the drag" | frame newFrame click delay | delay _ Delay forMilliseconds: 10. frame _ startFrame origin extent: ((startFrame extent min: self maximumSize) max: self minimumSize). Display border: frame width: 2 rule: Form reverse fillColor: Color gray. click _ false. [click and: [Sensor noButtonPressed]] whileFalse: [delay wait. click _ click | Sensor anyButtonPressed. newFrame _ newFrameBlock value: frame. newFrame _ newFrame topLeft extent: ((newFrame extent min: self maximumSize) max: self minimumSize). newFrame = frame ifFalse: [Display border: frame width: 2 rule: Form reverse fillColor: Color gray. Display border: newFrame width: 2 rule: Form reverse fillColor: Color gray. frame _ newFrame]]. Display border: frame width: 2 rule: Form reverse fillColor: Color gray. ^ frame! !