]> git.saurik.com Git - wxWidgets.git/commitdiff
Add the new showOnIdle code to various other
authorRobert Roebling <robert@roebling.de>
Tue, 22 Aug 2006 21:50:28 +0000 (21:50 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 22 Aug 2006 21:50:28 +0000 (21:50 +0000)
    widget which override OnInternalIdle().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/window.h
src/gtk/checkbox.cpp
src/gtk/listbox.cpp
src/gtk/radiobox.cpp
src/gtk/textctrl.cpp
src/gtk/tglbtn.cpp
src/gtk/window.cpp

index 28caf3d004fda51bddcf6a1eb1fdb8ee4129fca0..fb02d8304f1993c8346a5a8afc4a166ff487ad79 100644 (file)
@@ -182,6 +182,9 @@ public:
     // until idle time. This partly mimmicks defered
     // sizing under MSW.
     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),
index 4b7adcc2087486119004a25bdd9fe3a6fda46a89..c03eefa9c3f5cd266b191377e2a151585930c00a 100644 (file)
@@ -232,6 +232,9 @@ bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window )
 
 void wxCheckBox::OnInternalIdle()
 {
+    // Check if we have to show window now
+    if (GtkShowFromOnIdle()) return;
+    
     wxCursor cursor = m_cursor;
     if (g_globalCursor.Ok()) cursor = g_globalCursor;
 
index beb8d7d33644dc4be83b01942ebd88943f31dbab..ea26d531e16ca5e233b6c623c265f8e81be14a50 100644 (file)
@@ -1100,7 +1100,9 @@ void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style)
 
 void wxListBox::OnInternalIdle()
 {
-    //RN: Is this needed anymore?
+    // Check if we have to show window now
+    if (GtkShowFromOnIdle()) return;
+
     wxCursor cursor = m_cursor;
     if (g_globalCursor.Ok()) cursor = g_globalCursor;
 
index f38936d468c46fdfb1bdc33f689f46bf577a709b..7af0bde3dd342e39f495fef2c3a1f42573b1f2eb 100644 (file)
@@ -659,6 +659,9 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
 
 void wxRadioBox::OnInternalIdle()
 {
+    // Check if we have to show window now
+    if (GtkShowFromOnIdle()) return;
+    
     if ( m_lostFocus )
     {
         m_hasFocus = false;
@@ -678,6 +681,9 @@ void wxRadioBox::OnInternalIdle()
             SetFocus();
         }
     }
+
+    if (wxUpdateUIEvent::CanUpdate(this))
+        UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
 // static
index b9671b28503b39c6ff6b36340a35d66476145b8e..81615950a6b84e84c241a63c2763e5e2d951119b 100644 (file)
@@ -1678,6 +1678,9 @@ void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event)
 
 void wxTextCtrl::OnInternalIdle()
 {
+    // Check if we have to show window now
+    if (GtkShowFromOnIdle()) return;
+
     if (g_delayedFocus == this)
     {
         if (GTK_WIDGET_REALIZED(m_widget))
@@ -1686,7 +1689,7 @@ void wxTextCtrl::OnInternalIdle()
             g_delayedFocus = NULL;
         }
     }
-
+    
     if (wxUpdateUIEvent::CanUpdate(this))
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
index abadbcc404d78c695ace4a060aa9a9cc8951e291..a7a7b479261dbb0d860a950def367290369f68af 100644 (file)
@@ -181,6 +181,9 @@ bool wxToggleBitmapButton::IsOwnGtkWindow(GdkWindow *window)
 
 void wxToggleBitmapButton::OnInternalIdle()
 {
+    // Check if we have to show window now
+    if (GtkShowFromOnIdle()) return;
+    
     wxCursor cursor = m_cursor;
 
     if (g_globalCursor.Ok())
index 9c07784a6905027ee1178fa8531467e7544d3f52..d94f9f2b0a837231003843c6e9178906a44c4a6d 100644 (file)
@@ -2959,22 +2959,8 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
     m_resizing = false;
 }
 
-void wxWindowGTK::OnInternalIdle()
+bool wxWindowGTK::GtkShowFromOnIdle()
 {
-    if ( m_dirtyTabOrder )
-    {
-        m_dirtyTabOrder = false;
-        RealizeTabOrder();
-    }
-
-    // Update style if the window was not yet realized
-    // and SetBackgroundStyle(wxBG_STYLE_CUSTOM) was called
-    if (m_needsStyleChange)
-    {
-        SetBackgroundStyle(GetBackgroundStyle());
-        m_needsStyleChange = false;
-    }
-
     if (IsShown() && m_showOnIdle && !GTK_WIDGET_VISIBLE (m_widget))
     {
         GtkAllocation alloc;
@@ -2988,8 +2974,31 @@ void wxWindowGTK::OnInternalIdle()
         eventShow.SetEventObject(this);
         GetEventHandler()->ProcessEvent(eventShow);
         m_showOnIdle = false;
-        return;
+        return true;
     }
+    
+    return false;
+}
+
+void wxWindowGTK::OnInternalIdle()
+{
+    // Check if we have to show window now
+    if (GtkShowFromOnIdle()) return;
+
+    if ( m_dirtyTabOrder )
+    {
+        m_dirtyTabOrder = false;
+        RealizeTabOrder();
+    }
+
+    // Update style if the window was not yet realized
+    // and SetBackgroundStyle(wxBG_STYLE_CUSTOM) was called
+    if (m_needsStyleChange)
+    {
+        SetBackgroundStyle(GetBackgroundStyle());
+        m_needsStyleChange = false;
+    }
+    
     // Update invalidated regions.
     GtkUpdate();