Fix wxTextEntryDialog parent when using wxTE_MULTILINE

Due to a clash between numeric values of wxTE_MULTILINE and wxDIALOG_NO_PARENT
text entry dialogs for multiline text didn't have a parent.

Fix this by always using a parent for them, which is better than never doing
it, even if still not ideal.

Closes #17136.
This commit is contained in:
Troels Knakkergaard 2016-03-05 03:37:02 +01:00 committed by Vadim Zeitlin
parent c9a3a23e5a
commit d5453228aa

View File

@ -71,7 +71,13 @@ bool wxTextEntryDialog::Create(wxWindow *parent,
long style,
const wxPoint& pos)
{
if ( !wxDialog::Create(GetParentForModalDialog(parent, style),
// Do not pass style to GetParentForModalDialog() as wxDIALOG_NO_PARENT
// has the same numeric value as wxTE_MULTILINE and so attempting to create
// a dialog for editing multiline text would also prevent it from having a
// parent which is undesirable. As it is, we can't create a text entry
// dialog without a parent which is not ideal neither but is a much less
// important problem.
if ( !wxDialog::Create(GetParentForModalDialog(parent, 0),
wxID_ANY, caption,
pos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) )