From 70680b6177bdcebadfa329fae91c240aa9023f2b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Sep 2012 22:41:09 +0000 Subject: [PATCH] Use SelectAll() instead of SetSelection(-1, -1). The former is more clear and also shorter. Closes #14701. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/combocmn.cpp | 2 +- src/generic/grideditors.cpp | 2 +- src/generic/textdlgg.cpp | 2 +- src/generic/treectlg.cpp | 2 +- src/propgrid/editors.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 8bd7e4cd71..438a3e2790 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -765,7 +765,7 @@ void wxComboBoxExtraInputHandler::OnFocus(wxFocusEvent& event) if ( m_combo->GetTextCtrl() ) m_combo->GetTextCtrl()->SelectAll(); else - m_combo->SetSelection(-1,-1); + m_combo->SelectAll(); } // Send focus indication to parent. diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index fabd2b9227..36e067e9a6 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -496,7 +496,7 @@ void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue) { Text()->SetValue(startValue); Text()->SetInsertionPointEnd(); - Text()->SetSelection(-1, -1); + Text()->SelectAll(); Text()->SetFocus(); } diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp index d6e402bd1f..088391ea68 100644 --- a/src/generic/textdlgg.cpp +++ b/src/generic/textdlgg.cpp @@ -122,7 +122,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, if ( style & wxCENTRE ) Centre( wxBOTH ); - m_textctrl->SetSelection(-1, -1); + m_textctrl->SelectAll(); m_textctrl->SetFocus(); wxEndBusyCursor(); diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 42a9352fee..0eaabbf6de 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -454,7 +454,7 @@ wxTreeTextCtrl::wxTreeTextCtrl(wxGenericTreeCtrl *owner, (void)Create(m_owner, wxID_ANY, m_startValue, rect.GetPosition(), rect.GetSize()); - SetSelection(-1, -1); + SelectAll(); } void wxTreeTextCtrl::EndEdit(bool discardChanges) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index ca996be935..1c2b9b6039 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -497,7 +497,7 @@ void wxPGTextCtrlEditor_OnFocus( wxPGProperty* property, tc->SetValue(correctText); } - tc->SetSelection(-1,-1); + tc->SelectAll(); } void wxPGTextCtrlEditor::OnFocus( wxPGProperty* property, -- 2.45.2