From 74a60516b92f583d3dc7001023d6e29bf8af4f63 Mon Sep 17 00:00:00 2001 From: valid-ptr Date: Fri, 22 May 2020 11:27:09 +0300 Subject: [PATCH] Respect border styles for text part of generic wxSpinCtrlDouble Specifying e.g. wxBORDER_NONE for wxSpinCtrlDouble should work, i.e. remove the border from the wxTextCtrl used by it internally in the generic version, so add wxBORDER_MASK to the list of styles respected by this wxTextCtrl. Closes https://github.com/wxWidgets/wxWidgets/pull/1864 --- src/generic/spinctlg.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 5d0bcf5972..7efc9355a4 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -66,11 +66,13 @@ class wxSpinCtrlTextGeneric : public wxTextCtrl public: wxSpinCtrlTextGeneric(wxSpinCtrlGenericBase *spin, const wxString& value, long style=0) : wxTextCtrl(spin, wxID_ANY, value, wxDefaultPosition, wxDefaultSize, - // This is tricky: we want to honour any alignment flags - // but not wxALIGN_CENTER_VERTICAL because it's the same + // This is tricky: we want to honour all alignment flags + // except 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) + // asterisks in spin control. We also want to respect + // wxTE_PROCESS and the border flags as well. + style & (wxALIGN_MASK | wxBORDER_MASK | wxTE_PROCESS_ENTER) + & ~wxTE_PASSWORD) { m_spin = spin;