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

karl ramberg karlramberg at gmail.com
Thu Apr 16 19:21:02 UTC 2015


On Thu, Apr 16, 2015 at 3:16 PM, Tobias Pape <Das.Linux at gmx.de> wrote:

>
> 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?
>

The info is not up to date, the mouse position is where the mouse down / up
happened that started the update process.

Karl

>
> 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!
> >
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20150416/7abd76a3/attachment.htm


More information about the Squeak-dev mailing list