don't just drop click events resulting from triple clicks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-02-09 23:28:13 +00:00
parent d41f7b2041
commit f3f0d961af
3 changed files with 57 additions and 44 deletions

View File

@@ -172,6 +172,7 @@ wxGTK:
- fixed mouse wheel handling under GTK2 (Hugh Fisher) - fixed mouse wheel handling under GTK2 (Hugh Fisher)
- wxNotebook::HitTest() implemented (Daniel Lundqvist) - wxNotebook::HitTest() implemented (Daniel Lundqvist)
- memory leaks fixes in wxFileDialog (John Labenski) - memory leaks fixes in wxFileDialog (John Labenski)
- don't drop click events from triple clicks (Frode Solheim)
wxMac: wxMac:

View File

@@ -1539,46 +1539,52 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
if (gdk_event->button == 1) if (gdk_event->button == 1)
{ {
// note that GDK generates triple click events which are not supported
// by wxWindows but still have to be passed to the app as otherwise
// clicks would simply go missing
switch (gdk_event->type) switch (gdk_event->type)
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_LEFT_DOWN; break; case GDK_3BUTTON_PRESS: // we could also map this to DCLICK...
case GDK_2BUTTON_PRESS: event_type = wxEVT_LEFT_DCLICK; break; case GDK_BUTTON_PRESS:
case GDK_3BUTTON_PRESS: return FALSE; event_type = wxEVT_LEFT_DOWN;
default: break; break;
case GDK_2BUTTON_PRESS:
event_type = wxEVT_LEFT_DCLICK;
break;
} }
} }
else if (gdk_event->button == 2) else if (gdk_event->button == 2)
{ {
switch (gdk_event->type) switch (gdk_event->type)
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_MIDDLE_DOWN; break; case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: event_type = wxEVT_MIDDLE_DCLICK; break; event_type = wxEVT_MIDDLE_DOWN;
default: break; break;
case GDK_2BUTTON_PRESS:
event_type = wxEVT_MIDDLE_DCLICK;
break;
} }
} }
else if (gdk_event->button == 3) else if (gdk_event->button == 3)
{ {
switch (gdk_event->type) switch (gdk_event->type)
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_RIGHT_DOWN; break; case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: event_type = wxEVT_RIGHT_DCLICK; break; event_type = wxEVT_RIGHT_DOWN;
default: break; break;
case GDK_2BUTTON_PRESS:
event_type = wxEVT_RIGHT_DCLICK;
break;
} }
} }
else if (gdk_event->button == 4) else if (gdk_event->button == 4 || gdk_event->button == 5)
{ {
switch (gdk_event->type) if (gdk_event->type == GDK_BUTTON_PRESS )
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_MOUSEWHEEL; break; event_type = wxEVT_MOUSEWHEEL;
default: break;
}
}
else if (gdk_event->button == 5)
{
switch (gdk_event->type)
{
case GDK_BUTTON_PRESS: event_type = wxEVT_MOUSEWHEEL; break;
default: break;
} }
} }

View File

@@ -1539,46 +1539,52 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
if (gdk_event->button == 1) if (gdk_event->button == 1)
{ {
// note that GDK generates triple click events which are not supported
// by wxWindows but still have to be passed to the app as otherwise
// clicks would simply go missing
switch (gdk_event->type) switch (gdk_event->type)
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_LEFT_DOWN; break; case GDK_3BUTTON_PRESS: // we could also map this to DCLICK...
case GDK_2BUTTON_PRESS: event_type = wxEVT_LEFT_DCLICK; break; case GDK_BUTTON_PRESS:
case GDK_3BUTTON_PRESS: return FALSE; event_type = wxEVT_LEFT_DOWN;
default: break; break;
case GDK_2BUTTON_PRESS:
event_type = wxEVT_LEFT_DCLICK;
break;
} }
} }
else if (gdk_event->button == 2) else if (gdk_event->button == 2)
{ {
switch (gdk_event->type) switch (gdk_event->type)
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_MIDDLE_DOWN; break; case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: event_type = wxEVT_MIDDLE_DCLICK; break; event_type = wxEVT_MIDDLE_DOWN;
default: break; break;
case GDK_2BUTTON_PRESS:
event_type = wxEVT_MIDDLE_DCLICK;
break;
} }
} }
else if (gdk_event->button == 3) else if (gdk_event->button == 3)
{ {
switch (gdk_event->type) switch (gdk_event->type)
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_RIGHT_DOWN; break; case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: event_type = wxEVT_RIGHT_DCLICK; break; event_type = wxEVT_RIGHT_DOWN;
default: break; break;
case GDK_2BUTTON_PRESS:
event_type = wxEVT_RIGHT_DCLICK;
break;
} }
} }
else if (gdk_event->button == 4) else if (gdk_event->button == 4 || gdk_event->button == 5)
{ {
switch (gdk_event->type) if (gdk_event->type == GDK_BUTTON_PRESS )
{ {
case GDK_BUTTON_PRESS: event_type = wxEVT_MOUSEWHEEL; break; event_type = wxEVT_MOUSEWHEEL;
default: break;
}
}
else if (gdk_event->button == 5)
{
switch (gdk_event->type)
{
case GDK_BUTTON_PRESS: event_type = wxEVT_MOUSEWHEEL; break;
default: break;
} }
} }