Fix setting wxPG_PROP_STRING_PASSWORD attribute

For built-in attributes (like wxPG_PROP_STRING_PASSWORD) wxPGProperty::DoSetAttribute() should return true to give the option (controlled by wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES style) to prevent the attribute from being stored into property's attribute storage.
This commit is contained in:
Artur Wieczorek
2019-04-20 16:32:37 +02:00
parent 01e21b4f38
commit e6e8f45051
2 changed files with 5 additions and 4 deletions

View File

@@ -100,8 +100,9 @@ struct wxPGPaintData
*/
#define wxPG_FLOAT_PRECISION wxS("Precision")
/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed
to textctrl etc.).
/** Built-in attribute of type @c bool. Default value is @false,
When set tu @true, the text will be echoed as asterisks (wxTE_PASSWORD
will be passed to textctrl etc.).
*/
#define wxPG_STRING_PASSWORD wxS("Password")

View File

@@ -145,10 +145,10 @@ bool wxStringProperty::DoSetAttribute( const wxString& name, wxVariant& value )
m_flags &= ~(wxPG_PROP_PASSWORD);
if ( value.GetLong() ) m_flags |= wxPG_PROP_PASSWORD;
RecreateEditor();
return false;
}
return true;
}
return false;
}
// -----------------------------------------------------------------------
// wxNumericPropertyValidator