[Tkabber-dev] r1003 - in trunk/tkabber-plugins: . debug spy

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Mar 4 14:08:06 MSK 2007


Author: sergei
Date: 2007-03-04 14:08:04 +0300 (Sun, 04 Mar 2007)
New Revision: 1003

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/debug/debug.tcl
   trunk/tkabber-plugins/spy/spy.tcl
Log:
	* debug/debug.tcl, spy/spy.tcl: Use new unified search panel
	  interface.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2007-03-04 11:07:50 UTC (rev 1002)
+++ trunk/tkabber-plugins/ChangeLog	2007-03-04 11:08:04 UTC (rev 1003)
@@ -3,6 +3,9 @@
 	* aniemoticons/aniemoticons.tcl, aniemoticons/anigif.tcl: Bugfix.
 	  Fixed creating and destroying images.
 
+	* debug/debug.tcl, spy/spy.tcl: Use new unified search panel
+	  interface.
+
 2006-03-03  Sergei Golovan <sgolovan at nes.ru>
 
 	* aniemoticons/*: Added new external plugin (moved from the main

Modified: trunk/tkabber-plugins/debug/debug.tcl
===================================================================
--- trunk/tkabber-plugins/debug/debug.tcl	2007-03-04 11:07:50 UTC (rev 1002)
+++ trunk/tkabber-plugins/debug/debug.tcl	2007-03-04 11:08:04 UTC (rev 1003)
@@ -195,17 +195,13 @@
 
 namespace eval debug::search {}
 
-proc debug::search::open_panel {sf w} {
-    set sentry $sf.search
-
+proc debug::search::open_panel {w sf} {
     pack $sf -side bottom -anchor w -fill x -before $w.sw
-    focus $sentry
-
     update idletasks
     $w.body see end
 }
 
-proc debug::search::close_panel {sf w} {
+proc debug::search::close_panel {w sf} {
     $w.body tag remove search_highlight 0.0 end
     pack forget $sf
     focus $w.body
@@ -217,33 +213,12 @@
     $body mark set sel_start end
     $body mark set sel_end 0.0
 
-    set sf [frame [winfo parent $body].search]
+    set sf [plugins::search::spanel [winfo parent $body].search \
+		-searchcommand [list ::plugins::search::do_text_search $body] \
+		-closecommand [list [namespace current]::close_panel $w]]
 
-    set sentry \
-	[entry $sf.search \
-	       -validate all \
-	       -validatecommand [list plugins::search::validate_entry %W %P]]
-    pack $sentry -padx 1m -side left
-
-    set sbox [ButtonBox $sf.sbox -spacing 0]
-    $sbox add -text [::msgcat::mc "Search up"] \
-         -command [list plugins::search::do_text_search $body $sentry 1]
-    $sbox add -text [::msgcat::mc "Search down"] \
-         -command [list plugins::search::do_text_search $body $sentry 0]
-    pack $sbox -side left -padx 1m
-    
-    set cbox [ButtonBox $sf.cbox -spacing 0]
-    $cbox add -text [::msgcat::mc "Close"] \
-         -command [list [namespace current]::close_panel $sf $w]
-    pack $cbox -side right -padx 1m
-
-    bind $sentry <Key-Return> [double% [list $sbox invoke 0]]
-    bind $sentry <Shift-Key-Return> [double% [list $sbox invoke 1]]
-    bind $sentry <Escape> \
-	[double% [list [namespace current]::close_panel $sf $w]]
-
     bind $w.body <<OpenSearchPanel>> \
-	[double% [list [namespace current]::open_panel $sf $w]]
+	[double% [list [namespace current]::open_panel $w $sf]]
 }
 
 # vim:ts=8:sw=4:sts=4:noet

Modified: trunk/tkabber-plugins/spy/spy.tcl
===================================================================
--- trunk/tkabber-plugins/spy/spy.tcl	2007-03-04 11:07:50 UTC (rev 1002)
+++ trunk/tkabber-plugins/spy/spy.tcl	2007-03-04 11:08:04 UTC (rev 1003)
@@ -354,17 +354,13 @@
 
 namespace eval spy::search {}
 
-proc spy::search::open_panel {sf w} {
-    set sentry $sf.search
-
+proc spy::search::open_panel {w sf} {
     pack $sf -side bottom -anchor w -fill x -before $w.isw
-    focus $sentry
-
     update idletasks
     $w.log see end
 }
 
-proc spy::search::close_panel {sf w} {
+proc spy::search::close_panel {w sf} {
     $w.log tag remove search_highlight 0.0 end
     pack forget $sf
     focus $w.log
@@ -376,33 +372,12 @@
     $log mark set sel_start end
     $log mark set sel_end 0.0
 
-    set sf [frame [winfo parent $log].search]
+    set sf [plugins::search::spanel [winfo parent $log].search \
+		-searchcommand [list ::plugins::search::do_text_search $log] \
+		-closecommand [list [namespace current]::close_panel $w]]
 
-    set sentry \
-	[entry $sf.search \
-	       -validate all \
-	       -validatecommand [list plugins::search::validate_entry %W %P]]
-    pack $sentry -padx 1m -side left
-
-    set sbox [ButtonBox $sf.sbox -spacing 0]
-    $sbox add -text [::msgcat::mc "Search up"] \
-         -command [list plugins::search::do_text_search $log $sentry 1]
-    $sbox add -text [::msgcat::mc "Search down"] \
-         -command [list plugins::search::do_text_search $log $sentry 0]
-    pack $sbox -side left -padx 1m
-    
-    set cbox [ButtonBox $sf.cbox -spacing 0]
-    $cbox add -text [::msgcat::mc "Close"] \
-         -command [list [namespace current]::close_panel $sf $w]
-    pack $cbox -side right -padx 1m
-
-    bind $sentry <Key-Return> [double% [list $sbox invoke 0]]
-    bind $sentry <Shift-Key-Return> [double% [list $sbox invoke 1]]
-    bind $sentry <Escape> \
-	[double% [list [namespace current]::close_panel $sf $w]]
-
     bind $w.log <<OpenSearchPanel>> \
-	[double% [list [namespace current]::open_panel $sf $w]]
+	[double% [list [namespace current]::open_panel $w $sf]]
 }
 
 ##############################################################################



More information about the Tkabber-dev mailing list