Implementations of wxPGProperty::ChildChanged() must now return changed value of the whole property instead of writing it back to 'thisValue' argument. This change was done primarily for better compatibility with wxPython bindings, but should also be slightly more cleaner behavior API-wise. Breaks backwards compatibility, but not silently.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60936 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2009-06-07 07:52:53 +00:00
parent 25f49256ac
commit b8b1ff481c
11 changed files with 124 additions and 54 deletions

View File

@@ -161,7 +161,9 @@ void wxFontDataProperty::RefreshChildren()
Item(6)->SetValue( variant );
}
void wxFontDataProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const
wxVariant wxFontDataProperty::ChildChanged( wxVariant& thisValue,
int childIndex,
wxVariant& childValue ) const
{
wxFontData fontData;
fontData << thisValue;
@@ -183,7 +185,9 @@ void wxFontDataProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxV
fontData.SetChosenFont(font);
}
thisValue << fontData;
wxVariant newVariant;
newVariant << fontData;
return newVariant;
}
// -----------------------------------------------------------------------
@@ -211,7 +215,9 @@ void wxSizeProperty::RefreshChildren()
Item(1)->SetValue( (long)size.y );
}
void wxSizeProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const
wxVariant wxSizeProperty::ChildChanged( wxVariant& thisValue,
int childIndex,
wxVariant& childValue ) const
{
wxSize& size = wxSizeRefFromVariant(thisValue);
int val = wxPGVariantToInt(childValue);
@@ -220,6 +226,9 @@ void wxSizeProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVaria
case 0: size.x = val; break;
case 1: size.y = val; break;
}
wxVariant newVariant;
newVariant << size;
return newVariant;
}
// -----------------------------------------------------------------------
@@ -247,7 +256,9 @@ void wxPointProperty::RefreshChildren()
Item(1)->SetValue( (long)point.y );
}
void wxPointProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const
wxVariant wxPointProperty::ChildChanged( wxVariant& thisValue,
int childIndex,
wxVariant& childValue ) const
{
wxPoint& point = wxPointRefFromVariant(thisValue);
int val = wxPGVariantToInt(childValue);
@@ -256,6 +267,9 @@ void wxPointProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVari
case 0: point.x = val; break;
case 1: point.y = val; break;
}
wxVariant newVariant;
newVariant << point;
return newVariant;
}