Use wxDynamicCast() instead of IsKindOf() checks.

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
This commit is contained in:
Vadim Zeitlin
2012-06-01 11:01:18 +00:00
parent 7e8a20edc8
commit 345c78ca5f
29 changed files with 134 additions and 134 deletions

View File

@@ -203,7 +203,7 @@ bool wxNumericPropertyValidator::Validate(wxWindow* parent)
return false;
wxWindow* wnd = GetWindow();
if ( !wnd->IsKindOf(CLASSINFO(wxTextCtrl)) )
if ( !wxDynamicCast(wnd, wxTextCtrl) )
return true;
// Do not allow zero-length string
@@ -1080,7 +1080,7 @@ bool wxEnumProperty::ValidateValue( wxVariant& value, wxPGValidationInfo& WXUNUS
// 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;
@@ -1683,7 +1683,7 @@ bool wxPGFileDialogAdapter::DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty
wxString path;
int indFilter = -1;
if ( property->IsKindOf(CLASSINFO(wxFileProperty)) )
if ( wxDynamicCast(property, wxFileProperty) )
{
fileProp = ((wxFileProperty*)property);
wxFileName filename = fileProp->GetValue().GetString();