]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/window.cpp
Fixed doubled-up key effects in wxTextCtrl by resetting m_lastMsg to 0
[wxWidgets.git] / src / gtk1 / window.cpp
index 39a203d80476d847e28443880913a74deba41e66..e3a3a49f5d3279ce3b0578802970e25f8b4415a3 100644 (file)
 // conditional compilation
 //-------------------------------------------------------------------------
 
-#if (GTK_MINOR_VERSION == 1)
-#if (GTK_MICRO_VERSION >= 5)
+#if (GTK_MINOR_VERSION > 0)
 #define NEW_GTK_SCROLL_CODE
 #endif
-#endif
 
 //-----------------------------------------------------------------------------
 // (debug)
@@ -171,7 +169,6 @@ void debug_focus_in( GtkWidget* widget, const char* name, const char *window )
 //-----------------------------------------------------------------------------
 
 extern wxList     wxPendingDelete;
-extern wxList     wxTopLevelWindows;
 extern bool       g_blockEventsOnDrag;
 extern bool       g_blockEventsOnScroll;
 static bool       g_capturing = FALSE;
@@ -1081,6 +1078,7 @@ static void gtk_window_vscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
 
     float diff = win->m_vAdjust->value - win->m_oldVerticalPos;
     if (fabs(diff) < 0.2) return;
+    win->m_oldVerticalPos = win->m_vAdjust->value;
 
     wxEventType command = wxEVT_NULL;
 
@@ -1128,6 +1126,7 @@ static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
 
     float diff = win->m_hAdjust->value - win->m_oldHorizontalPos;
     if (fabs(diff) < 0.2) return;
+    win->m_oldHorizontalPos = win->m_hAdjust->value;
 
     wxEventType command = wxEVT_NULL;
 
@@ -1434,7 +1433,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
 
 #ifdef NEW_GTK_SCROLL_CODE
     gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(m_widget), m_wxwindow );
-    GtkViewport *viewport = GTK_VIEWPORT(s_window->child);
+    GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
 #else
     gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
     GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
@@ -1930,7 +1929,7 @@ void wxWindow::DoSetClientSize( int width, int height )
             GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
 
 #ifdef NEW_GTK_SCROLL_CODE
-            GtkWidget *viewport = scroll_window->child;
+            GtkWidget *viewport = GTK_BIN(scroll_window)->child;
 #else
             GtkWidget *viewport = scroll_window->viewport;
 #endif
@@ -1995,7 +1994,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
             GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
 
 #ifdef NEW_GTK_SCROLL_CODE
-            GtkWidget *viewport = scroll_window->child;
+            GtkWidget *viewport = GTK_BIN(scroll_window)->child;
 #else
             GtkWidget *viewport = scroll_window->viewport;
 #endif
@@ -2748,7 +2747,7 @@ void wxWindow::InitDialog()
 static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
 {
     menu->SetInvokingWindow( win );
-    wxNode *node = menu->m_items.First();
+    wxNode *node = menu->GetItems().First();
     while (node)
     {
         wxMenuItem *menuitem = (wxMenuItem*)node->Data();
@@ -2835,7 +2834,9 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
 void wxWindow::SetFont( const wxFont &font )
 {
     wxCHECK_RET( m_widget != NULL, "invalid window" );
-
+    
+    if (m_font == font) return;
+    
     if (((wxFont*)&font)->Ok())
         m_font = font;
     else