wxDynamicCast() is less verbose (due to the absence of "CLASSINFO") and more
compatible with the standard dynamic_cast<>, so prefer to use it when possible.
See #14356.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71624 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
29 files changed:
 static void ShowWnd(wxWindow* wnd, bool show)
 {
 #if wxUSE_MDI
 static void ShowWnd(wxWindow* wnd, bool show)
 {
 #if wxUSE_MDI
-    if (wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+    if (wxDynamicCast(wnd, wxAuiMDIChildFrame))
     {
         wxAuiMDIChildFrame* cf = (wxAuiMDIChildFrame*)wnd;
         cf->DoShow(show);
     {
         wxAuiMDIChildFrame* cf = (wxAuiMDIChildFrame*)wnd;
         cf->DoShow(show);
         // even if the tab is already active, because they may
         // have multiple tab controls
         if ((new_selection != GetActivePage() ||
         // even if the tab is already active, because they may
         // have multiple tab controls
         if ((new_selection != GetActivePage() ||
-            GetParent()->IsKindOf(CLASSINFO(wxAuiNotebook))) && !m_hoverButton)
+            wxDynamicCast(GetParent(), wxAuiNotebook)) && !m_hoverButton)
         {
             wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId);
             e.SetSelection(new_selection);
         {
             wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId);
             e.SetSelection(new_selection);
             // TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
 
 #if wxUSE_MDI
             // TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
 
 #if wxUSE_MDI
-            if (page.window->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+            if (wxDynamicCast(page.window, wxAuiMDIChildFrame))
             {
                 wxAuiMDIChildFrame* wnd = (wxAuiMDIChildFrame*)page.window;
                 wnd->ApplyMDIChildFrameRect();
             {
                 wxAuiMDIChildFrame* wnd = (wxAuiMDIChildFrame*)page.window;
                 wnd->ApplyMDIChildFrameRect();
 
 #if wxUSE_MDI
     // actually destroy the window now
 
 #if wxUSE_MDI
     // actually destroy the window now
-    if (wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+    if (wxDynamicCast(wnd, wxAuiMDIChildFrame))
     {
         // delete the child frame with pending delete, as is
         // customary with frame windows
     {
         // delete the child frame with pending delete, as is
         // customary with frame windows
             return;
 
         // make sure we are not over the hint window
             return;
 
         // make sure we are not over the hint window
-        if (!tab_ctrl->IsKindOf(CLASSINFO(wxFrame)))
+        if (!wxDynamicCast(tab_ctrl, wxFrame))
-                if (tab_ctrl->IsKindOf(CLASSINFO(wxAuiTabCtrl)))
+                if (wxDynamicCast(tab_ctrl, wxAuiTabCtrl))
                     break;
                 tab_ctrl = tab_ctrl->GetParent();
             }
                     break;
                 tab_ctrl = tab_ctrl->GetParent();
             }
-            if (tab_ctrl->IsKindOf(CLASSINFO(wxAuiTabCtrl)))
+            if (wxDynamicCast(tab_ctrl, wxAuiTabCtrl))
                 break;
             tab_ctrl = tab_ctrl->GetParent();
         }
                 break;
             tab_ctrl = tab_ctrl->GetParent();
         }
-            if (close_wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+            if (wxDynamicCast(close_wnd, wxAuiMDIChildFrame))
 
     wxWindow* w = m_frame;
     while (w)
     {
     wxWindow* w = m_frame;
     while (w)
     {
-        if (w->IsKindOf(CLASSINFO(wxFrame)))
+        if (wxDynamicCast(w, wxFrame))
         {
             wxFrame* f = static_cast<wxFrame*>(w);
             can_do_transparent = f->CanSetTransparent();
         {
             wxFrame* f = static_cast<wxFrame*>(w);
             can_do_transparent = f->CanSetTransparent();
     // we need to add the MDI client window as the default
     // center pane
 
     // we need to add the MDI client window as the default
     // center pane
 
-    if (m_frame->IsKindOf(CLASSINFO(wxMDIParentFrame)))
+    if (wxDynamicCast(m_frame, wxMDIParentFrame))
     {
         wxMDIParentFrame* mdi_frame = (wxMDIParentFrame*)m_frame;
         wxWindow* client_window = mdi_frame->GetClientWindow();
     {
         wxMDIParentFrame* mdi_frame = (wxMDIParentFrame*)m_frame;
         wxWindow* client_window = mdi_frame->GetClientWindow();
                 wxAuiPaneInfo().Name(wxT("mdiclient")).
                 CenterPane().PaneBorder(false));
     }
                 wxAuiPaneInfo().Name(wxT("mdiclient")).
                 CenterPane().PaneBorder(false));
     }
-    else if (m_frame->IsKindOf(CLASSINFO(wxAuiMDIParentFrame)))
+    else if (wxDynamicCast(m_frame, wxAuiMDIParentFrame))
     {
         wxAuiMDIParentFrame* mdi_frame = (wxAuiMDIParentFrame*)m_frame;
         wxAuiMDIClientWindow* client_window = mdi_frame->GetClientWindow();
     {
         wxAuiMDIParentFrame* mdi_frame = (wxAuiMDIParentFrame*)m_frame;
         wxAuiMDIClientWindow* client_window = mdi_frame->GetClientWindow();
 
     if (pinfo.HasGripper())
     {
 
     if (pinfo.HasGripper())
     {
-        if (pinfo.window->IsKindOf(CLASSINFO(wxAuiToolBar)))
+        if (wxDynamicCast(pinfo.window, wxAuiToolBar))
         {
             // prevent duplicate gripper -- both wxAuiManager and wxAuiToolBar
             // have a gripper control.  The toolbar's built-in gripper
         {
             // prevent duplicate gripper -- both wxAuiManager and wxAuiToolBar
             // have a gripper control.  The toolbar's built-in gripper
         pinfo.best_size = pinfo.window->GetClientSize();
 
 #if wxUSE_TOOLBAR
         pinfo.best_size = pinfo.window->GetClientSize();
 
 #if wxUSE_TOOLBAR
-        if (pinfo.window->IsKindOf(CLASSINFO(wxToolBar)))
+        if (wxDynamicCast(pinfo.window, wxToolBar))
         {
             // GetClientSize() doesn't get the best size for
             // a toolbar under some newer versions of wxWidgets,
         {
             // GetClientSize() doesn't get the best size for
             // a toolbar under some newer versions of wxWidgets,
         m_hintFadeAmt = m_hintFadeMax;
 
         if ((m_flags & wxAUI_MGR_HINT_FADE)
         m_hintFadeAmt = m_hintFadeMax;
 
         if ((m_flags & wxAUI_MGR_HINT_FADE)
-            && !((m_hintWnd->IsKindOf(CLASSINFO(wxPseudoTransparentFrame))) &&
+            && !((wxDynamicCast(m_hintWnd, wxPseudoTransparentFrame)) &&
                  (m_flags & wxAUI_MGR_NO_VENETIAN_BLINDS_FADE))
             )
             m_hintFadeAmt = 0;
                  (m_flags & wxAUI_MGR_NO_VENETIAN_BLINDS_FADE))
             )
             m_hintFadeAmt = 0;
-        if (m_frame->IsKindOf(CLASSINFO(wxMDIParentFrame)))
+        if (wxDynamicCast(m_frame, wxMDIParentFrame))
         {
             // for MDI parent frames, this event must not
             // be "skipped".  In other words, the parent frame
         {
             // for MDI parent frames, this event must not
             // be "skipped".  In other words, the parent frame
     }
 
     // if we are managing a child frame, get the 'real' manager
     }
 
     // if we are managing a child frame, get the 'real' manager
-    if (window->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
+    if (wxDynamicCast(window, wxAuiFloatingFrame))
     {
         wxAuiFloatingFrame* float_frame = static_cast<wxAuiFloatingFrame*>(window);
         evt.SetManager(float_frame->GetOwnerManager());
     {
         wxAuiFloatingFrame* float_frame = static_cast<wxAuiFloatingFrame*>(window);
         evt.SetManager(float_frame->GetOwnerManager());
             if (part->pane &&
                 part->pane->window &&
                 managed_wnd &&
             if (part->pane &&
                 part->pane->window &&
                 managed_wnd &&
-                managed_wnd->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
+                wxDynamicCast(managed_wnd, wxAuiFloatingFrame))
             {
                 wxAuiFloatingFrame* floating_frame = (wxAuiFloatingFrame*)managed_wnd;
                 wxAuiManager* owner_mgr = floating_frame->GetOwnerManager();
             {
                 wxAuiFloatingFrame* floating_frame = (wxAuiFloatingFrame*)managed_wnd;
                 wxAuiManager* owner_mgr = floating_frame->GetOwnerManager();
 #if wxUSE_STATUSBAR
         // if there's a status control, the available
         // height decreases accordingly
 #if wxUSE_STATUSBAR
         // if there's a status control, the available
         // height decreases accordingly
-        if (m_frame && m_frame->IsKindOf(CLASSINFO(wxFrame)))
+        if (wxDynamicCast(m_frame, wxFrame))
         {
             wxFrame* frame = static_cast<wxFrame*>(m_frame);
             wxStatusBar* status = frame->GetStatusBar();
         {
             wxFrame* frame = static_cast<wxFrame*>(m_frame);
             wxStatusBar* status = frame->GetStatusBar();
             // We can't move the child window so we need to get the frame that
             // we want to be really moving. This is probably not the best place
             // to do this but at least it fixes the bug (#13177) for now.
             // We can't move the child window so we need to get the frame that
             // we want to be really moving. This is probably not the best place
             // to do this but at least it fixes the bug (#13177) for now.
-            if (!m_actionWindow->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
+            if (!wxDynamicCast(m_actionWindow, wxAuiFloatingFrame))
             {
                 wxAuiPaneInfo& pane = GetPane(m_actionWindow);
                 m_actionWindow = pane.frame;
             {
                 wxAuiPaneInfo& pane = GetPane(m_actionWindow);
                 m_actionWindow = pane.frame;
 
 void wxComboPopupWindow::OnDismiss()
 {
     wxComboCtrlBase* combo = (wxComboCtrlBase*) GetParent();
 void wxComboPopupWindow::OnDismiss()
 {
     wxComboCtrlBase* combo = (wxComboCtrlBase*) GetParent();
-    wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxComboCtrlBase)),
+    wxASSERT_MSG( wxDynamicCast(combo, wxComboCtrlBase),
                   wxT("parent might not be wxComboCtrl, but check IMPLEMENT_DYNAMIC_CLASS(2) macro for correctness") );
 
     combo->OnPopupDismiss(true);
                   wxT("parent might not be wxComboCtrl, but check IMPLEMENT_DYNAMIC_CLASS(2) macro for correctness") );
 
     combo->OnPopupDismiss(true);
 
     }
 
 #if WXWIN_COMPATIBILITY_2_6 && wxUSE_ZIPSTREAM
     }
 
 #if WXWIN_COMPATIBILITY_2_6 && wxUSE_ZIPSTREAM
-    if (factory->IsKindOf(CLASSINFO(wxZipClassFactory)))
+    if (wxDynamicCast(factory, wxZipClassFactory))
         ((wxZipInputStream*)s)->m_allowSeeking = true;
 #endif // WXWIN_COMPATIBILITY_2_6
 
         ((wxZipInputStream*)s)->m_allowSeeking = true;
 #endif // WXWIN_COMPATIBILITY_2_6
 
 
-                if (connection->IsKindOf(CLASSINFO(wxTCPConnection)))
+                if (wxDynamicCast(connection, wxTCPConnection))
                 {
                     connection->m_topic = topic;
                     connection->m_sock  = client;
                 {
                     connection->m_topic = topic;
                     connection->m_sock  = client;
-                if (new_connection->IsKindOf(CLASSINFO(wxTCPConnection)))
+                if (wxDynamicCast(new_connection, wxTCPConnection))
                 {
                     // Acknowledge success
                     out.Write8(IPC_CONNECT);
                 {
                     // Acknowledge success
                     out.Write8(IPC_CONNECT);
 
     // Hack for wxNotebook case: at least in wxGTK, all pages
     // claim to be shown, so we must only deal with the selected one.
 #if wxUSE_NOTEBOOK
     // Hack for wxNotebook case: at least in wxGTK, all pages
     // claim to be shown, so we must only deal with the selected one.
 #if wxUSE_NOTEBOOK
-    if (win->IsKindOf(CLASSINFO(wxNotebook)))
+    if (wxDynamicCast(win, wxNotebook))
     {
       wxNotebook* nb = (wxNotebook*) win;
       int sel = nb->GetSelection();
     {
       wxNotebook* nb = (wxNotebook*) win;
       int sel = nb->GetSelection();
 
 
     // bool controls
 #if wxUSE_CHECKBOX
 
     // bool controls
 #if wxUSE_CHECKBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxCheckBox))
     {
         wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
         if (m_pBool)
     {
         wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
         if (m_pBool)
     } else
 #endif
 #if wxUSE_RADIOBTN
     } else
 #endif
 #if wxUSE_RADIOBTN
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxRadioButton))
     {
         wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
         if (m_pBool)
     {
         wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
         if (m_pBool)
 #endif
 
 #if wxUSE_TOGGLEBTN
 #endif
 
 #if wxUSE_TOGGLEBTN
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxToggleButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxToggleButton))
     {
         wxToggleButton * pControl = (wxToggleButton *) m_validatorWindow;
         if (m_pBool)
     {
         wxToggleButton * pControl = (wxToggleButton *) m_validatorWindow;
         if (m_pBool)
         }
     } else
 #if (defined(__WXMAC__) || defined(__WXMSW__) || defined(__WXGTK20__)) && !defined(__WXUNIVERSAL__)
         }
     } else
 #if (defined(__WXMAC__) || defined(__WXMSW__) || defined(__WXGTK20__)) && !defined(__WXUNIVERSAL__)
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxBitmapToggleButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxBitmapToggleButton))
     {
         wxBitmapToggleButton * pControl = (wxBitmapToggleButton *) m_validatorWindow;
         if (m_pBool)
     {
         wxBitmapToggleButton * pControl = (wxBitmapToggleButton *) m_validatorWindow;
         if (m_pBool)
 
     // int controls
 #if wxUSE_GAUGE
 
     // int controls
 #if wxUSE_GAUGE
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
+    if (wxDynamicCast(m_validatorWindow, wxGauge))
     {
         wxGauge* pControl = (wxGauge*) m_validatorWindow;
         if (m_pInt)
     {
         wxGauge* pControl = (wxGauge*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_RADIOBOX
     } else
 #endif
 #if wxUSE_RADIOBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxRadioBox))
     {
         wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
         if (m_pInt)
     {
         wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SCROLLBAR
     } else
 #endif
 #if wxUSE_SCROLLBAR
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
+    if (wxDynamicCast(m_validatorWindow, wxScrollBar))
     {
         wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
         if (m_pInt)
     {
         wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SPINCTRL && !defined(__WXMOTIF__)
     } else
 #endif
 #if wxUSE_SPINCTRL && !defined(__WXMOTIF__)
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) )
+    if (wxDynamicCast(m_validatorWindow, wxSpinCtrl))
     {
         wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow;
         if (m_pInt)
     {
         wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SPINBTN
     } else
 #endif
 #if wxUSE_SPINBTN
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxSpinButton))
     {
         wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
         if (m_pInt)
     {
         wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SLIDER
     } else
 #endif
 #if wxUSE_SLIDER
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxSlider)) )
+    if (wxDynamicCast(m_validatorWindow, wxSlider))
     {
         wxSlider* pControl = (wxSlider*) m_validatorWindow;
         if (m_pInt)
     {
         wxSlider* pControl = (wxSlider*) m_validatorWindow;
         if (m_pInt)
 
     // date time controls
 #if 0 // wxUSE_DATEPICKCTRL -- temporary fix for shared build linking
 
     // date time controls
 #if 0 // wxUSE_DATEPICKCTRL -- temporary fix for shared build linking
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxDatePickerCtrl)) )
+    if (wxDynamicCast(m_validatorWindow, wxDatePickerCtrl))
     {
         wxDatePickerCtrl* pControl = (wxDatePickerCtrl*) m_validatorWindow;
         if (m_pDateTime)
     {
         wxDatePickerCtrl* pControl = (wxDatePickerCtrl*) m_validatorWindow;
         if (m_pDateTime)
 
     // string controls
 #if wxUSE_BUTTON
 
     // string controls
 #if wxUSE_BUTTON
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxButton))
     {
         wxButton* pControl = (wxButton*) m_validatorWindow;
         if (m_pString)
     {
         wxButton* pControl = (wxButton*) m_validatorWindow;
         if (m_pString)
     } else
 #endif
 #if wxUSE_COMBOBOX
     } else
 #endif
 #if wxUSE_COMBOBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxComboBox))
     {
         wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
         if (m_pInt)
     {
         wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_CHOICE
     } else
 #endif
 #if wxUSE_CHOICE
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
+    if (wxDynamicCast(m_validatorWindow, wxChoice))
     {
         wxChoice* pControl = (wxChoice*) m_validatorWindow;
         if (m_pInt)
     {
         wxChoice* pControl = (wxChoice*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_STATTEXT
     } else
 #endif
 #if wxUSE_STATTEXT
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
+    if (wxDynamicCast(m_validatorWindow, wxStaticText))
     {
         wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
         if (m_pString)
     {
         wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
         if (m_pString)
     } else
 #endif
 #if wxUSE_TEXTCTRL
     } else
 #endif
 #if wxUSE_TEXTCTRL
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
+    if (wxDynamicCast(m_validatorWindow, wxTextCtrl))
     {
         wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
         if (m_pString)
     {
         wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
         if (m_pString)
     // array controls
 #if wxUSE_CHECKLISTBOX
     // NOTE: wxCheckListBox is a wxListBox, so wxCheckListBox MUST come first:
     // array controls
 #if wxUSE_CHECKLISTBOX
     // NOTE: wxCheckListBox is a wxListBox, so wxCheckListBox MUST come first:
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxCheckListBox))
     {
         wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
         if (m_pArrayInt)
     {
         wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
         if (m_pArrayInt)
     } else
 #endif
 #if wxUSE_LISTBOX
     } else
 #endif
 #if wxUSE_LISTBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxListBox))
     {
         wxListBox* pControl = (wxListBox*) m_validatorWindow;
         if (m_pArrayInt)
     {
         wxListBox* pControl = (wxListBox*) m_validatorWindow;
         if (m_pArrayInt)
 
     // BOOL CONTROLS **************************************
 #if wxUSE_CHECKBOX
 
     // BOOL CONTROLS **************************************
 #if wxUSE_CHECKBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxCheckBox))
     {
         wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
         if (m_pBool)
     {
         wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
         if (m_pBool)
     } else
 #endif
 #if wxUSE_RADIOBTN
     } else
 #endif
 #if wxUSE_RADIOBTN
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxRadioButton))
     {
         wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
         if (m_pBool)
     {
         wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
         if (m_pBool)
     } else
 #endif
 #if wxUSE_TOGGLEBTN
     } else
 #endif
 #if wxUSE_TOGGLEBTN
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxToggleButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxToggleButton))
     {
         wxToggleButton *pControl = (wxToggleButton *) m_validatorWindow;
         if (m_pBool)
     {
         wxToggleButton *pControl = (wxToggleButton *) m_validatorWindow;
         if (m_pBool)
         }
     } else
 #if (defined(__WXMAC__) || defined(__WXMSW__) || defined(__WXGTK20__)) && !defined(__WXUNIVERSAL__)
         }
     } else
 #if (defined(__WXMAC__) || defined(__WXMSW__) || defined(__WXGTK20__)) && !defined(__WXUNIVERSAL__)
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxBitmapToggleButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxBitmapToggleButton))
     {
         wxBitmapToggleButton *pControl = (wxBitmapToggleButton *) m_validatorWindow;
         if (m_pBool)
     {
         wxBitmapToggleButton *pControl = (wxBitmapToggleButton *) m_validatorWindow;
         if (m_pBool)
 
     // INT CONTROLS ***************************************
 #if wxUSE_GAUGE
 
     // INT CONTROLS ***************************************
 #if wxUSE_GAUGE
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
+    if (wxDynamicCast(m_validatorWindow, wxGauge))
     {
         wxGauge* pControl = (wxGauge*) m_validatorWindow;
         if (m_pInt)
     {
         wxGauge* pControl = (wxGauge*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_RADIOBOX
     } else
 #endif
 #if wxUSE_RADIOBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxRadioBox))
     {
         wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
         if (m_pInt)
     {
         wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SCROLLBAR
     } else
 #endif
 #if wxUSE_SCROLLBAR
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
+    if (wxDynamicCast(m_validatorWindow, wxScrollBar))
     {
         wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
         if (m_pInt)
     {
         wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SPINCTRL && !defined(__WXMOTIF__)
     } else
 #endif
 #if wxUSE_SPINCTRL && !defined(__WXMOTIF__)
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) )
+    if (wxDynamicCast(m_validatorWindow, wxSpinCtrl))
     {
         wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow;
         if (m_pInt)
     {
         wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SPINBTN
     } else
 #endif
 #if wxUSE_SPINBTN
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxSpinButton))
     {
         wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
         if (m_pInt)
     {
         wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_SLIDER
     } else
 #endif
 #if wxUSE_SLIDER
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxSlider)) )
+    if (wxDynamicCast(m_validatorWindow, wxSlider))
     {
         wxSlider* pControl = (wxSlider*) m_validatorWindow;
         if (m_pInt)
     {
         wxSlider* pControl = (wxSlider*) m_validatorWindow;
         if (m_pInt)
 
     // DATE TIME CONTROLS ************************************
 #if 0 // wxUSE_DATEPICKCTRL -- temporary fix for shared build linking
 
     // DATE TIME CONTROLS ************************************
 #if 0 // wxUSE_DATEPICKCTRL -- temporary fix for shared build linking
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxDatePickerCtrl)) )
+    if (wxDynamicCast(m_validatorWindow, wxDatePickerCtrl))
     {
         wxDatePickerCtrl* pControl = (wxDatePickerCtrl*) m_validatorWindow;
         if (m_pDateTime)
     {
         wxDatePickerCtrl* pControl = (wxDatePickerCtrl*) m_validatorWindow;
         if (m_pDateTime)
 
     // STRING CONTROLS ************************************
 #if wxUSE_BUTTON
 
     // STRING CONTROLS ************************************
 #if wxUSE_BUTTON
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
+    if (wxDynamicCast(m_validatorWindow, wxButton))
     {
         wxButton* pControl = (wxButton*) m_validatorWindow;
         if (m_pString)
     {
         wxButton* pControl = (wxButton*) m_validatorWindow;
         if (m_pString)
     } else
 #endif
 #if wxUSE_COMBOBOX
     } else
 #endif
 #if wxUSE_COMBOBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxComboBox))
     {
         wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
         if (m_pInt)
     {
         wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_CHOICE
     } else
 #endif
 #if wxUSE_CHOICE
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
+    if (wxDynamicCast(m_validatorWindow, wxChoice))
     {
         wxChoice* pControl = (wxChoice*) m_validatorWindow;
         if (m_pInt)
     {
         wxChoice* pControl = (wxChoice*) m_validatorWindow;
         if (m_pInt)
     } else
 #endif
 #if wxUSE_STATTEXT
     } else
 #endif
 #if wxUSE_STATTEXT
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
+    if (wxDynamicCast(m_validatorWindow, wxStaticText))
     {
         wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
         if (m_pString)
     {
         wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
         if (m_pString)
     } else
 #endif
 #if wxUSE_TEXTCTRL
     } else
 #endif
 #if wxUSE_TEXTCTRL
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
+    if (wxDynamicCast(m_validatorWindow, wxTextCtrl))
     {
         wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
         if (m_pString)
     {
         wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
         if (m_pString)
     // ARRAY CONTROLS *************************************
 #if wxUSE_CHECKLISTBOX
     // NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox MUST come first:
     // ARRAY CONTROLS *************************************
 #if wxUSE_CHECKLISTBOX
     // NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox MUST come first:
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxCheckListBox))
     {
         wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
         if (m_pArrayInt)
     {
         wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
         if (m_pArrayInt)
     } else
 #endif
 #if wxUSE_LISTBOX
     } else
 #endif
 #if wxUSE_LISTBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
+    if (wxDynamicCast(m_validatorWindow, wxListBox))
     {
         wxListBox* pControl = (wxListBox*) m_validatorWindow;
         if (m_pArrayInt)
     {
         wxListBox* pControl = (wxListBox*) m_validatorWindow;
         if (m_pArrayInt)
 
 wxTextEntry *wxTextValidator::GetTextEntry()
 {
 #if wxUSE_TEXTCTRL
 wxTextEntry *wxTextValidator::GetTextEntry()
 {
 #if wxUSE_TEXTCTRL
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)))
+    if (wxDynamicCast(m_validatorWindow, wxTextCtrl))
     {
         return (wxTextCtrl*)m_validatorWindow;
     }
 #endif
 
 #if wxUSE_COMBOBOX
     {
         return (wxTextCtrl*)m_validatorWindow;
     }
 #endif
 
 #if wxUSE_COMBOBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)))
+    if (wxDynamicCast(m_validatorWindow, wxComboBox))
     {
         return (wxComboBox*)m_validatorWindow;
     }
 #endif
 
 #if wxUSE_COMBOCTRL
     {
         return (wxComboBox*)m_validatorWindow;
     }
 #endif
 
 #if wxUSE_COMBOCTRL
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboCtrl)))
+    if (wxDynamicCast(m_validatorWindow, wxComboCtrl))
     {
         return (wxComboCtrl*)m_validatorWindow;
     }
     {
         return (wxComboCtrl*)m_validatorWindow;
     }
 
         wxWindow *win = node->GetData();
         if ( !win->IsTopLevel() && win->IsShown()
 #if wxUSE_SCROLLBAR
         wxWindow *win = node->GetData();
         if ( !win->IsTopLevel() && win->IsShown()
 #if wxUSE_SCROLLBAR
-            && !win->IsKindOf(CLASSINFO(wxScrollBar))
+            && !wxDynamicCast(win, wxScrollBar)
 #endif
             )
             realChildCount ++;
 #endif
             )
             realChildCount ++;
     if (win)
     {
         rect = win->GetRect();
     if (win)
     {
         rect = win->GetRect();
-        if (win->GetParent() && !win->IsKindOf(CLASSINFO(wxTopLevelWindow)))
+        if (win->GetParent() && !wxDynamicCast(win, wxTopLevelWindow))
             rect.SetPosition(win->GetParent()->ClientToScreen(rect.GetPosition()));
         return wxACC_OK;
     }
             rect.SetPosition(win->GetParent()->ClientToScreen(rect.GetPosition()));
         return wxACC_OK;
     }
     // accessible classes, one for each kind of wxWidgets
     // control or window.
 #if wxUSE_BUTTON
     // accessible classes, one for each kind of wxWidgets
     // control or window.
 #if wxUSE_BUTTON
-    if (GetWindow()->IsKindOf(CLASSINFO(wxButton)))
+    if (wxDynamicCast(GetWindow(), wxButton))
         title = ((wxButton*) GetWindow())->GetLabel();
     else
 #endif
         title = ((wxButton*) GetWindow())->GetLabel();
     else
 #endif
     if (childId > 0)
         return wxACC_NOT_IMPLEMENTED;
 
     if (childId > 0)
         return wxACC_NOT_IMPLEMENTED;
 
-    if (GetWindow()->IsKindOf(CLASSINFO(wxControl)))
+    if (wxDynamicCast(GetWindow(), wxControl))
         return wxACC_NOT_IMPLEMENTED;
 #if wxUSE_STATUSBAR
         return wxACC_NOT_IMPLEMENTED;
 #if wxUSE_STATUSBAR
-    if (GetWindow()->IsKindOf(CLASSINFO(wxStatusBar)))
+    if (wxDynamicCast(GetWindow(), wxStatusBar))
         return wxACC_NOT_IMPLEMENTED;
 #endif
 #if wxUSE_TOOLBAR
         return wxACC_NOT_IMPLEMENTED;
 #endif
 #if wxUSE_TOOLBAR
-    if (GetWindow()->IsKindOf(CLASSINFO(wxToolBar)))
+    if (wxDynamicCast(GetWindow(), wxToolBar))
         return wxACC_NOT_IMPLEMENTED;
 #endif
 
         return wxACC_NOT_IMPLEMENTED;
 #endif
 
     if (childId > 0)
         return wxACC_NOT_IMPLEMENTED;
 
     if (childId > 0)
         return wxACC_NOT_IMPLEMENTED;
 
-    if (GetWindow()->IsKindOf(CLASSINFO(wxControl)))
+    if (wxDynamicCast(GetWindow(), wxControl))
         return wxACC_NOT_IMPLEMENTED;
 
 #if wxUSE_STATUSBAR
         return wxACC_NOT_IMPLEMENTED;
 
 #if wxUSE_STATUSBAR
-    if (GetWindow()->IsKindOf(CLASSINFO(wxStatusBar)))
+    if (wxDynamicCast(GetWindow(), wxStatusBar))
         return wxACC_NOT_IMPLEMENTED;
 #endif
 #if wxUSE_TOOLBAR
         return wxACC_NOT_IMPLEMENTED;
 #endif
 #if wxUSE_TOOLBAR
-    if (GetWindow()->IsKindOf(CLASSINFO(wxToolBar)))
+    if (wxDynamicCast(GetWindow(), wxToolBar))
         return wxACC_NOT_IMPLEMENTED;
 #endif
 
         return wxACC_NOT_IMPLEMENTED;
 #endif
 
 
 
     wxSize sz = fullScreenRect->GetSize();
 
 
     wxSize sz = fullScreenRect->GetSize();
 
-    if (fullScreenRect->GetParent() && !fullScreenRect->IsKindOf(CLASSINFO(wxFrame)))
+    if (fullScreenRect->GetParent() && !wxDynamicCast(fullScreenRect, wxFrame))
         fullScreenRect->GetParent()->ClientToScreen(& x, & y);
 
     rect.x = x; rect.y = y;
         fullScreenRect->GetParent()->ClientToScreen(& x, & y);
 
     rect.x = x; rect.y = y;
 
 
     int leftMargin = 0, rightMargin = 0, topMargin = 0, bottomMargin = 0;
 #if wxUSE_SASH
 
     int leftMargin = 0, rightMargin = 0, topMargin = 0, bottomMargin = 0;
 #if wxUSE_SASH
-    if (parent->IsKindOf(CLASSINFO(wxSashWindow)))
+    if (wxDynamicCast(parent, wxSashWindow))
     {
         wxSashWindow* sashWindow = (wxSashWindow*) parent;
 
     {
         wxSashWindow* sashWindow = (wxSashWindow*) parent;
 
 
                 // find the top window and set it's status text if it has any
                 if ( pFrame == NULL ) {
                     wxWindow *pWin = wxTheApp->GetTopWindow();
                 // find the top window and set it's status text if it has any
                 if ( pFrame == NULL ) {
                     wxWindow *pWin = wxTheApp->GetTopWindow();
-                    if ( pWin != NULL && pWin->IsKindOf(CLASSINFO(wxFrame)) ) {
+                    if ( wxDynamicCast(pWin, wxFrame) ) {
                         pFrame = (wxFrame *)pWin;
                     }
                 }
                         pFrame = (wxFrame *)pWin;
                     }
                 }
 
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
-    wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)),
+    wxASSERT_MSG( wxDynamicCast(combo, wxOwnerDrawnComboBox),
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     wxCoord h = combo->OnMeasureItem(n);
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     wxCoord h = combo->OnMeasureItem(n);
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
-    wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)),
+    wxASSERT_MSG( wxDynamicCast(combo, wxOwnerDrawnComboBox),
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     return combo->OnMeasureItemWidth(n);
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     return combo->OnMeasureItemWidth(n);
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
-    wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)),
+    wxASSERT_MSG( wxDynamicCast(combo, wxOwnerDrawnComboBox),
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     if ( IsCurrent((size_t)item) && !(flags & wxODCB_PAINTING_CONTROL) )
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     if ( IsCurrent((size_t)item) && !(flags & wxODCB_PAINTING_CONTROL) )
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
 {
     wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo;
 
-    wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)),
+    wxASSERT_MSG( wxDynamicCast(combo, wxOwnerDrawnComboBox),
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     combo->OnDrawItem(dc,rect,item,flags);
                   wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") );
 
     combo->OnDrawItem(dc,rect,item,flags);
 
             // the area to draw on.
             wxWindow* parent = this;
 
             // the area to draw on.
             wxWindow* parent = this;
 
-            while (parent && !parent->IsKindOf(CLASSINFO(wxDialog)) &&
-                             !parent->IsKindOf(CLASSINFO(wxFrame)))
+            while (parent && !wxDynamicCast(parent, wxDialog) &&
+                             !wxDynamicCast(parent, wxFrame))
               parent = parent->GetParent();
 
             wxScreenDC::StartDrawingOnTop(parent);
               parent = parent->GetParent();
 
             wxScreenDC::StartDrawingOnTop(parent);
 
     GdkWindow* gdk_window = NULL;
 
 #if wxUSE_GRAPHICS_CONTEXT
     GdkWindow* gdk_window = NULL;
 
 #if wxUSE_GRAPHICS_CONTEXT
-    if ( dc.IsKindOf( CLASSINFO(wxGCDC) ) )
+    if ( wxDynamicCast(&dc, wxGCDC) )
         gdk_window = win->GTKGetDrawingWindow();
     else
 #endif
         gdk_window = win->GTKGetDrawingWindow();
     else
 #endif
 
     if (m_HtmlHelpWin->GetSplitterWindow() && m_HtmlHelpWin->GetCfgData().navig_on)
         m_HtmlHelpWin->GetCfgData().sashpos = m_HtmlHelpWin->GetSplitterWindow()->GetSashPosition();
 
     if (m_HtmlHelpWin->GetSplitterWindow() && m_HtmlHelpWin->GetCfgData().navig_on)
         m_HtmlHelpWin->GetCfgData().sashpos = m_HtmlHelpWin->GetSplitterWindow()->GetSashPosition();
 
-    if (m_helpController && m_helpController->IsKindOf(CLASSINFO(wxHtmlHelpController)))
+    if (m_helpController && wxDynamicCast(m_helpController, wxHtmlHelpController))
     {
         ((wxHtmlHelpController*) m_helpController)->OnCloseFrame(evt);
     }
     {
         ((wxHtmlHelpController*) m_helpController)->OnCloseFrame(evt);
     }
 
 
     wxSize sz = fullScreenRect->GetSize();
 
 
     wxSize sz = fullScreenRect->GetSize();
 
-    if (fullScreenRect->GetParent() && !fullScreenRect->IsKindOf(CLASSINFO(wxFrame)))
+    if (fullScreenRect->GetParent() && !wxDynamicCast(fullScreenRect, wxFrame))
         fullScreenRect->GetParent()->ClientToScreen(& x, & y);
 
     rect.x = x; rect.y = y;
         fullScreenRect->GetParent()->ClientToScreen(& x, & y);
 
     rect.x = x; rect.y = y;
 
 
 wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
 {
 
 wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
 {
-    wxCHECK_MSG( textControlClass->IsKindOf(CLASSINFO(wxTextCtrl)), NULL,
+    wxCHECK_MSG( textControlClass->IsKindOf(wxCLASSINFO(wxTextCtrl)), NULL,
                   "control used for label editing must be a wxTextCtrl" );
 
     // ListView_EditLabel requires that the list has focus.
                   "control used for label editing must be a wxTextCtrl" );
 
     // ListView_EditLabel requires that the list has focus.
 
             while (node)
             {
                 wxWindow *child = node->GetData();
             while (node)
             {
                 wxWindow *child = node->GetData();
-                if (child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
+                if (wxDynamicCast(child, wxMDIChildFrame))
                 {
                    ::RedrawWindow(GetHwndOf(child),
                                   NULL,
                 {
                    ::RedrawWindow(GetHwndOf(child),
                                   NULL,
 
 
         if ( !controlOnly
 #if wxUSE_CONTROLS
 
         if ( !controlOnly
 #if wxUSE_CONTROLS
-                || parent->IsKindOf(CLASSINFO(wxControl))
+                || wxDynamicCast(parent, wxControl)
 #endif // wxUSE_CONTROLS
            )
         {
 #endif // wxUSE_CONTROLS
            )
         {
 #if wxUSE_STATBOX
 static void wxAdjustZOrder(wxWindow* parent)
 {
 #if wxUSE_STATBOX
 static void wxAdjustZOrder(wxWindow* parent)
 {
-    if (parent->IsKindOf(CLASSINFO(wxStaticBox)))
+    if (wxDynamicCast(parent, wxStaticBox))
     {
         // Set the z-order correctly
         SetWindowPos((HWND) parent->GetHWND(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
     {
         // Set the z-order correctly
         SetWindowPos((HWND) parent->GetHWND(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
 
                                                          const wxPoint& pos,
                                                          const wxSize& sz ) const
 {
                                                          const wxPoint& pos,
                                                          const wxSize& sz ) const
 {
-    wxCHECK_MSG( property->IsKindOf(CLASSINFO(wxDateProperty)),
+    wxCHECK_MSG( wxDynamicCast(property, wxDateProperty),
                  NULL,
                  wxT("DatePickerCtrl editor can only be used with wxDateProperty or derivative.") );
 
                  NULL,
                  wxT("DatePickerCtrl editor can only be used with wxDateProperty or derivative.") );
 
                                               wxWindow* wnd ) const
 {
     wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd;
                                               wxWindow* wnd ) const
 {
     wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd;
-    wxASSERT( ctrl && ctrl->IsKindOf(CLASSINFO(wxDatePickerCtrl)) );
+    wxASSERT( wxDynamicCast(ctrl, wxDatePickerCtrl) );
 
     wxDateTime dateValue(wxInvalidDateTime);
     wxVariant v(property->GetValue());
 
     wxDateTime dateValue(wxInvalidDateTime);
     wxVariant v(property->GetValue());
 bool wxPGDatePickerCtrlEditor::GetValueFromControl( wxVariant& variant, wxPGProperty* WXUNUSED(property), wxWindow* wnd ) const
 {
     wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd;
 bool wxPGDatePickerCtrlEditor::GetValueFromControl( wxVariant& variant, wxPGProperty* WXUNUSED(property), wxWindow* wnd ) const
 {
     wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd;
-    wxASSERT( ctrl && ctrl->IsKindOf(CLASSINFO(wxDatePickerCtrl)) );
+    wxASSERT( wxDynamicCast(ctrl, wxDatePickerCtrl) );
 
     variant = ctrl->GetValue();
 
 
     variant = ctrl->GetValue();
 
                                                       wxWindow* wnd ) const
 {
     wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd;
                                                       wxWindow* wnd ) const
 {
     wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd;
-    wxASSERT( ctrl && ctrl->IsKindOf(CLASSINFO(wxDatePickerCtrl)) );
+    wxASSERT( wxDynamicCast(ctrl, wxDatePickerCtrl) );
 
     wxDateProperty* prop = wxDynamicCast(property, wxDateProperty);
 
 
     wxDateProperty* prop = wxDynamicCast(property, wxDateProperty);
 
                          const wxPropertyGrid* propertyGrid, wxPGProperty* property,
                          int WXUNUSED(column), int item, int WXUNUSED(flags) ) const
     {
                          const wxPropertyGrid* propertyGrid, wxPGProperty* property,
                          int WXUNUSED(column), int item, int WXUNUSED(flags) ) const
     {
-        wxASSERT( property->IsKindOf(CLASSINFO(wxSystemColourProperty)) );
+        wxASSERT( wxDynamicCast(property, wxSystemColourProperty) );
         wxSystemColourProperty* prop = wxStaticCast(property, wxSystemColourProperty);
 
         dc.SetPen(*wxBLACK_PEN);
         wxSystemColourProperty* prop = wxStaticCast(property, wxSystemColourProperty);
 
         dc.SetPen(*wxBLACK_PEN);
 
     // Get old editor appearance
     wxTextCtrl* tc = NULL;
     wxComboCtrl* cb = NULL;
     // Get old editor appearance
     wxTextCtrl* tc = NULL;
     wxComboCtrl* cb = NULL;
-    if ( ctrl->IsKindOf(CLASSINFO(wxTextCtrl)) )
+    if ( wxDynamicCast(ctrl, wxTextCtrl) )
     {
         tc = (wxTextCtrl*) ctrl;
     }
     else
     {
     {
         tc = (wxTextCtrl*) ctrl;
     }
     else
     {
-        if ( ctrl->IsKindOf(CLASSINFO(wxComboCtrl)) )
+        if ( wxDynamicCast(ctrl, wxComboCtrl) )
         {
             cb = (wxComboCtrl*) ctrl;
             tc = cb->GetTextCtrl();
         {
             cb = (wxComboCtrl*) ctrl;
             tc = cb->GetTextCtrl();
 
     int flags = 0;
     if ( (property->GetFlags() & wxPG_PROP_PASSWORD) &&
 
     int flags = 0;
     if ( (property->GetFlags() & wxPG_PROP_PASSWORD) &&
-         property->IsKindOf(CLASSINFO(wxStringProperty)) )
+         wxDynamicCast(property, wxStringProperty) )
         flags |= wxTE_PASSWORD;
 
     wxWindow* wnd = propGrid->GenerateEditorTextCtrl(pos,sz,text,NULL,flags,
         flags |= wxTE_PASSWORD;
 
     wxWindow* wnd = propGrid->GenerateEditorTextCtrl(pos,sz,text,NULL,flags,
         int evtType = event.GetEventType();
 
         if ( m_property->HasFlag(wxPG_PROP_USE_DCC) &&
         int evtType = event.GetEventType();
 
         if ( m_property->HasFlag(wxPG_PROP_USE_DCC) &&
-             m_property->IsKindOf(CLASSINFO(wxBoolProperty)) &&
+             wxDynamicCast(m_property, wxBoolProperty) &&
              !m_combo->IsPopupShown() )
         {
             // Just check that it is in the text area
              !m_combo->IsPopupShown() )
         {
             // Just check that it is in the text area
     int odcbFlags = extraStyle | wxBORDER_NONE | wxTE_PROCESS_ENTER;
 
     if ( (property->GetFlags() & wxPG_PROP_USE_DCC) &&
     int odcbFlags = extraStyle | wxBORDER_NONE | wxTE_PROCESS_ENTER;
 
     if ( (property->GetFlags() & wxPG_PROP_USE_DCC) &&
-         (property->IsKindOf(CLASSINFO(wxBoolProperty)) ) )
+         wxDynamicCast(property, wxBoolProperty) )
         odcbFlags |= wxODCB_DCLICK_CYCLES;
 
     //
         odcbFlags |= wxODCB_DCLICK_CYCLES;
 
     //
 {
     wxASSERT( ctrl );
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
 {
     wxASSERT( ctrl );
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
-    wxASSERT( cb->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)));
+    wxASSERT( wxDynamicCast(cb, wxOwnerDrawnComboBox));
     int ind = property->GetChoiceSelection();
     cb->SetSelection(ind);
 }
     int ind = property->GetChoiceSelection();
     cb->SetSelection(ind);
 }
 {
     wxASSERT( ctrl );
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
 {
     wxASSERT( ctrl );
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
-    wxASSERT( cb->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)));
+    wxASSERT( wxDynamicCast(cb, wxOwnerDrawnComboBox));
 
     if (index < 0)
         index = cb->GetCount();
 
     if (index < 0)
         index = cb->GetCount();
 {
     wxASSERT( ctrl );
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
 {
     wxASSERT( ctrl );
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
-    wxASSERT( cb->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)));
+    wxASSERT( wxDynamicCast(cb, wxOwnerDrawnComboBox));
     wxCommandEvent evt(wxEVT_COMMAND_CHECKBOX_CLICKED,GetParent()->GetId());
 
     wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent();
     wxCommandEvent evt(wxEVT_COMMAND_CHECKBOX_CLICKED,GetParent()->GetId());
 
     wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent();
-    wxASSERT( propGrid->IsKindOf(CLASSINFO(wxPropertyGrid)) );
+    wxASSERT( wxDynamicCast(propGrid, wxPropertyGrid) );
     propGrid->HandleCustomEditorEvent(evt);
 }
 
     propGrid->HandleCustomEditorEvent(evt);
 }
 
 #ifdef __WXMAC__
         if ( m_wndEditor )
 #else
 #ifdef __WXMAC__
         if ( m_wndEditor )
 #else
-        if ( m_wndEditor && m_wndEditor->IsKindOf(CLASSINFO(wxTextCtrl)) )
+        if ( wxDynamicCast(m_wndEditor, wxTextCtrl) )
 #endif
             secWid += wxPG_TEXTCTRL_AND_BUTTON_SPACING;
     }
 #endif
             secWid += wxPG_TEXTCTRL_AND_BUTTON_SPACING;
     }
-    if ( wnd->IsKindOf(CLASSINFO(wxTextCtrl)) )
+    if ( wxDynamicCast(wnd, wxTextCtrl) )
         return wxStaticCast(wnd, wxTextCtrl);
 
         return wxStaticCast(wnd, wxTextCtrl);
 
-    if ( wnd->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
+    if ( wxDynamicCast(wnd, wxOwnerDrawnComboBox) )
     {
         wxOwnerDrawnComboBox* cb = wxStaticCast(wnd, wxOwnerDrawnComboBox);
         return cb->GetTextCtrl();
     {
         wxOwnerDrawnComboBox* cb = wxStaticCast(wnd, wxOwnerDrawnComboBox);
         return cb->GetTextCtrl();
 
             if ( changedProperty == GetSelection() )
             {
                 wxWindow* editor = GetEditorControl();
             if ( changedProperty == GetSelection() )
             {
                 wxWindow* editor = GetEditorControl();
-                wxASSERT( editor->IsKindOf(CLASSINFO(wxTextCtrl)) );
+                wxASSERT( wxDynamicCast(editor, wxTextCtrl) );
                 evtChangingValue = wxStaticCast(editor, wxTextCtrl)->GetValue();
             }
             else
                 evtChangingValue = wxStaticCast(editor, wxTextCtrl)->GetValue();
             }
             else
 wxStatusBar* wxPropertyGrid::GetStatusBar()
 {
     wxWindow* topWnd = ::wxGetTopLevelParent(this);
 wxStatusBar* wxPropertyGrid::GetStatusBar()
 {
     wxWindow* topWnd = ::wxGetTopLevelParent(this);
-    if ( topWnd && topWnd->IsKindOf(CLASSINFO(wxFrame)) )
+    if ( wxDynamicCast(topWnd, wxFrame) )
     {
         wxFrame* pFrame = wxStaticCast(topWnd, wxFrame);
         if ( pFrame )
     {
         wxFrame* pFrame = wxStaticCast(topWnd, wxFrame);
         if ( pFrame )
 
     //
     // For non-wxTextCtrl editors, we do need to revert the value
 
     //
     // For non-wxTextCtrl editors, we do need to revert the value
-    if ( !editor->IsKindOf(CLASSINFO(wxTextCtrl)) &&
+    if ( !wxDynamicCast(editor, wxTextCtrl) &&
          property == GetSelection() )
     {
         property->GetEditorClass()->UpdateControl(property, editor);
          property == GetSelection() )
     {
         property->GetEditorClass()->UpdateControl(property, editor);
     // Filter out excess wxTextCtrl modified events
     if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED && wnd )
     {
     // Filter out excess wxTextCtrl modified events
     if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED && wnd )
     {
-        if ( wnd->IsKindOf(CLASSINFO(wxTextCtrl)) )
+        if ( wxDynamicCast(wnd, wxTextCtrl) )
         {
             wxTextCtrl* tc = (wxTextCtrl*) wnd;
 
         {
             wxTextCtrl* tc = (wxTextCtrl*) wnd;
 
                 return true;
             m_prevTcValue = newTcValue;
         }
                 return true;
             m_prevTcValue = newTcValue;
         }
-        else if ( wnd->IsKindOf(CLASSINFO(wxComboCtrl)) )
+        else if ( wxDynamicCast(wnd, wxComboCtrl) )
         {
             // In some cases we might stumble unintentionally on
             // wxComboCtrl's embedded wxTextCtrl's events. Let's
             // avoid them.
         {
             // In some cases we might stumble unintentionally on
             // wxComboCtrl's embedded wxTextCtrl's events. Let's
             // avoid them.
-            if ( editorWnd->IsKindOf(CLASSINFO(wxTextCtrl)) )
+            if ( wxDynamicCast(editorWnd, wxTextCtrl) )
                 return false;
 
             wxComboCtrl* cc = (wxComboCtrl*) wnd;
                 return false;
 
             wxComboCtrl* cc = (wxComboCtrl*) wnd;
 
     // Hide popup on clicks
     if ( event.GetEventType() != wxEVT_MOTION )
 
     // Hide popup on clicks
     if ( event.GetEventType() != wxEVT_MOTION )
-        if ( wnd && wnd->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
+        if ( wxDynamicCast(wnd, wxOwnerDrawnComboBox) )
         {
             ((wxOwnerDrawnComboBox*)wnd)->HidePopup();
         }
         {
             ((wxOwnerDrawnComboBox*)wnd)->HidePopup();
         }
 
         return false;
 
     wxWindow* wnd = GetWindow();
         return false;
 
     wxWindow* wnd = GetWindow();
-    if ( !wnd->IsKindOf(CLASSINFO(wxTextCtrl)) )
+    if ( !wxDynamicCast(wnd, wxTextCtrl) )
         return true;
 
     // Do not allow zero-length string
         return true;
 
     // Do not allow zero-length string
     // unless property has string as preferred value type
     // To reduce code size, use conversion here as well
     if ( value.GetType() == wxPG_VARIANT_TYPE_STRING &&
     // unless property has string as preferred value type
     // To reduce code size, use conversion here as well
     if ( value.GetType() == wxPG_VARIANT_TYPE_STRING &&
-         !this->IsKindOf(CLASSINFO(wxEditEnumProperty)) )
+         !wxDynamicCastThis(wxEditEnumProperty) )
         return ValueFromString_( value, value.GetString(), wxPG_PROPERTY_SPECIFIC );
 
     return true;
         return ValueFromString_( value, value.GetString(), wxPG_PROPERTY_SPECIFIC );
 
     return true;
     wxString path;
     int indFilter = -1;
 
     wxString path;
     int indFilter = -1;
 
-    if ( property->IsKindOf(CLASSINFO(wxFileProperty)) )
+    if ( wxDynamicCast(property, wxFileProperty) )
     {
         fileProp = ((wxFileProperty*)property);
         wxFileName filename = fileProp->GetValue().GetString();
     {
         fileProp = ((wxFileProperty*)property);
         wxFileName filename = fileProp->GetValue().GetString();
 
 wxRichTextBuffer* wxRichTextObject::GetBuffer() const
 {
     const wxRichTextObject* obj = this;
 wxRichTextBuffer* wxRichTextObject::GetBuffer() const
 {
     const wxRichTextObject* obj = this;
-    while (obj && !obj->IsKindOf(CLASSINFO(wxRichTextBuffer)))
+    while (obj && !wxDynamicCast(obj, wxRichTextBuffer))
         obj = obj->GetParent();
     return wxDynamicCast(obj, wxRichTextBuffer);
 }
         obj = obj->GetParent();
     return wxDynamicCast(obj, wxRichTextBuffer);
 }
                     if (childRange.GetLength() == 0 && GetRange().GetLength() == 1)
                         childRange.SetEnd(childRange.GetEnd()+1);
 
                     if (childRange.GetLength() == 0 && GetRange().GetLength() == 1)
                         childRange.SetEnd(childRange.GetEnd()+1);
 
-                    if (!childRange.IsOutside(range) && child->IsKindOf(CLASSINFO(wxRichTextPlainText)))
+                    if (!childRange.IsOutside(range) && wxDynamicCast(child, wxRichTextPlainText))
                     {
                         foundCount ++;
                         wxRichTextAttr textAttr = para->GetCombinedAttributes(child->GetAttributes());
                     {
                         foundCount ++;
                         wxRichTextAttr textAttr = para->GetCombinedAttributes(child->GetAttributes());
             // If floating, ignore. We already laid out floats.
             // Also ignore if empty object, except if we haven't got any
             // size yet.
             // If floating, ignore. We already laid out floats.
             // Also ignore if empty object, except if we haven't got any
             // size yet.
-            if (!child->IsFloating() && child->GetRange().GetLength() != 0 && !child->IsKindOf(CLASSINFO(wxRichTextPlainText)))
+            if (!child->IsFloating() && child->GetRange().GetLength() != 0 && !wxDynamicCast(child, wxRichTextPlainText))
             {
                 if (child->GetCachedSize().x > minWidth)
                     minWidth = child->GetMinSize().x;
             {
                 if (child->GetCachedSize().x > minWidth)
                     minWidth = child->GetMinSize().x;
 
 
     int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_RESET;
 
 
     int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_RESET;
 
-    if (def->IsKindOf(CLASSINFO(wxRichTextListStyleDefinition)))
+    if (wxDynamicCast(def, wxRichTextListStyleDefinition))
     {
         flags |= wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY;
 
     {
         flags |= wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY;
 
     bool isPara = false;
 
     // Make sure the attr has the style name
     bool isPara = false;
 
     // Make sure the attr has the style name
-    if (def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition)))
+    if (wxDynamicCast(def, wxRichTextParagraphStyleDefinition))
     {
         isPara = true;
         attr.SetParagraphStyleName(def->GetName());
     {
         isPara = true;
         attr.SetParagraphStyleName(def->GetName());
         // to change its style independently.
         flags |= wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY;
     }
         // to change its style independently.
         flags |= wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY;
     }
-    else if (def->IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition)))
+    else if (wxDynamicCast(def, wxRichTextCharacterStyleDefinition))
         attr.SetCharacterStyleName(def->GetName());
         attr.SetCharacterStyleName(def->GetName());
-    else if (def->IsKindOf(CLASSINFO(wxRichTextBoxStyleDefinition)))
+    else if (wxDynamicCast(def, wxRichTextBoxStyleDefinition))
         attr.GetTextBoxAttr().SetBoxStyleName(def->GetName());
 
         attr.GetTextBoxAttr().SetBoxStyleName(def->GetName());
 
-    if (def->IsKindOf(CLASSINFO(wxRichTextBoxStyleDefinition)))
+    if (wxDynamicCast(def, wxRichTextBoxStyleDefinition))
     {
         if (GetFocusObject() && (GetFocusObject() != & GetBuffer()))
         {
     {
         if (GetFocusObject() && (GetFocusObject() != & GetBuffer()))
         {
 
 wxRichTextFormattingDialog* wxRichTextFormattingDialog::GetDialog(wxWindow* win)
 {
     wxWindow* p = win->GetParent();
 wxRichTextFormattingDialog* wxRichTextFormattingDialog::GetDialog(wxWindow* win)
 {
     wxWindow* p = win->GetParent();
-    while (p && !p->IsKindOf(CLASSINFO(wxRichTextFormattingDialog)))
+    while (p && !wxDynamicCast(p, wxRichTextFormattingDialog))
         p = p->GetParent();
     wxRichTextFormattingDialog* dialog = wxDynamicCast(p, wxRichTextFormattingDialog);
     return dialog;
         p = p->GetParent();
     wxRichTextFormattingDialog* dialog = wxDynamicCast(p, wxRichTextFormattingDialog);
     return dialog;
     if (event.LeftDown())
     {
         wxWindow* parent = GetParent();
     if (event.LeftDown())
     {
         wxWindow* parent = GetParent();
-        while (parent != NULL && !parent->IsKindOf(CLASSINFO(wxDialog)) && !parent->IsKindOf(CLASSINFO(wxFrame)))
+        while (parent != NULL && !wxDynamicCast(parent, wxDialog) && !wxDynamicCast(parent, wxFrame))
             parent = parent->GetParent();
 
         wxColourData data;
             parent = parent->GetParent();
 
         wxColourData data;
 
 
         int pages = wxRICHTEXT_FORMAT_STYLE_EDITOR;
 
 
         int pages = wxRICHTEXT_FORMAT_STYLE_EDITOR;
 
-        if (def->IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition)))
+        if (wxDynamicCast(def, wxRichTextCharacterStyleDefinition))
         {
             pages |= wxRICHTEXT_FORMAT_FONT;
         }
         {
             pages |= wxRICHTEXT_FORMAT_FONT;
         }
-        else if (def->IsKindOf(CLASSINFO(wxRichTextListStyleDefinition)))
+        else if (wxDynamicCast(def, wxRichTextListStyleDefinition))
         {
             pages |= wxRICHTEXT_FORMAT_LIST_STYLE|wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING;
         }
         {
             pages |= wxRICHTEXT_FORMAT_LIST_STYLE|wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING;
         }
-        else if (def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition)))
+        else if (wxDynamicCast(def, wxRichTextParagraphStyleDefinition))
         {
             pages |= wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS;
         }
         {
             pages |= wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS;
         }
-        else if (def->IsKindOf(CLASSINFO(wxRichTextBoxStyleDefinition)))
+        else if (wxDynamicCast(def, wxRichTextBoxStyleDefinition))
         {
             pages |= wxRICHTEXT_FORMAT_MARGINS|wxRICHTEXT_FORMAT_SIZE|wxRICHTEXT_FORMAT_BORDERS|wxRICHTEXT_FORMAT_BACKGROUND;
         }
         {
             pages |= wxRICHTEXT_FORMAT_MARGINS|wxRICHTEXT_FORMAT_SIZE|wxRICHTEXT_FORMAT_BORDERS|wxRICHTEXT_FORMAT_BACKGROUND;
         }
         {
             m_stylesListBox->GetStyleListBox()->SetItemCount(0);
 
         {
             m_stylesListBox->GetStyleListBox()->SetItemCount(0);
 
-            if (def->IsKindOf(CLASSINFO(wxRichTextListStyleDefinition)))
+            if (wxDynamicCast(def, wxRichTextListStyleDefinition))
                 GetStyleSheet()->RemoveListStyle((wxRichTextListStyleDefinition*) def, true);
                 GetStyleSheet()->RemoveListStyle((wxRichTextListStyleDefinition*) def, true);
-            else if (def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition)))
+            else if (wxDynamicCast(def, wxRichTextParagraphStyleDefinition))
                 GetStyleSheet()->RemoveParagraphStyle((wxRichTextParagraphStyleDefinition*) def, true);
                 GetStyleSheet()->RemoveParagraphStyle((wxRichTextParagraphStyleDefinition*) def, true);
-            else if (def->IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition)))
+            else if (wxDynamicCast(def, wxRichTextCharacterStyleDefinition))
                 GetStyleSheet()->RemoveCharacterStyle((wxRichTextCharacterStyleDefinition*) def, true);
                 GetStyleSheet()->RemoveCharacterStyle((wxRichTextCharacterStyleDefinition*) def, true);
-            else if (def->IsKindOf(CLASSINFO(wxRichTextBoxStyleDefinition)))
+            else if (wxDynamicCast(def, wxRichTextBoxStyleDefinition))
                 GetStyleSheet()->RemoveBoxStyle((wxRichTextBoxStyleDefinition*) def, true);
 
             m_stylesListBox->UpdateStyles();
                 GetStyleSheet()->RemoveBoxStyle((wxRichTextBoxStyleDefinition*) def, true);
 
             m_stylesListBox->UpdateStyles();
 
 void wxRichTextStylePage::OnNextStyleUpdate( wxUpdateUIEvent& event )
 {
     wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this);
 void wxRichTextStylePage::OnNextStyleUpdate( wxUpdateUIEvent& event )
 {
     wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this);
-    event.Enable(def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition)));
+    event.Enable(wxDynamicCast(def, wxRichTextParagraphStyleDefinition));
 }
 
 #endif // wxUSE_RICHTEXT
 }
 
 #endif // wxUSE_RICHTEXT