[Tkabber-dev] r2038 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Dec 30 23:22:45 MSK 2013


Author: sergei
Date: 2013-12-30 23:22:45 +0400 (Mon, 30 Dec 2013)
New Revision: 2038

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/proxy.tcl
Log:
	* proxy.tcl: Added mosewheel scroll for proxy list in the manage proxy
	  servers dialog window.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2013-12-30 14:47:59 UTC (rev 2037)
+++ trunk/tkabber/ChangeLog	2013-12-30 19:22:45 UTC (rev 2038)
@@ -9,6 +9,9 @@
 	  that tkabber-remote.tcl cant find comm.PID files on non-unix
 	  platforms.
 
+	* proxy.tcl: Added mosewheel scroll for proxy list in the manage proxy
+	  servers dialog window.
+
 2013-12-29  Sergei Golovan  <sgolovan at nes.ru>
 
 	* login.tcl: Added missing global definition.

Modified: trunk/tkabber/proxy.tcl
===================================================================
--- trunk/tkabber/proxy.tcl	2013-12-30 14:47:59 UTC (rev 2037)
+++ trunk/tkabber/proxy.tcl	2013-12-30 19:22:45 UTC (rev 2038)
@@ -324,20 +324,21 @@
     pack $sw -side bottom -expand yes -fill both
     $sw setwidget $sf
     set f [$sf getframe]
+    bindscroll $f $sf
 
     bind $f <Destroy> [namespace code [list cleanup $f $type]]
 
     set add [button $tools.add \
 		    -text [::msgcat::mc "Add proxy"] \
 		    -command [namespace code \
-			[list add_proxy $f $type $add_type "" "" "" "" * \
+			[list add_proxy $sf $f $type $add_type "" "" "" "" * \
 			      "localhost* 127.0.0.* 172.* 192.168.* 10.*"]]]
     pack $add -side right -pady 2m
 
     set data($type,counter) 0
 
     if {!$q} {
-	add_proxy $f $type remove "" "" "" "" "" ""
+	add_proxy $sf $f $type remove "" "" "" "" "" ""
     }
 
     if {[info exists Proxy($type)]} {
@@ -354,7 +355,7 @@
 		}
 	    }
 
-	    eval [list add_proxy $f $type] $add_args
+	    eval [list add_proxy $sf $f $type] $add_args
 	}
     }
 
@@ -404,7 +405,7 @@
     set proxylist [list tunnels $proxies(tunnels) http $proxies(http)]
 }
 
-proc proxy::add_proxy {f type ptype host port username password match exclude} {
+proc proxy::add_proxy {sf f type ptype host port username password match exclude} {
     variable data
 
     switch -- $type {
@@ -433,11 +434,13 @@
 
     set ff [frame $f.p$i -borderwidth 2 -relief groove -padx 2m -pady 2m]
     grid $ff -row $erow -column 0 -rowspan 3 -sticky nwes -padx 1m -pady 1m
+    bindscroll $ff $sf
 
     set row 0
 
     label $ff.lproxy$i -text [::msgcat::mc "Proxy type:"]
     grid $ff.lproxy$i -row $row -column 0 -sticky e
+    bindscroll $ff.lproxy$i $sf
     frame $ff.proxy$i
     grid $ff.proxy$i -row $row -column 1 -columnspan 3 -sticky w
 
@@ -447,17 +450,21 @@
 	radiobutton $ff.proxy$i.https -text [::msgcat::mc "HTTPS"] \
 		    -variable [namespace current]::data($type,type,$i) -value https
 	grid $ff.proxy$i.https -row 0 -column [incr col] -sticky w
+	bindscroll $ff.proxy$i.https $sf
 
 	radiobutton $ff.proxy$i.socks4 -text [::msgcat::mc "SOCKS4a"] \
 		    -variable [namespace current]::data($type,type,$i) -value socks4
 	grid $ff.proxy$i.socks4 -row 0 -column [incr col] -sticky w
+	bindscroll $ff.proxy$i.socks4 $sf
 
 	radiobutton $ff.proxy$i.socks5 -text [::msgcat::mc "SOCKS5"] \
 		    -variable [namespace current]::data($type,type,$i) -value socks5
 	grid $ff.proxy$i.socks5 -row 0 -column [incr col] -sticky w
+	bindscroll $ff.proxy$i.socks5 $sf
     } else {
 	label $ff.proxy$i.https -text [::msgcat::mc "HTTP"]
 	grid $ff.proxy$i.https -row 0 -column [incr col] -sticky w
+	bindscroll $ff.proxy$i.https $sf
     }
 
     incr row
@@ -510,16 +517,23 @@
 	   -command [namespace code [list move_proxy_up $f $type $i]]
     button $f.movedown$i -text [::msgcat::mc "Move down"] \
 	   -command [namespace code [list move_proxy_down $f $type $i]]
-    button $f.remov$i -text [::msgcat::mc "Remove"] \
+    button $f.remove$i -text [::msgcat::mc "Remove"] \
 	   -command [namespace code [list remove_proxy $f $type $i]]
 
     grid $f.moveup$i -row $erow -column 1 -sticky ews -padx 1m
     grid $f.movedown$i -row [expr {$erow+1}] -column 1 -sticky ewns -padx 1m
-    grid $f.remov$i -row [expr {$erow+2}] -column 1 -sticky ewn -padx 1m
+    grid $f.remove$i -row [expr {$erow+2}] -column 1 -sticky ewn -padx 1m
+    bindscroll $f.moveup$i $sf
+    bindscroll $f.movedown$i $sf
+    bindscroll $f.remove$i $sf
 
     grid rowconfigure $f $erow -weight 1
     grid rowconfigure $f [expr {$erow+2}] -weight 1
     grid columnconfigure $f 0 -weight 1
+
+    foreach path [winfo children $ff] {
+	bindscroll $path $sf
+    }
 }
 
 proc proxy::remove_proxy {f type i} {
@@ -528,7 +542,7 @@
     destroy $f.p$i
     destroy $f.moveup$i
     destroy $f.movedown$i
-    destroy $f.remov$i
+    destroy $f.remove$i
 
     set data($type,type,$i) remove
 }



More information about the Tkabber-dev mailing list