[Idle-dev] CVS: idle SearchDialog.py,1.3,1.4 SearchDialogBase.py,1.4,1.5

Chui Tey teyc@users.sourceforge.net
Tue, 05 Nov 2002 18:18:47 -0800


Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv18298

Modified Files:
	SearchDialog.py SearchDialogBase.py 
Log Message:
By default when getting the search menu, the currently highligted 
text is the search term.


Index: SearchDialog.py
===================================================================
RCS file: /cvsroot/idlefork/idle/SearchDialog.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** SearchDialog.py	18 Sep 2002 03:10:10 -0000	1.3
--- SearchDialog.py	6 Nov 2002 02:18:45 -0000	1.4
***************
*** 12,16 ****
  
  def find(text):
!     return _setup(text).open(text)
  
  def find_again(text):
--- 12,17 ----
  
  def find(text):
!     pat = text.get("sel.first", "sel.last")
!     return _setup(text).open(text,pat)
  
  def find_again(text):

Index: SearchDialogBase.py
===================================================================
RCS file: /cvsroot/idlefork/idle/SearchDialogBase.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** SearchDialogBase.py	4 Nov 2002 23:07:51 -0000	1.4
--- SearchDialogBase.py	6 Nov 2002 02:18:45 -0000	1.5
***************
*** 12,16 ****
          self.top = None
  
!     def open(self, text):
          self.text = text
          if not self.top:
--- 12,16 ----
          self.top = None
  
!     def open(self, text, searchphrase=None):
          self.text = text
          if not self.top:
***************
*** 19,22 ****
--- 19,25 ----
              self.top.deiconify()
              self.top.tkraise()
+         if searchphrase:
+             self.ent.delete(0,"end")
+             self.ent.insert("end",searchphrase)
          self.ent.focus_set()
          self.ent.selection_range(0, "end")