From 71ead4bf23e61cec55e4f428fac561fc12b987b9 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 13 Feb 2009 10:00:22 +0000 Subject: [PATCH 1/1] Removed unneeded FixUpMouse() method, some more GTK prefixing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/window.h | 16 +++++----------- src/gtk/control.cpp | 2 +- src/gtk/scrolbar.cpp | 2 +- src/gtk/tbargtk.cpp | 2 +- src/gtk/window.cpp | 19 ++++++------------- 5 files changed, 14 insertions(+), 27 deletions(-) diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index 4cd39e93db..206de1e16a 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -221,23 +221,17 @@ public: #endif // wxUSE_TOOLTIPS // Called when a window should delay showing itself - // until idle time. This partly mimmicks defered - // sizing under MSW. - void GtkShowOnIdle() { m_showOnIdle = true; } + // until idle time used in Reparent(). + void GTKShowOnIdle() { m_showOnIdle = true; } // This is called from the various OnInternalIdle methods - bool GtkShowFromOnIdle(); - - // fix up the mouse event coords, used by wxListBox only so far - virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget), - wxCoord& WXUNUSED(x), - wxCoord& WXUNUSED(y)) { } + bool GTKShowFromOnIdle(); // is this window transparent for the mouse events (as wxStaticBox is)? - virtual bool IsTransparentForMouse() const { return false; } + virtual bool GTKIsTransparentForMouse() const { return false; } // Common scroll event handling code for wxWindow and wxScrollBar - wxEventType GetScrollEventType(GtkRange* range); + wxEventType GTKGetScrollEventType(GtkRange* range); // position and size of the window int m_x, m_y; diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 4b163a3d9c..f69a1dddf3 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -320,7 +320,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t widget_new, void wxControl::OnInternalIdle() { - if ( GtkShowFromOnIdle() ) + if ( GTKShowFromOnIdle() ) return; if ( GTK_WIDGET_REALIZED(m_widget) ) diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index dc832e0b6c..48bf5748ee 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -28,7 +28,7 @@ extern "C" { static void gtk_value_changed(GtkRange* range, wxScrollBar* win) { - wxEventType eventType = win->GetScrollEventType(range); + wxEventType eventType = win->GTKGetScrollEventType(range); if (eventType != wxEVT_NULL) { const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL; diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index 50ec774b72..179f2aecf9 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -696,7 +696,7 @@ void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) void wxToolBar::OnInternalIdle() { // Check if we have to show window now - if (GtkShowFromOnIdle()) return; + if (GTKShowFromOnIdle()) return; wxCursor cursor = m_cursor; if (g_globalCursor.Ok()) cursor = g_globalCursor; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index b89ba436cb..e7b494437a 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1156,7 +1156,7 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y) if (!child->IsShown()) continue; - if (child->IsTransparentForMouse()) + if (child->GTKIsTransparentForMouse()) { // wxStaticBox is transparent in the box itself int xx1 = child->m_x; @@ -1368,10 +1368,6 @@ gtk_window_button_press_callback( GtkWidget *widget, AdjustEventButtonState(event); - // wxListBox actually gets mouse events from the item, so we need to give it - // a chance to correct this - win->FixUpMouseEvent(widget, event.m_x, event.m_y); - // find the correct window to send the event to: it may be a different one // from the one which got it at GTK+ level because some controls don't have // their own X window and thus cannot get any events. @@ -1418,7 +1414,7 @@ gtk_window_button_press_callback( GtkWidget *widget, //----------------------------------------------------------------------------- static gboolean -gtk_window_button_release_callback( GtkWidget *widget, +gtk_window_button_release_callback( GtkWidget *WXUNUSED(widget), GdkEventButton *gdk_event, wxWindowGTK *win ) { @@ -1454,9 +1450,6 @@ gtk_window_button_release_callback( GtkWidget *widget, AdjustEventButtonState(event); - // same wxListBox hack as above - win->FixUpMouseEvent(widget, event.m_x, event.m_y); - if ( !g_captureWindow ) win = FindWindowForMouseEvent(win, event.m_x, event.m_y); @@ -1751,7 +1744,7 @@ gtk_window_leave_callback( GtkWidget *widget, static void gtk_scrollbar_value_changed(GtkRange* range, wxWindow* win) { - wxEventType eventType = win->GetScrollEventType(range); + wxEventType eventType = win->GTKGetScrollEventType(range); if (eventType != wxEVT_NULL) { // Convert scroll event type to scrollwin event type @@ -2549,7 +2542,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags } } -bool wxWindowGTK::GtkShowFromOnIdle() +bool wxWindowGTK::GTKShowFromOnIdle() { if (IsShown() && m_showOnIdle && !GTK_WIDGET_VISIBLE (m_widget)) { @@ -2576,7 +2569,7 @@ void wxWindowGTK::OnInternalIdle() GTKHandleDeferredFocusOut(); // Check if we have to show window now - if (GtkShowFromOnIdle()) return; + if (GTKShowFromOnIdle()) return; if ( m_dirtyTabOrder ) { @@ -4218,7 +4211,7 @@ static inline bool IsScrollIncrement(double increment, double x) return fabs(increment - fabs(x)) < tolerance; } -wxEventType wxWindowGTK::GetScrollEventType(GtkRange* range) +wxEventType wxWindowGTK::GTKGetScrollEventType(GtkRange* range) { wxASSERT(range == m_scrollBar[0] || range == m_scrollBar[1]); -- 2.45.2