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
This commit is contained in:
Robert Roebling
2009-02-13 10:00:22 +00:00
parent 4dfa17210f
commit 71ead4bf23
5 changed files with 14 additions and 27 deletions

View File

@@ -221,23 +221,17 @@ public:
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
// Called when a window should delay showing itself // Called when a window should delay showing itself
// until idle time. This partly mimmicks defered // until idle time used in Reparent().
// sizing under MSW. void GTKShowOnIdle() { m_showOnIdle = true; }
void GtkShowOnIdle() { m_showOnIdle = true; }
// This is called from the various OnInternalIdle methods // This is called from the various OnInternalIdle methods
bool GtkShowFromOnIdle(); 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)) { }
// is this window transparent for the mouse events (as wxStaticBox is)? // 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 // Common scroll event handling code for wxWindow and wxScrollBar
wxEventType GetScrollEventType(GtkRange* range); wxEventType GTKGetScrollEventType(GtkRange* range);
// position and size of the window // position and size of the window
int m_x, m_y; int m_x, m_y;

View File

@@ -320,7 +320,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t widget_new,
void wxControl::OnInternalIdle() void wxControl::OnInternalIdle()
{ {
if ( GtkShowFromOnIdle() ) if ( GTKShowFromOnIdle() )
return; return;
if ( GTK_WIDGET_REALIZED(m_widget) ) if ( GTK_WIDGET_REALIZED(m_widget) )

View File

@@ -28,7 +28,7 @@ extern "C" {
static void static void
gtk_value_changed(GtkRange* range, wxScrollBar* win) gtk_value_changed(GtkRange* range, wxScrollBar* win)
{ {
wxEventType eventType = win->GetScrollEventType(range); wxEventType eventType = win->GTKGetScrollEventType(range);
if (eventType != wxEVT_NULL) if (eventType != wxEVT_NULL)
{ {
const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL; const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL;

View File

@@ -696,7 +696,7 @@ void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
void wxToolBar::OnInternalIdle() void wxToolBar::OnInternalIdle()
{ {
// Check if we have to show window now // Check if we have to show window now
if (GtkShowFromOnIdle()) return; if (GTKShowFromOnIdle()) return;
wxCursor cursor = m_cursor; wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;

View File

@@ -1156,7 +1156,7 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
if (!child->IsShown()) if (!child->IsShown())
continue; continue;
if (child->IsTransparentForMouse()) if (child->GTKIsTransparentForMouse())
{ {
// wxStaticBox is transparent in the box itself // wxStaticBox is transparent in the box itself
int xx1 = child->m_x; int xx1 = child->m_x;
@@ -1368,10 +1368,6 @@ gtk_window_button_press_callback( GtkWidget *widget,
AdjustEventButtonState(event); 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 // 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 // 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. // their own X window and thus cannot get any events.
@@ -1418,7 +1414,7 @@ gtk_window_button_press_callback( GtkWidget *widget,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static gboolean static gboolean
gtk_window_button_release_callback( GtkWidget *widget, gtk_window_button_release_callback( GtkWidget *WXUNUSED(widget),
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
{ {
@@ -1454,9 +1450,6 @@ gtk_window_button_release_callback( GtkWidget *widget,
AdjustEventButtonState(event); AdjustEventButtonState(event);
// same wxListBox hack as above
win->FixUpMouseEvent(widget, event.m_x, event.m_y);
if ( !g_captureWindow ) if ( !g_captureWindow )
win = FindWindowForMouseEvent(win, event.m_x, event.m_y); win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
@@ -1751,7 +1744,7 @@ gtk_window_leave_callback( GtkWidget *widget,
static void static void
gtk_scrollbar_value_changed(GtkRange* range, wxWindow* win) gtk_scrollbar_value_changed(GtkRange* range, wxWindow* win)
{ {
wxEventType eventType = win->GetScrollEventType(range); wxEventType eventType = win->GTKGetScrollEventType(range);
if (eventType != wxEVT_NULL) if (eventType != wxEVT_NULL)
{ {
// Convert scroll event type to scrollwin event type // 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)) if (IsShown() && m_showOnIdle && !GTK_WIDGET_VISIBLE (m_widget))
{ {
@@ -2576,7 +2569,7 @@ void wxWindowGTK::OnInternalIdle()
GTKHandleDeferredFocusOut(); GTKHandleDeferredFocusOut();
// Check if we have to show window now // Check if we have to show window now
if (GtkShowFromOnIdle()) return; if (GTKShowFromOnIdle()) return;
if ( m_dirtyTabOrder ) if ( m_dirtyTabOrder )
{ {
@@ -4218,7 +4211,7 @@ static inline bool IsScrollIncrement(double increment, double x)
return fabs(increment - fabs(x)) < tolerance; 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]); wxASSERT(range == m_scrollBar[0] || range == m_scrollBar[1]);