]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Fixed heap corruption when reading a corrupted RLE TGA image.
[wxWidgets.git] / src / common / wincmn.cpp
index 337f86e330a21173079315b8f18e561fab85c833..76aca9086ced6730870a90f38b7b1d3d73716242 100644 (file)
@@ -127,8 +127,9 @@ END_EVENT_TABLE()
 // separately otherwise chaos occurs. Right now easiest is to test for negative ids, 
 // as windows with negative ids never can be recreated anyway
 
+
 bool wxWindowStreamingCallback( const wxObject *object, wxObjectWriter *, 
-                               wxObjectReaderCallback *, wxVariantBaseArray & )
+                               wxObjectWriterCallback *, const wxStringToAnyHashMap & )
 {
     const wxWindow * win = wx_dynamic_cast(const wxWindow*, object);
     if ( win && win->GetId() < 0 )
@@ -144,9 +145,9 @@ wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxWindow, wxWindowBase, "wx/window.h", \
 wxCOLLECTION_TYPE_INFO( wxWindow*, wxWindowList );
 
 template<> void wxCollectionToVariantArray( wxWindowList const &theList, 
-                                           wxVariantBaseArray &value)
+                                           wxAnyList &value)
 {
-    wxListCollectionToVariantArray<wxWindowList::compatibility_iterator>( theList, value );
+    wxListCollectionToAnyList<wxWindowList::compatibility_iterator>( theList, value );
 }
 
 wxDEFINE_FLAGS( wxWindowStyle )
@@ -215,9 +216,9 @@ wxPROPERTY( BackgroundColour, wxColour, SetBackgroundColour, GetBackgroundColour
            wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group")) // bg
 wxPROPERTY( ForegroundColour, wxColour, SetForegroundColour, GetForegroundColour, \
            wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group")) // fg
-wxPROPERTY( Enabled, bool, Enable, IsEnabled, wxVariantBase((bool)true), 0 /*flags*/, \
+wxPROPERTY( Enabled, bool, Enable, IsEnabled, wxAny((bool)true), 0 /*flags*/, \
            wxT("Helpstring"), wxT("group"))
-wxPROPERTY( Shown, bool, Show, IsShown, wxVariantBase((bool)true), 0 /*flags*/, \
+wxPROPERTY( Shown, bool, Show, IsShown, wxAny((bool)true), 0 /*flags*/, \
            wxT("Helpstring"), wxT("group"))
 
 #if 0
@@ -2599,6 +2600,44 @@ void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
         Show(event.GetShown());
 }
 
+// ----------------------------------------------------------------------------
+// Idle processing
+// ----------------------------------------------------------------------------
+
+// Send idle event to window and all subwindows
+bool wxWindowBase::SendIdleEvents(wxIdleEvent& event)
+{
+    bool needMore = false;
+
+    OnInternalIdle();
+
+    // should we send idle event to this window?
+    if (wxIdleEvent::GetMode() == wxIDLE_PROCESS_ALL ||
+        HasExtraStyle(wxWS_EX_PROCESS_IDLE))
+    {
+        event.SetEventObject(this);
+        HandleWindowEvent(event);
+
+        if (event.MoreRequested())
+            needMore = true;
+    }
+    wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+    for (; node; node = node->GetNext())
+    {
+        wxWindow* child = node->GetData();
+        if (child->SendIdleEvents(event))
+            needMore = true;
+    }
+
+    return needMore;
+}
+
+void wxWindowBase::OnInternalIdle()
+{
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
+        UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
+}
+
 // ----------------------------------------------------------------------------
 // dialog units translations
 // ----------------------------------------------------------------------------