wxPGProperty::GenerateComposedValue() -> protected DoGenerateComposedValue(), added simple public GenerateComposedValue()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2008-10-17 16:46:38 +00:00
parent 157a8f7002
commit c82a80e81f
4 changed files with 24 additions and 19 deletions

View File

@@ -1390,13 +1390,14 @@ public:
} }
/** /**
Composes text from values of child properties. You usually do not have Composes text from values of child properties.
to care about arguments other than 'text'.
*/ */
void GenerateComposedValue( wxString& text, wxString GenerateComposedValue() const
int argFlags = wxPG_VALUE_IS_CURRENT, {
const wxVariantList* valueOverrides = NULL, wxString s;
wxPGHashMapS2S* childResults = NULL ) const; DoGenerateComposedValue(s);
return s;
}
/** Returns property's label. */ /** Returns property's label. */
const wxString& GetLabel() const { return m_label; } const wxString& GetLabel() const { return m_label; }
@@ -2054,6 +2055,11 @@ protected:
int index = -1, int index = -1,
bool correct_mode = true ); bool correct_mode = true );
void DoGenerateComposedValue( wxString& text,
int argFlags = wxPG_VALUE_IS_CURRENT,
const wxVariantList* valueOverrides = NULL,
wxPGHashMapS2S* childResults = NULL ) const;
void DoSetName(const wxString& str) { m_name = str; } void DoSetName(const wxString& str) { m_name = str; }
void InitAfterAdded( wxPropertyGridPageState* pageState, void InitAfterAdded( wxPropertyGridPageState* pageState,

View File

@@ -929,10 +929,9 @@ public:
void Empty(); void Empty();
/** /**
Composes text from values of child properties. You usually do not have Composes text from values of child properties.
to care about arguments other than 'text'.
*/ */
void GenerateComposedValue( wxString& text, int argFlags = 0 ) const; wxString GenerateComposedValue() const;
/** /**
Returns property attribute value, null variant if not found. Returns property attribute value, null variant if not found.

View File

@@ -664,10 +664,10 @@ wxString wxPGProperty::GetColumnText( unsigned int col ) const
return wxEmptyString; return wxEmptyString;
} }
void wxPGProperty::GenerateComposedValue( wxString& text, void wxPGProperty::DoGenerateComposedValue( wxString& text,
int argFlags, int argFlags,
const wxVariantList* valueOverrides, const wxVariantList* valueOverrides,
wxPGHashMapS2S* childResults ) const wxPGHashMapS2S* childResults ) const
{ {
int i; int i;
int iMax = m_children.size(); int iMax = m_children.size();
@@ -733,8 +733,8 @@ void wxPGProperty::GenerateComposedValue( wxString& text,
childValue.GetType() == wxPG_VARIANT_TYPE_LIST ) childValue.GetType() == wxPG_VARIANT_TYPE_LIST )
{ {
wxVariantList& childList = childValue.GetList(); wxVariantList& childList = childValue.GetList();
GenerateComposedValue(s, argFlags|wxPG_COMPOSITE_FRAGMENT, DoGenerateComposedValue(s, argFlags|wxPG_COMPOSITE_FRAGMENT,
&childList, childResults); &childList, childResults);
} }
else else
{ {
@@ -797,7 +797,7 @@ wxString wxPGProperty::ValueToString( wxVariant& WXUNUSED(value),
"implementation only works if value is m_value." ); "implementation only works if value is m_value." );
wxString text; wxString text;
GenerateComposedValue(text, argFlags); DoGenerateComposedValue(text, argFlags);
return text; return text;
} }
@@ -2115,7 +2115,7 @@ wxPGProperty* wxPGProperty::UpdateParentValues()
!parent->IsCategory() && !parent->IsRoot() ) !parent->IsCategory() && !parent->IsRoot() )
{ {
wxString s; wxString s;
parent->GenerateComposedValue(s); parent->DoGenerateComposedValue(s);
parent->m_value = s; parent->m_value = s;
return parent->UpdateParentValues(); return parent->UpdateParentValues();
} }

View File

@@ -79,7 +79,7 @@ void wxStringProperty::OnSetValue()
if ( HasFlag(wxPG_PROP_COMPOSED_VALUE) ) if ( HasFlag(wxPG_PROP_COMPOSED_VALUE) )
{ {
wxString s; wxString s;
GenerateComposedValue(s); DoGenerateComposedValue(s);
m_value = s; m_value = s;
} }
} }
@@ -101,7 +101,7 @@ wxString wxStringProperty::ValueToString( wxVariant& value,
"Sorry, currently default wxPGProperty::ValueToString() " "Sorry, currently default wxPGProperty::ValueToString() "
"implementation only works if value is m_value." ); "implementation only works if value is m_value." );
GenerateComposedValue(s, argFlags); DoGenerateComposedValue(s, argFlags);
} }
return s; return s;