]> git.saurik.com Git - wxWidgets.git/commitdiff
Use SelectAll() instead of SetSelection(-1, -1).
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 27 Sep 2012 22:41:09 +0000 (22:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 27 Sep 2012 22:41:09 +0000 (22:41 +0000)
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
src/generic/grideditors.cpp
src/generic/textdlgg.cpp
src/generic/treectlg.cpp
src/propgrid/editors.cpp

index 8bd7e4cd71aa23572789db5e41805bddbb189f1e..438a3e27908f7731749cf243e8bea4669f7e8dd1 100644 (file)
@@ -765,7 +765,7 @@ void wxComboBoxExtraInputHandler::OnFocus(wxFocusEvent& event)
         if ( m_combo->GetTextCtrl() )
             m_combo->GetTextCtrl()->SelectAll();
         else
         if ( m_combo->GetTextCtrl() )
             m_combo->GetTextCtrl()->SelectAll();
         else
-            m_combo->SetSelection(-1,-1);
+            m_combo->SelectAll();
     }
 
     // Send focus indication to parent.
     }
 
     // Send focus indication to parent.
index fabd2b92275e9f1ccbc38a9890334cb6733dd182..36e067e9a631695e75fe1034dbdf83aa4c09cdd8 100644 (file)
@@ -496,7 +496,7 @@ void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue)
 {
     Text()->SetValue(startValue);
     Text()->SetInsertionPointEnd();
 {
     Text()->SetValue(startValue);
     Text()->SetInsertionPointEnd();
-    Text()->SetSelection(-1, -1);
+    Text()->SelectAll();
     Text()->SetFocus();
 }
 
     Text()->SetFocus();
 }
 
index d6e402bd1f0e592c452740debe0e3d80dffc9b8f..088391ea688a67f5c4b4ad4e6986d3ad09058de4 100644 (file)
@@ -122,7 +122,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
     if ( style & wxCENTRE )
         Centre( wxBOTH );
 
     if ( style & wxCENTRE )
         Centre( wxBOTH );
 
-    m_textctrl->SetSelection(-1, -1);
+    m_textctrl->SelectAll();
     m_textctrl->SetFocus();
 
     wxEndBusyCursor();
     m_textctrl->SetFocus();
 
     wxEndBusyCursor();
index 42a9352fee253fa7296f9f3905baae1401cd9804..0eaabbf6dea97ffaa23bdb393c56ae9e925528ca 100644 (file)
@@ -454,7 +454,7 @@ wxTreeTextCtrl::wxTreeTextCtrl(wxGenericTreeCtrl *owner,
     (void)Create(m_owner, wxID_ANY, m_startValue,
                  rect.GetPosition(), rect.GetSize());
 
     (void)Create(m_owner, wxID_ANY, m_startValue,
                  rect.GetPosition(), rect.GetSize());
 
-    SetSelection(-1, -1);
+    SelectAll();
 }
 
 void wxTreeTextCtrl::EndEdit(bool discardChanges)
 }
 
 void wxTreeTextCtrl::EndEdit(bool discardChanges)
index ca996be9352e7e430d7a9e7358edc37fde813403..1c2b9b60396ac5975a0a9d9def80f079cc0093a0 100644 (file)
@@ -497,7 +497,7 @@ void wxPGTextCtrlEditor_OnFocus( wxPGProperty* property,
         tc->SetValue(correctText);
     }
 
         tc->SetValue(correctText);
     }
 
-    tc->SetSelection(-1,-1);
+    tc->SelectAll();
 }
 
 void wxPGTextCtrlEditor::OnFocus( wxPGProperty* property,
 }
 
 void wxPGTextCtrlEditor::OnFocus( wxPGProperty* property,