Explicitly reject the use of wxTE_PASSWORD in generic wxSpinCtrl.

wxTE_PASSWORD has the same value as wxALIGN_CENTRE_VERTICAL which could be
implicitly specified as part of wxALIGN_CENTRE, but should never be used with
wxSpinCtrl, so explicitly filter it out when creating the associated
wxTextCtrl.

Closes #14452.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-08-30 20:25:24 +00:00
parent 9bd25c8670
commit 9ecc6bc2f1

View File

@@ -65,7 +65,11 @@ class wxSpinCtrlTextGeneric : public wxTextCtrl
public:
wxSpinCtrlTextGeneric(wxSpinCtrlGenericBase *spin, const wxString& value, long style=0)
: wxTextCtrl(spin->GetParent(), wxID_ANY, value, wxDefaultPosition, wxDefaultSize,
style & (wxALIGN_MASK | wxTE_PROCESS_ENTER))
// This is tricky: we want to honour any alignment flags
// but not wxALIGN_CENTER_VERTICAL because it's the same
// as wxTE_PASSWORD and we definitely don't want to show
// asterisks in spin control.
style & (wxALIGN_MASK | wxTE_PROCESS_ENTER) & ~wxTE_PASSWORD)
{
m_spin = spin;