From: Vadim Zeitlin Date: Fri, 1 Jun 2012 11:01:24 +0000 (+0000) Subject: Use wxCLASSINFO() instead of deprecated CLASSINFO(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/80a4659776396941bbf7b08615dd60d35dbc47b5 Use wxCLASSINFO() instead of deprecated CLASSINFO(). No real changes, just use the version of the macro with a "wx" prefix. Closes #14356. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/xtihandler.h b/include/wx/xtihandler.h index a36092c217..de4d3e9d21 100644 --- a/include/wx/xtihandler.h +++ b/include/wx/xtihandler.h @@ -94,7 +94,7 @@ private: #define wxHANDLER(name,eventClassType) \ static wxHandlerInfo _handlerInfo##name( first, class_t::GetClassInfoStatic(), \ wxT(#name), (wxObjectEventFunction) (wxEventFunction) &name, \ - CLASSINFO( eventClassType ) ); + wxCLASSINFO( eventClassType ) ); #define wxBEGIN_HANDLERS_TABLE(theClass) \ wxHandlerInfo *theClass::GetHandlersStatic() \ diff --git a/include/wx/xtiprop.h b/include/wx/xtiprop.h index 11b33e3bd5..a79364c9e7 100644 --- a/include/wx/xtiprop.h +++ b/include/wx/xtiprop.h @@ -536,13 +536,13 @@ class WXDLLIMPEXP_FWD_BASE wxStringToAnyHashMap : public wxStringToAnyHashMapBas &_accessor##pname, flags, help, group ); #define wxEVENT_PROPERTY( name, eventType, eventClass ) \ - static wxEventSourceTypeInfo _typeInfo##name( eventType, CLASSINFO( eventClass ) ); \ + static wxEventSourceTypeInfo _typeInfo##name( eventType, wxCLASSINFO( eventClass ) ); \ static wxPropertyInfo _propertyInfo##name( first,class_t::GetClassInfoStatic(), \ wxT(#name), &_typeInfo##name, NULL, wxAny() ); #define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) \ static wxEventSourceTypeInfo _typeInfo##name( eventType, lastEventType, \ - CLASSINFO( eventClass ) ); \ + wxCLASSINFO( eventClass ) ); \ static wxPropertyInfo _propertyInfo##name( first, class_t::GetClassInfoStatic(), \ wxT(#name), &_typeInfo##name, NULL, wxAny() ); diff --git a/src/common/dynload.cpp b/src/common/dynload.cpp index e9febf28cb..4714c64802 100644 --- a/src/common/dynload.cpp +++ b/src/common/dynload.cpp @@ -205,7 +205,7 @@ void wxPluginLibrary::RegisterModules() { for ( const wxClassInfo *info = m_ourFirst; ; info = info->GetNext() ) { - if( info->IsKindOf(CLASSINFO(wxModule)) ) + if( info->IsKindOf(wxCLASSINFO(wxModule)) ) { wxModule *m = wxDynamicCast(info->CreateObject(), wxModule); diff --git a/src/common/mediactrlcmn.cpp b/src/common/mediactrlcmn.cpp index 903e47a3f7..b8cfb5da86 100644 --- a/src/common/mediactrlcmn.cpp +++ b/src/common/mediactrlcmn.cpp @@ -248,8 +248,8 @@ const wxClassInfo* wxMediaCtrl::NextBackend(wxClassInfo::const_iterator* it) *it != end; ++(*it) ) { const wxClassInfo* classInfo = **it; - if ( classInfo->IsKindOf(CLASSINFO(wxMediaBackend)) && - classInfo != CLASSINFO(wxMediaBackend) ) + if ( classInfo->IsKindOf(wxCLASSINFO(wxMediaBackend)) && + classInfo != wxCLASSINFO(wxMediaBackend) ) { ++(*it); return classInfo; diff --git a/src/common/module.cpp b/src/common/module.cpp index 3532ceb149..9274c3b5ac 100644 --- a/src/common/module.cpp +++ b/src/common/module.cpp @@ -56,7 +56,7 @@ void wxModule::RegisterModules() { const wxClassInfo* classInfo = *it; - if ( classInfo->IsKindOf(CLASSINFO(wxModule)) && + if ( classInfo->IsKindOf(wxCLASSINFO(wxModule)) && (classInfo != (& (wxModule::ms_classInfo))) ) { wxLogTrace(TRACE_MODULE, wxT("Registering module %s"), diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index d6d4b9bba1..4ca54a6e75 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -68,7 +68,7 @@ int wxGenericImageList::Add( const wxBitmap &bitmap ) const int index = int(m_images.GetCount()); - if (bitmap.IsKindOf(CLASSINFO(wxIcon))) + if (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) { m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); } @@ -155,7 +155,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ? + wxBitmap* newBitmap = (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) ? #if defined(__VISAGECPP__) //just can't do this in VisualAge now, with all this new Bitmap-Icon stuff //so construct it from a bitmap object until I can figure this nonsense out. (DW) @@ -188,7 +188,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBit wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ? + wxBitmap* newBitmap = (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) ? #if defined(__VISAGECPP__) //just can't do this in VisualAge now, with all this new Bitmap-Icon stuff //so construct it from a bitmap object until I can figure this nonsense out. (DW) @@ -263,7 +263,7 @@ bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, wxBitmap *bm = (wxBitmap*)node->GetData(); - if (bm->IsKindOf(CLASSINFO(wxIcon))) + if (bm->IsKindOf(wxCLASSINFO(wxIcon))) dc.DrawIcon( * ((wxIcon*) bm), x, y); else dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index d76348f29b..11fa7ffcfb 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2208,7 +2208,7 @@ wxTextCtrl *wxListMainWindow::EditLabel(long item, wxClassInfo* textControlClass wxCHECK_MSG( (item >= 0) && ((size_t)item < GetItemCount()), NULL, wxT("wrong index in wxGenericListCtrl::EditLabel()") ); - wxASSERT_MSG( textControlClass->IsKindOf(CLASSINFO(wxTextCtrl)), + wxASSERT_MSG( textControlClass->IsKindOf(wxCLASSINFO(wxTextCtrl)), wxT("EditLabel() needs a text control") ); size_t itemEdit = (size_t)item; diff --git a/src/generic/tabg.cpp b/src/generic/tabg.cpp index 2ce29fd049..9f7f8e092b 100644 --- a/src/generic/tabg.cpp +++ b/src/generic/tabg.cpp @@ -1225,9 +1225,9 @@ wxPanelTabView::wxPanelTabView(wxPanel *pan, long style) m_panel = pan; m_currentWindow = NULL; - if (m_panel->IsKindOf(CLASSINFO(wxTabbedDialog))) + if (m_panel->IsKindOf(wxCLASSINFO(wxTabbedDialog))) ((wxTabbedDialog *)m_panel)->SetTabView(this); - else if (m_panel->IsKindOf(CLASSINFO(wxTabbedPanel))) + else if (m_panel->IsKindOf(wxCLASSINFO(wxTabbedPanel))) ((wxTabbedPanel *)m_panel)->SetTabView(this); SetWindow(m_panel); diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp index 0d59651287..f45ec9c043 100644 --- a/src/gtk/print.cpp +++ b/src/gtk/print.cpp @@ -74,7 +74,7 @@ public: { #if wxUSE_LIBGNOMEPRINT // This module must be initialized AFTER gnomeprint's one - AddDependency(CLASSINFO(wxGnomePrintModule)); + AddDependency(wxCLASSINFO(wxGnomePrintModule)); #endif } bool OnInit(); diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index a41b7e17aa..469d3e68c4 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -61,7 +61,7 @@ static wxGDIImage* ConvertImage( const wxGDIImage& bitmap ) { - bool isIcon = bitmap.IsKindOf( CLASSINFO(wxIcon) ); + bool isIcon = bitmap.IsKindOf( wxCLASSINFO(wxIcon) ); if( !isIcon ) { @@ -99,10 +99,10 @@ bool wxStaticBitmap::Create(wxWindow *parent, // we may have either bitmap or icon: if a bitmap with mask is passed, we // will transform it to an icon ourselves because otherwise the mask will // be ignored by Windows - m_isIcon = bitmap.IsKindOf(CLASSINFO(wxIcon)); + m_isIcon = bitmap.IsKindOf(wxCLASSINFO(wxIcon)); wxGDIImage *image = ConvertImage( bitmap ); - m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) ); + m_isIcon = image->IsKindOf( wxCLASSINFO(wxIcon) ); // create the native control if ( !MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size) ) @@ -243,7 +243,7 @@ void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image) Free(); InvalidateBestSize(); - m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) ); + m_isIcon = image->IsKindOf( wxCLASSINFO(wxIcon) ); // the image has already been copied m_image = image; diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 37d21463a4..1251bd8dc3 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1996,7 +1996,7 @@ void wxTreeCtrl::DeleteTextCtrl() wxTextCtrl *wxTreeCtrl::EditLabel(const wxTreeItemId& item, wxClassInfo *textControlClass) { - wxASSERT( textControlClass->IsKindOf(CLASSINFO(wxTextCtrl)) ); + wxASSERT( textControlClass->IsKindOf(wxCLASSINFO(wxTextCtrl)) ); DeleteTextCtrl(); @@ -2156,7 +2156,7 @@ void wxTreeCtrl::SortChildren(const wxTreeItemId& item) // may be why as if you don't use the DECLARE_CLASS/IMPLEMENT_CLASS // combo for your derived wxTreeCtrl if will sort without // OnCompareItems - if ( GetClassInfo() == CLASSINFO(wxTreeCtrl) ) + if ( GetClassInfo() == wxCLASSINFO(wxTreeCtrl) ) { TreeView_SortChildren(GetHwnd(), HITEM(item), 0); } diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 6a1f9fe6e1..3e3029731f 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -346,7 +346,7 @@ private: virtual bool ProcessEvent( wxEvent& event ) { - if ( event.IsKindOf(CLASSINFO(wxHeaderCtrlEvent)) ) + if ( event.IsKindOf(wxCLASSINFO(wxHeaderCtrlEvent)) ) { wxHeaderCtrlEvent& hcEvent = static_cast(event); diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 1e4f0cdfac..fc1b9e948c 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -500,7 +500,7 @@ void wxPGProperty::InitAfterAdded( wxPropertyGridPageState* pageState, // (so propgrid can be NULL, too). wxPGProperty* parent = m_parent; - bool parentIsRoot = parent->IsKindOf(CLASSINFO(wxPGRootProperty)); + bool parentIsRoot = parent->IsKindOf(wxCLASSINFO(wxPGRootProperty)); // // Convert invalid cells to default ones in this grid @@ -2021,11 +2021,11 @@ const wxPGEditor* wxPGProperty::GetEditorClass() const if ( GetDisplayedCommonValueCount() ) { // TextCtrlAndButton -> ComboBoxAndButton - if ( editor->IsKindOf(CLASSINFO(wxPGTextCtrlAndButtonEditor)) ) + if ( wxDynamicCast(editor, wxPGTextCtrlAndButtonEditor) ) editor = wxPGEditor_ChoiceAndButton; // TextCtrl -> ComboBox - else if ( editor->IsKindOf(CLASSINFO(wxPGTextCtrlEditor)) ) + else if ( wxDynamicCast(editor, wxPGTextCtrlEditor) ) editor = wxPGEditor_ComboBox; } diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index a4ceec111f..42395f47a2 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -6342,7 +6342,7 @@ wxPGProperty* wxPropertyGridPopulator::Add( const wxString& propClass, return NULL; } - if ( !classInfo || !classInfo->IsKindOf(CLASSINFO(wxPGProperty)) ) + if ( !classInfo || !classInfo->IsKindOf(wxCLASSINFO(wxPGProperty)) ) { ProcessError(wxString::Format(wxT("'%s' is not valid property class"),propClass.c_str())); return NULL; diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 12075f88db..1463a9000c 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -1127,7 +1127,7 @@ bool wxEnumProperty::ValueFromString_( wxVariant& value, const wxString& text, i bool asText = false; - bool isEdit = this->IsKindOf(CLASSINFO(wxEditEnumProperty)); + bool isEdit = this->IsKindOf(wxCLASSINFO(wxEditEnumProperty)); // If text not any of the choices, store as text instead // (but only if we are wxEditEnumProperty) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 6567878d42..6ccb090e8a 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -6825,7 +6825,7 @@ wxString wxRichTextPlainText::GetTextForRange(const wxRichTextRange& range) cons /// Returns true if this object can merge itself with the given one. bool wxRichTextPlainText::CanMerge(wxRichTextObject* object) const { - return object->GetClassInfo() == CLASSINFO(wxRichTextPlainText) && + return object->GetClassInfo() == wxCLASSINFO(wxRichTextPlainText) && (m_text.empty() || (wxTextAttrEq(GetAttributes(), object->GetAttributes()) && m_properties == object->GetProperties())); } @@ -8817,7 +8817,7 @@ bool wxRichTextCell::EditProperties(wxWindow* parent, wxRichTextBuffer* buffer) wxRichTextObjectPropertiesDialog cellDlg(this, wxGetTopLevelParent(parent), wxID_ANY, caption); cellDlg.SetAttributes(attr); - wxRichTextSizePage* sizePage = wxDynamicCast(cellDlg.FindPage(CLASSINFO(wxRichTextSizePage)), wxRichTextSizePage); + wxRichTextSizePage* sizePage = wxDynamicCast(cellDlg.FindPage(wxCLASSINFO(wxRichTextSizePage)), wxRichTextSizePage); if (sizePage) { // We don't want position and floating controls for a cell. diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index 47939315e4..60c975478e 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -61,10 +61,10 @@ wxRichTextAttr wxRichTextStyleDefinition::GetStyleMergedWithBase(const wxRichTex if (m_baseStyle.IsEmpty()) return m_style; - bool isParaStyle = IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition)); - bool isCharStyle = IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition)); - bool isListStyle = IsKindOf(CLASSINFO(wxRichTextListStyleDefinition)); - bool isBoxStyle = IsKindOf(CLASSINFO(wxRichTextBoxStyleDefinition)); + bool isParaStyle = IsKindOf(wxCLASSINFO(wxRichTextParagraphStyleDefinition)); + bool isCharStyle = IsKindOf(wxCLASSINFO(wxRichTextCharacterStyleDefinition)); + bool isListStyle = IsKindOf(wxCLASSINFO(wxRichTextListStyleDefinition)); + bool isBoxStyle = IsKindOf(wxCLASSINFO(wxRichTextBoxStyleDefinition)); // Collect the styles, detecting loops wxArrayString styleNames;