← Back to team overview

kicad-developers team mailing list archive

[PATCH] Select all previously searched text when opening Find / FindAndReplace dialogs

 

Hi all,

Here is a small patch to select the textbox when the Find dialog is opened.
This is more consistent with most text editors as far as I can tell, and
allows typing the needle right after Ctrl+F.
It used to bother me and I figured it would be an easy introduction to
contributing :)

Martin

PS: The following page http://www.kicad-pcb.org/display/DEV/Getting+Started
reads "git bzr clone lp:inkscape inkscape" where "inkscape should obviously
be "kicad"
From d4f607e297a84d9d59fd4ac2ba015b5a50b24ffb Mon Sep 17 00:00:00 2001
From: Martin d'Allens <martin.dallens@xxxxxxxxx>
Date: Sun, 14 Jun 2015 15:54:21 +0200
Subject: [PATCH] Select all previously searched text when opening Find /
 FindAndReplace dialogs

---
 eeschema/dialogs/dialog_schematic_find.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eeschema/dialogs/dialog_schematic_find.cpp b/eeschema/dialogs/dialog_schematic_find.cpp
index 63800ef..5faa294 100644
--- a/eeschema/dialogs/dialog_schematic_find.cpp
+++ b/eeschema/dialogs/dialog_schematic_find.cpp
@@ -264,8 +264,10 @@ void DIALOG_SCH_FIND::SetFindEntries( const wxArrayString& aEntries )
 {
     m_comboFind->Append( aEntries );
 
-    if( m_comboFind->GetCount() )
+    if( m_comboFind->GetCount() ) {
         m_comboFind->SetSelection( 0 );
+        m_comboFind->SelectAll();
+    }
 }
 
 
@@ -273,6 +275,8 @@ void DIALOG_SCH_FIND::SetReplaceEntries( const wxArrayString& aEntries )
 {
     m_comboReplace->Append( aEntries );
 
-    if( m_comboReplace->GetCount() )
+    if( m_comboReplace->GetCount() ) {
         m_comboReplace->SetSelection( 0 );
+        m_comboFind->SelectAll();
+    }
 }
-- 
2.1.4


Follow ups