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:
@@ -493,7 +493,9 @@ void wxVectorProperty::RefreshChildren()
|
||||
Item(2)->SetValue( vector.z );
|
||||
}
|
||||
|
||||
void wxVectorProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const
|
||||
wxVariant wxVectorProperty::ChildChanged( wxVariant& thisValue,
|
||||
int childIndex,
|
||||
wxVariant& childValue ) const
|
||||
{
|
||||
wxVector3f vector;
|
||||
vector << thisValue;
|
||||
@@ -503,7 +505,9 @@ void wxVectorProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVar
|
||||
case 1: vector.y = childValue.GetDouble(); break;
|
||||
case 2: vector.z = childValue.GetDouble(); break;
|
||||
}
|
||||
thisValue << vector;
|
||||
wxVariant newVariant;
|
||||
newVariant << vector;
|
||||
return newVariant;
|
||||
}
|
||||
|
||||
|
||||
@@ -541,7 +545,9 @@ void wxTriangleProperty::RefreshChildren()
|
||||
Item(2)->SetValue( WXVARIANT(triangle.c) );
|
||||
}
|
||||
|
||||
void wxTriangleProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const
|
||||
wxVariant wxTriangleProperty::ChildChanged( wxVariant& thisValue,
|
||||
int childIndex,
|
||||
wxVariant& childValue ) const
|
||||
{
|
||||
wxTriangle triangle;
|
||||
triangle << thisValue;
|
||||
@@ -552,7 +558,9 @@ void wxTriangleProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxV
|
||||
case 1: triangle.b = vector; break;
|
||||
case 2: triangle.c = vector; break;
|
||||
}
|
||||
thisValue << triangle;
|
||||
wxVariant newVariant;
|
||||
newVariant << triangle;
|
||||
return newVariant;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -76,8 +76,9 @@ public:
|
||||
const wxVector3f& value = wxVector3f() );
|
||||
virtual ~wxVectorProperty();
|
||||
|
||||
virtual void ChildChanged( wxVariant& thisValue,
|
||||
int childIndex, wxVariant& childValue ) const;
|
||||
virtual wxVariant ChildChanged( wxVariant& thisValue,
|
||||
int childIndex,
|
||||
wxVariant& childValue ) const;
|
||||
virtual void RefreshChildren();
|
||||
|
||||
protected:
|
||||
@@ -108,8 +109,9 @@ public:
|
||||
const wxTriangle& value = wxTriangle() );
|
||||
virtual ~wxTriangleProperty();
|
||||
|
||||
virtual void ChildChanged( wxVariant& thisValue,
|
||||
int childIndex, wxVariant& childValue ) const;
|
||||
virtual wxVariant ChildChanged( wxVariant& thisValue,
|
||||
int childIndex,
|
||||
wxVariant& childValue ) const;
|
||||
virtual void RefreshChildren();
|
||||
|
||||
protected:
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -34,8 +34,9 @@ public:
|
||||
// in base class to function properly.
|
||||
virtual wxVariant DoGetValue() const;
|
||||
|
||||
virtual void ChildChanged( wxVariant& thisValue,
|
||||
int childIndex, wxVariant& childValue ) const;
|
||||
virtual wxVariant ChildChanged( wxVariant& thisValue,
|
||||
int childIndex,
|
||||
wxVariant& childValue ) const;
|
||||
virtual void RefreshChildren();
|
||||
virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event );
|
||||
|
||||
@@ -56,8 +57,9 @@ public:
|
||||
const wxSize& value = wxSize() );
|
||||
virtual ~wxSizeProperty();
|
||||
|
||||
virtual void ChildChanged( wxVariant& thisValue,
|
||||
int childIndex, wxVariant& childValue ) const;
|
||||
virtual wxVariant ChildChanged( wxVariant& thisValue,
|
||||
int childIndex,
|
||||
wxVariant& childValue ) const;
|
||||
virtual void RefreshChildren();
|
||||
|
||||
protected:
|
||||
@@ -80,8 +82,9 @@ public:
|
||||
const wxPoint& value = wxPoint() );
|
||||
virtual ~wxPointProperty();
|
||||
|
||||
virtual void ChildChanged( wxVariant& thisValue,
|
||||
int childIndex, wxVariant& childValue ) const;
|
||||
virtual wxVariant ChildChanged( wxVariant& thisValue,
|
||||
int childIndex,
|
||||
wxVariant& childValue ) const;
|
||||
virtual void RefreshChildren();
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user