<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 16, 2015 at 3:16 PM, Tobias Pape <span dir="ltr"><<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 16.04.2015, at 11:54, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:<br>
<br>
> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:<br>
> <a href="http://source.squeak.org/trunk/Morphic-mt.886.mcz" target="_blank">http://source.squeak.org/trunk/Morphic-mt.886.mcz</a><br>
><br>
> ==================== Summary ====================<br>
><br>
> Name: Morphic-mt.886<br>
> Author: mt<br>
> Time: 16 April 2015, 1:54:44.817 pm<br>
> UUID: 18559879-ba01-5e4b-a89a-06fc842be3d7<br>
> Ancestors: Morphic-mt.885<br>
><br>
> Fixes position of user dialogs if no position is provided. Ensures to use the actual mouse cursor position.<br>
><br>
> =============== Diff against Morphic-mt.885 ===============<br>
><br>
> Item was changed:<br>
> ----- Method: UserDialogBoxMorph>>runModalIn:forHand:at: (in category 'running') -----<br>
> runModalIn: aWorld forHand: aHand at: aPointOrNil<br>
> "Ensure that we have a reasonable minimum size"<br>
> | oldFocus pos offset |<br>
> (ProvideAnswerNotification signal: self label asString) ifNotNil:[:answer| ^answer].<br>
> self openInWorld: aWorld.<br>
> + pos := aPointOrNil ifNil: [<br>
> + "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."<br>
> + Sensor cursorPoint].<br>
<br>
</span>I am not really happy with the direct access to Sensor here.<br>
What about<br>
<br>
self activeHand position<br>
<br>
<br>
or probably<br>
self activeHand lastEvent cursorPoint<br>
<br>
? Isn't this info up-to-date?<br></blockquote><div><br></div><div>The info is not up to date, the mouse position is where the mouse down / up happened that started the update process.</div><div><br></div><div>Karl</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best<br>
<span class="HOEnZb"><font color="#888888"> -Tobias<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> - pos := aPointOrNil ifNil: [aHand position].<br>
> offset := aPointOrNil<br>
> ifNil: [selectedButton fullBounds origin - (selectedButton fullBounds extent // 2 * (-1@1))]<br>
> ifNotNil: [self fullBounds extent // 2].<br>
> self setConstrainedPosition: pos - offset hangOut: false.<br>
> oldFocus := aHand keyboardFocus.<br>
> aHand newMouseFocus: self.<br>
> aHand newKeyboardFocus: self.<br>
> savedLabel := selectedButton label.<br>
> [self isInWorld] whileTrue:[aWorld doOneSubCycle].<br>
> oldFocus ifNotNil:[aHand keyboardFocus: oldFocus].<br>
> ^value!<br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>