X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/propgrid/property.cpp diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 6a35823d03..fc1b9e948c 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -24,6 +24,7 @@ #include "wx/hash.h" #include "wx/string.h" #include "wx/log.h" + #include "wx/math.h" #include "wx/event.h" #include "wx/window.h" #include "wx/panel.h" @@ -499,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 @@ -2020,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; } @@ -2103,8 +2104,8 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp ) // Here we use high-quality wxImage scaling functions available wxImage img = bmp.ConvertToImage(); double scaleY = (double)maxSz.y / (double)imSz.y; - img.Rescale(((double)bmp.GetWidth())*scaleY, - ((double)bmp.GetHeight())*scaleY, + img.Rescale(wxRound(bmp.GetWidth()*scaleY), + wxRound(bmp.GetHeight()*scaleY), wxIMAGE_QUALITY_HIGH); wxBitmap* bmpNew = new wxBitmap(img, 32); #else @@ -2569,6 +2570,25 @@ void wxPGProperty::DeleteChildren() } } +bool wxPGProperty::IsChildSelected( bool recursive ) const +{ + size_t i; + for ( i = 0; i < GetChildCount(); i++ ) + { + wxPGProperty* child = Item(i); + + // Test child + if ( m_parentState->DoIsPropertySelected( child ) ) + return true; + + // Test sub-childs + if ( recursive && child->IsChildSelected( recursive ) ) + return true; + } + + return false; +} + wxVariant wxPGProperty::ChildChanged( wxVariant& WXUNUSED(thisValue), int WXUNUSED(childIndex), wxVariant& WXUNUSED(childValue) ) const