EVT_ENTER_WINDOW while LeftIsDown()
Eran Ifrah
eran.ifrah at gmail.com
Thu Apr 3 06:54:04 PDT 2008
Hi Vaidm,
I commented the entire 'OnLeftDown' function, so its code looks like this:
void wxVerticalTab::OnLeftDown(wxMouseEvent &e)
{
e.Skip();
}
The OnEnterWindow:
void wxVerticalTab::OnMouseEnterWindow(wxMouseEvent &e)
{
wxLogMessage(wxT("OnMouseEnterWindow entered"));
if (e.LeftIsDown()) {
wxTabContainer *parent =3D dynamic_cast<wxTabContainer*>( GetParent=
()
);
if (parent) {
parent->SwapTabs(this);
}
}
e.Skip();
}
the behavior is still the same.
I only get the "OnMouseEnterWindow entered" message when the mouse is not
pressed while entering the window.
I also tried to add code for OnMouseLeaveWindow(), and in it I placed the
following code:
OnMouseLeaveWindow(wxMouseEvent &e)
{
if(HasCapture()) {
wxLogMessage(wxT("Releasing mouse"));
ReleaseMouse();
}
e.Skip()
}
Unfortunately, the 'ReleaseMouse()' is never called
Eran
On Thu, Apr 3, 2008 at 3:57 PM, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
> On Thu, 3 Apr 2008 12:00:12 +0300 Eran Ifrah <eran.ifrah at gmail.com> wrote:
>
> EI> OS: Linux, Ubuntu 7.10
> EI> WX: 2.87 Unicode Monolithic
> EI>
> EI> In my application, if have several classes derived from wxPanel placed
> EI> inside a vertical sizer.
> EI>
> EI> Each derived class, handles the following mouse events:
> EI>
> EI> EVT_ENTER_WINDOW
> EI> EVT_LEAVE_WINDOW
> EI> EVT_LEFT_UP
> EI> EVT_LEFT_DOWN
> EI>
> EI> When the mouse left button is pressed - I correctly receive the
> EI> EVT_LEFT_DOWN event, but if I now start to move the cursor to the next
> EI> window in the sizer while the left button is still pressed, the event
> EI> EVT_ENTER_WINDOW is never captured. However, the EVT_LEAVE_WINDOW is
> EI> properly captured.
>
> What do you do in your EVT_LEFT_DOWN handler? In particular, do you call
> event.Skip() or not?
>
> EI> Of course this works correctly if the mouse is not being pressed while
> EI> entering the Window.
> EI>
> EI> The problem occurs only on Linux, on Windows it works fine.
> EI>
> EI> Any ideas?
>
> I suspect that the mouse could be captured by the default handler but
> it's
> just this, an idea, unencumbered by any experimental confirmation.
>
> Regards,
> VZ
>
> --
> TT-Solutions: wxWidgets consultancy and technical support
> http://www.tt-solutions.com/
>
> _______________________________________________
> wx-users mailing list
> wx-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users
>
-- =
Eran Ifrah
eran.ifrah at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080403/41d=
69a0d/attachment.htm
More information about the wx-users
mailing list