X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f313deaa38ebd9d8a9a2755a105e12999dd5493c..fdfedfc07701a1db96b8217321b09bd19808ac24:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 337f86e330..76aca9086c 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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( theList, value ); + wxListCollectionToAnyList( 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 // ----------------------------------------------------------------------------