From e209beed8e221533f41e24bf0e139a6403e53715 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Apr 2016 03:38:17 +0200 Subject: [PATCH] Really fix initial text selection in wxTextEntryDialog Focus the text control after changing its value, this ensures that all text in it is initially selected, allowing the user to easily replace it if necessary. This was also the intention of bd9171c2adf099569543351554821008ddcff2b6, but it was insufficient for wxGTK where changing the text control value seems to reset its selection, unlike in wxMSW where the selection is preserved. See https://github.com/wxWidgets/wxWidgets/pull/266 --- src/generic/textdlgg.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp index 9f6773d344..3b35da40d3 100644 --- a/src/generic/textdlgg.cpp +++ b/src/generic/textdlgg.cpp @@ -126,8 +126,6 @@ bool wxTextEntryDialog::Create(wxWindow *parent, if ( style & wxCENTRE ) Centre( wxBOTH ); - m_textctrl->SetFocus(); - wxEndBusyCursor(); return true; @@ -138,7 +136,7 @@ bool wxTextEntryDialog::TransferDataToWindow() if ( m_textctrl ) { m_textctrl->SetValue(m_value); - m_textctrl->SelectAll(); + m_textctrl->SetFocus(); } return wxDialog::TransferDataToWindow();