Refactor property attribute names in wxPGProperty::GetAttribute calls.
Use attribute constants instead of strings in wxPGProperty and wxPGDefaultRenderer classes and in NumericValidation() function. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2297,12 +2297,12 @@ inline unsigned int wxPropertyGridPageState::GetActualVirtualHeight() const
|
|||||||
|
|
||||||
inline wxString wxPGProperty::GetHintText() const
|
inline wxString wxPGProperty::GetHintText() const
|
||||||
{
|
{
|
||||||
wxVariant vHintText = GetAttribute(wxPGGlobalVars->m_strHint);
|
wxVariant vHintText = GetAttribute(wxPG_ATTR_HINT);
|
||||||
|
|
||||||
#if wxPG_COMPATIBILITY_1_4
|
#if wxPG_COMPATIBILITY_1_4
|
||||||
// Try the old, deprecated "InlineHelp"
|
// Try the old, deprecated "InlineHelp"
|
||||||
if ( vHintText.IsNull() )
|
if ( vHintText.IsNull() )
|
||||||
vHintText = GetAttribute(wxPGGlobalVars->m_strInlineHelp);
|
vHintText = GetAttribute(wxPG_ATTR_INLINE_HELP);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !vHintText.IsNull() )
|
if ( !vHintText.IsNull() )
|
||||||
|
@@ -264,7 +264,7 @@ bool wxPGDefaultRenderer::Render( wxDC& dc, const wxRect& rect,
|
|||||||
// Add units string?
|
// Add units string?
|
||||||
if ( propertyGrid->GetColumnCount() <= 2 )
|
if ( propertyGrid->GetColumnCount() <= 2 )
|
||||||
{
|
{
|
||||||
wxString unitsString = property->GetAttribute(wxPGGlobalVars->m_strUnits, wxEmptyString);
|
wxString unitsString = property->GetAttribute(wxPG_ATTR_UNITS, wxEmptyString);
|
||||||
if ( !unitsString.empty() )
|
if ( !unitsString.empty() )
|
||||||
text = wxString::Format(wxS("%s %s"), text.c_str(), unitsString.c_str() );
|
text = wxString::Format(wxS("%s %s"), text.c_str(), unitsString.c_str() );
|
||||||
}
|
}
|
||||||
@@ -810,7 +810,7 @@ void wxPGProperty::GetDisplayInfo( unsigned int column,
|
|||||||
else if ( column == 1 )
|
else if ( column == 1 )
|
||||||
*pString = GetDisplayedString();
|
*pString = GetDisplayedString();
|
||||||
else if ( column == 2 )
|
else if ( column == 2 )
|
||||||
*pString = GetAttribute(wxPGGlobalVars->m_strUnits, wxEmptyString);
|
*pString = GetAttribute(wxPG_ATTR_UNITS, wxEmptyString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -857,7 +857,7 @@ wxString wxPGProperty::GetColumnText( unsigned int col, int choiceIndex ) const
|
|||||||
else if ( col == 1 )
|
else if ( col == 1 )
|
||||||
return GetDisplayedString();
|
return GetDisplayedString();
|
||||||
else if ( col == 2 )
|
else if ( col == 2 )
|
||||||
return GetAttribute(wxPGGlobalVars->m_strUnits, wxEmptyString);
|
return GetAttribute(wxPG_ATTR_UNITS, wxEmptyString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -357,14 +357,14 @@ bool NumericValidation( const wxPGProperty* property,
|
|||||||
bool minOk = false;
|
bool minOk = false;
|
||||||
bool maxOk = false;
|
bool maxOk = false;
|
||||||
|
|
||||||
variant = property->GetAttribute(wxPGGlobalVars->m_strMin);
|
variant = property->GetAttribute(wxPG_ATTR_MIN);
|
||||||
if ( !variant.IsNull() )
|
if ( !variant.IsNull() )
|
||||||
{
|
{
|
||||||
variant.Convert(&min);
|
variant.Convert(&min);
|
||||||
minOk = true;
|
minOk = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
variant = property->GetAttribute(wxPGGlobalVars->m_strMax);
|
variant = property->GetAttribute(wxPG_ATTR_MAX);
|
||||||
if ( !variant.IsNull() )
|
if ( !variant.IsNull() )
|
||||||
{
|
{
|
||||||
variant.Convert(&max);
|
variant.Convert(&max);
|
||||||
@@ -443,14 +443,14 @@ bool NumericValidation( const wxPGProperty* property,
|
|||||||
bool minOk = false;
|
bool minOk = false;
|
||||||
bool maxOk = false;
|
bool maxOk = false;
|
||||||
|
|
||||||
variant = property->GetAttribute(wxPGGlobalVars->m_strMin);
|
variant = property->GetAttribute(wxPG_ATTR_MIN);
|
||||||
if ( !variant.IsNull() )
|
if ( !variant.IsNull() )
|
||||||
{
|
{
|
||||||
variant.Convert(&min);
|
variant.Convert(&min);
|
||||||
minOk = true;
|
minOk = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
variant = property->GetAttribute(wxPGGlobalVars->m_strMax);
|
variant = property->GetAttribute(wxPG_ATTR_MAX);
|
||||||
if ( !variant.IsNull() )
|
if ( !variant.IsNull() )
|
||||||
{
|
{
|
||||||
variant.Convert(&max);
|
variant.Convert(&max);
|
||||||
|
Reference in New Issue
Block a user