wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
// hack: we need something to pass to gtk_menu_popup, so we store the time of
-// the last click here
+// the last click here (extern: used from gtk/menu.cpp)
#ifndef __WXGTK20__
-static guint32 gs_timeLastClick = 0;
+guint32 wxGtkTimeLastClick = 0;
#endif
extern bool g_mainThreadLocked;
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
#ifndef __WXGTK20__
- gs_timeLastClick = gdk_event->time;
+ wxGtkTimeLastClick = gdk_event->time;
if (event_type == wxEVT_LEFT_DCLICK)
{
return wxWindow::FindFocus();
}
+
+wxMouseState wxGetMouseState()
+{
+ wxMouseState ms;
+
+ gint x;
+ gint y;
+ GdkModifierType mask;
+
+ gdk_window_get_pointer(NULL, &x, &y, &mask);
+
+ ms.SetX(x);
+ ms.SetY(y);
+ ms.SetLeftDown(mask & GDK_BUTTON1_MASK);
+ ms.SetMiddleDown(mask & GDK_BUTTON2_MASK);
+ ms.SetRightDown(mask & GDK_BUTTON3_MASK);
+
+ ms.SetControlDown(mask & GDK_CONTROL_MASK);
+ ms.SetShiftDown(mask & GDK_SHIFT_MASK);
+ ms.SetAltDown(mask & GDK_MOD1_MASK);
+ ms.SetMetaDown(mask & GDK_MOD2_MASK);
+
+ return ms;
+}
+
//-----------------------------------------------------------------------------
// wxWindowGTK
//-----------------------------------------------------------------------------
}
+// Needed for implementing e.g. combobox on wxGTK within a modal dialog.
+void wxAddGrab(wxWindow* window)
+{
+ gtk_grab_add( (GtkWidget*) window->GetHandle() );
+}
+
+void wxRemoveGrab(wxWindow* window)
+{
+ gtk_grab_remove( (GtkWidget*) window->GetHandle() );
+}
+
// ----------------------------------------------------------------------------
-// wxDCModule
+// wxWinModule
// ----------------------------------------------------------------------------
class wxWinModule : public wxModule
gdk_gc_unref( g_eraseGC );
}
-// vi:sts=4:sw=4:et