X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6ca624a270e4dae1dfa6f47c96e2ee935a42fa1..d2e66707deb10dea6f92e3e4092f8a43ef942a5d:/src/propgrid/property.cpp diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 3ec89352eb..1e4f0cdfac 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" @@ -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,12 +2570,19 @@ void wxPGProperty::DeleteChildren() } } -bool wxPGProperty::IsChildSelected() const +bool wxPGProperty::IsChildSelected( bool recursive ) const { size_t i; for ( i = 0; i < GetChildCount(); i++ ) { - if ( m_parentState->DoIsPropertySelected( Item(i) ) ) + wxPGProperty* child = Item(i); + + // Test child + if ( m_parentState->DoIsPropertySelected( child ) ) + return true; + + // Test sub-childs + if ( recursive && child->IsChildSelected( recursive ) ) return true; }