Fix compilation of wxFormBuilder-generated code using wxTE_XXX

Move definitions of wxTE_XXX flags that can be used with the controls
other than wxTextCtrl to wx/defs.h, as wxFormBuilder generates code
using them without including wx/textctrl.h, so that this code doesn't
compile.

This was already addressed in 2970f22a89 (Include <wx/textctrl.h> from
<wx/combobox.h> for compatibility., 2012-03-25) for wxComboBox, but it
also happened for wxSpinCtrl, so fix it once and for all by always
defining these styles.

This partially reverts the changes done in c57e33394c ([...] moved
wxTextCtrl-specific stuff from defs.h/event.h to textctrl.h, 2001-07-29)
as it turns out, 20 years later, that this wasn't such a great idea.

See #14132.

Closes #19225.
This commit is contained in:
Vadim Zeitlin
2021-07-14 18:04:13 +01:00
parent 31d04f0396
commit d3eafa4d18
3 changed files with 15 additions and 11 deletions

View File

@@ -1736,6 +1736,19 @@ wxALLOW_COMBINING_ENUMS(wxDirection, wxGeometryCentre)
#define wxLI_HORIZONTAL wxHORIZONTAL
#define wxLI_VERTICAL wxVERTICAL
/*
wxTextCtrl flags also used by other controls.
wxComboBox, wxSpinCtrl and maybe others can also use some of these flags,
so define them in common header. More wxTE_XXX are in wx/textctrl.h.
*/
#define wxTE_READONLY 0x0010
#define wxTE_MULTILINE 0x0020
#define wxTE_PROCESS_TAB 0x0040
#define wxTE_PROCESS_ENTER 0x0400
#define wxTE_PASSWORD 0x0800
/*
* extended dialog specifiers. these values are stored in a different