}
else if ( value.GetType() == wxPG_VARIANT_TYPE_LONGLONG )
{
- wxLongLong ll = value.GetLongLong();
- return ll.ToString();
+ wxLongLong ll = value.GetLongLong();
+ return ll.ToString();
}
return wxEmptyString;
#define wxPG_UINT_TEMPLATE_MAX 8
-static const wxChar* gs_uintTemplates32[wxPG_UINT_TEMPLATE_MAX] = {
+static const wxChar* const gs_uintTemplates32[wxPG_UINT_TEMPLATE_MAX] = {
wxT("%x"),wxT("0x%x"),wxT("$%x"),
wxT("%X"),wxT("0x%X"),wxT("$%X"),
wxT("%u"),wxT("%o")
};
-static const wxChar* gs_uintTemplates64[wxPG_UINT_TEMPLATE_MAX] = {
- wxT("%") wxLongLongFmtSpec wxT("x"),
- wxT("0x%") wxLongLongFmtSpec wxT("x"),
- wxT("$%") wxLongLongFmtSpec wxT("x"),
- wxT("%") wxLongLongFmtSpec wxT("X"),
- wxT("0x%") wxLongLongFmtSpec wxT("X"),
- wxT("$%") wxLongLongFmtSpec wxT("X"),
- wxT("%") wxLongLongFmtSpec wxT("u"),
- wxT("%") wxLongLongFmtSpec wxT("o")
+static const char* const gs_uintTemplates64[wxPG_UINT_TEMPLATE_MAX] = {
+ "%" wxLongLongFmtSpec "x",
+ "0x%" wxLongLongFmtSpec "x",
+ "$%" wxLongLongFmtSpec "x",
+ "%" wxLongLongFmtSpec "X",
+ "0x%" wxLongLongFmtSpec "X",
+ "$%" wxLongLongFmtSpec "X",
+ "%" wxLongLongFmtSpec "u",
+ "%" wxLongLongFmtSpec "o"
};
WX_PG_IMPLEMENT_PROPERTY_CLASS(wxUIntProperty,wxPGProperty,
WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEnumProperty,long,Choice)
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
const long* values, int value ) : wxPGProperty(label,name)
{
SetIndex(0);
}
}
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
const long* values, wxPGChoices* choicesCache, int value )
: wxPGProperty(label,name)
{
wxString variantType = m_value.GetType();
if ( variantType == wxPG_VARIANT_TYPE_LONG )
+ {
ValueFromInt_( m_value, m_value.GetLong(), wxPG_FULL_VALUE );
+ }
else if ( variantType == wxPG_VARIANT_TYPE_STRING )
+ {
ValueFromString_( m_value, m_value.GetString(), 0 );
+ }
else
+ {
wxFAIL;
+ }
if ( ms_nextIndex != -2 )
{
// If text not any of the choices, store as text instead
// (but only if we are wxEditEnumProperty)
- if ( useIndex == -1 &&
- (value.GetType() != wxPG_VARIANT_TYPE_STRING || (m_value.GetString() != text)) &&
- isEdit )
+ if ( useIndex == -1 && isEdit )
{
asText = true;
}
WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEditEnumProperty,wxString,ComboBox)
-wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
const long* values, const wxString& value )
: wxEnumProperty(label,name,labels,values,0)
{
SetValue( value );
}
-wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
const long* values, wxPGChoices* choicesCache, const wxString& value )
: wxEnumProperty(label,name,labels,values,choicesCache,0)
{
}
wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name,
- const wxChar** labels, const long* values, long value ) : wxPGProperty(label,name)
+ const wxChar* const* labels, const long* values, long value ) : wxPGProperty(label,name)
{
m_oldChoicesData = NULL;
wxFileProperty::~wxFileProperty() {}
-#if wxUSE_VALIDATORS
-
wxValidator* wxFileProperty::GetClassValidator()
{
+#if wxUSE_VALIDATORS
WX_PG_DOGETVALIDATOR_ENTRY()
// Atleast wxPython 2.6.2.1 required that the string argument is given
validator->SetExcludes(exChars);
WX_PG_DOGETVALIDATOR_EXIT(validator)
+#else
+ return NULL;
+#endif
}
wxValidator* wxFileProperty::DoGetValidator() const
return GetClassValidator();
}
-#endif
-
void wxFileProperty::OnSetValue()
{
const wxString& fnstr = m_value.GetString();
wxBoxSizer* rowsizer = new wxBoxSizer( wxHORIZONTAL );
m_edValue = new wxTextCtrl(this,21,wxEmptyString,
wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER);
+#if wxUSE_VALIDATORS
wxValidator* validator = GetTextCtrlValidator();
if ( validator )
{
m_edValue->SetValidator( *validator );
delete validator;
}
+#endif
rowsizer->Add( m_edValue,
1, wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL|wxALL, spacing );
// Need to replace backslashes with empty characters
// (opposite what is done in GenerateValueString).
- token.Replace ( wxS("\\"), wxEmptyString, true );
+ token.Replace ( wxS("\\\\"), wxS("\\"), true );
arr.Add( token );