#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"
#if wxPG_COMPATIBILITY_1_4
-// Used to establish backwards compatiblity
+// Used to establish backwards compatibility
const char* g_invalidStringContent = "@__TOTALLY_INVALID_STRING__@";
#endif
// (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
}
// Convert semicolon delimited tokens into child values.
-bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int argFlags ) const
+bool wxPGProperty::StringToValue( wxVariant& v, const wxString& text, int argFlags ) const
{
if ( !GetChildCount() )
return false;
}
if ( changed )
- variant = list;
+ v = list;
return changed;
}
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;
}
// 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() 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;
}