Re: motion notify event messages.



"Shane Miller" <SMiller1 stvgb org> writes: 
If I hold the left mouse button down over the ENTRY and move my
mouse to the left, I get motion-notify events fired by the Entry.
The x and y coords are based on the mouse postion within that entry
control.  Meaning that if the control was 75 pixels wide and 10 high
and I held the mouse button down over the right-bottom most pixel on
the entry control and moved one pixel to the left, the mouse coord's
reported in motion-notify would be 74,10 or something near that.
 
If I hold the left mouse button down over the BUTTON control and
move my mouse to the left, I get motion-notify events fired by the
button.  The x and y coords are based on the mouse postion within
that FORM instead of the control.  Meaning that if the control was
75 pixels wide and 10 high and it's origin was at 50,50 on the form,
and I held the mouse button down over the right-bottom most pixel on
the button control and moved one pixel to the left, the mouse
coord's reported in motion-notify would be 124,60 or something near
that.

Why is that?  Shouldn't they both report mouse coordinates based on
the mouse position in the FORM or the CONTROL?  Is this a known
issue or have we coded something incorrectly in Lazarus?


Motion coordinates should always be relative to the GdkWindow that was
initially clicked on (or that has the pointer grab). Both entry and
button have a GdkWindow of their own, so coords should be relative to
the widget. If that's not the case then something is wrong.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]