Compilation fixes to wxPropertyGrid after r76558.

We can't use _() in the static wxChar* arrays: first, because this doesn't
compile and second because if it did compile, it still wouldn't work as no
message catalogs are loaded yet when the static arrays are initialized.

Use wxTRANSLATE() instead and arrange for the strings to be translated when
they are really used. This is rather ugly and perhaps it would be better to
avoid passing untranslated labels array to the property classes but at least
the code compiles again now.

See #16266.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-05-17 13:41:27 +00:00
parent 0d54910b43
commit ebc6161c59
4 changed files with 84 additions and 79 deletions

View File

@@ -1114,7 +1114,8 @@ wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, con
}
}
wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
const char* const* untranslatedLabels,
const long* values, wxPGChoices* choicesCache, int value )
: wxPGProperty(label,name)
{
@@ -1127,9 +1128,12 @@ wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, con
m_choices.Assign( *choicesCache );
m_value = wxPGVariant_Zero;
}
else if ( labels )
else
{
m_choices.Add(labels,values);
for ( ; untranslatedLabels; untranslatedLabels++, values++ )
{
m_choices.Add(wxGetTranslation(*untranslatedLabels), *values);
}
if ( GetItemCount() )
SetValue( (long)value );
@@ -1376,7 +1380,7 @@ wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& n
SetValue( value );
}
wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const char* const* labels,
const long* values, wxPGChoices* choicesCache, const wxString& value )
: wxEnumProperty(label,name,labels,values,choicesCache,0)
{