#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"
dc.SetFont(font);
const wxBitmap& bmp = cell.GetBitmap();
- if ( bmp.Ok() &&
+ if ( bmp.IsOk() &&
// Do not draw oversized bitmap outside choice popup
((flags & ChoicePopup) || bmp.GetHeight() < rect.height )
)
propertyGrid->GetCellDisabledTextColour();
dc.SetTextForeground(hCol);
- // Must make the editor NULL to override it's own rendering
+ // Must make the editor NULL to override its own rendering
// code.
editor = NULL;
}
{
wxBitmap* bmp = property->GetValueImage();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
return wxSize(bmp->GetWidth(),bmp->GetHeight());
}
}
{
wxBitmap* bmp = m_valueBitmap;
- wxCHECK_RET( bmp && bmp->Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( bmp && bmp->IsOk(), wxT("invalid bitmap") );
wxCHECK_RET( rect.x >= 0, wxT("unexpected measure call") );
{
delete m_valueBitmap;
- if ( &bmp && bmp.Ok() )
+ if ( &bmp && bmp.IsOk() )
{
// Resize the image
wxSize maxSz = GetGrid()->GetImageSize();
// 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
}
}
+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