[squeak-dev] The Trunk: Morphic-mt.886.mcz

Tobias Pape Das.Linux at gmx.de
Thu Apr 16 13:16:40 UTC 2015


On 16.04.2015, at 11:54, commits at source.squeak.org wrote:

> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-mt.886.mcz
> 
> ==================== Summary ====================
> 
> Name: Morphic-mt.886
> Author: mt
> Time: 16 April 2015, 1:54:44.817 pm
> UUID: 18559879-ba01-5e4b-a89a-06fc842be3d7
> Ancestors: Morphic-mt.885
> 
> Fixes position of user dialogs if no position is provided. Ensures to use the actual mouse cursor position.
> 
> =============== Diff against Morphic-mt.885 ===============
> 
> Item was changed:
>  ----- Method: UserDialogBoxMorph>>runModalIn:forHand:at: (in category 'running') -----
>  runModalIn: aWorld forHand: aHand at: aPointOrNil
>  	"Ensure that we have a reasonable minimum size"
>  	| oldFocus pos offset |
>  	(ProvideAnswerNotification signal: self label asString) ifNotNil:[:answer| ^answer].
>  	self openInWorld: aWorld.
> + 	pos := aPointOrNil ifNil: [
> + 		"If called after a longer UI operation, be sure to use the current mouse cursor. Hand position is not up-to-date. Do one world cycle does not help if there are currently no mouse events. So, we *have to be* this extreme."
> + 		Sensor cursorPoint].

I am not really happy with the direct access to Sensor here.
What about

	self activeHand position


or probably 
	self activeHand lastEvent cursorPoint

? Isn't this info up-to-date?

Best
	-Tobias


> - 	pos := aPointOrNil ifNil: [aHand position].   
>  	offset := aPointOrNil
>  		ifNil: [selectedButton fullBounds origin - (selectedButton fullBounds extent // 2 * (-1 at 1))]
>  		ifNotNil: [self fullBounds extent // 2].
>  	self setConstrainedPosition: pos - offset hangOut: false.
>  	oldFocus := aHand keyboardFocus.
>  	aHand newMouseFocus: self.
>  	aHand newKeyboardFocus: self.
>  	savedLabel := selectedButton label.
>  	[self isInWorld] whileTrue:[aWorld doOneSubCycle].
>  	oldFocus ifNotNil:[aHand keyboardFocus: oldFocus].
>  	^value!
> 
> 



More information about the Squeak-dev mailing list