[Tkabber-dev] r2099 - in trunk/tkabber: . ifacetk plugins/chat plugins/general plugins/roster plugins/unix

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Jan 26 13:48:25 MSK 2014


Author: sergei
Date: 2014-01-26 13:48:25 +0400 (Sun, 26 Jan 2014)
New Revision: 2099

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/disco.tcl
   trunk/tkabber/gpgme.tcl
   trunk/tkabber/ifacetk/idefault.tcl
   trunk/tkabber/ifacetk/iface.tcl
   trunk/tkabber/ifacetk/roster.tcl
   trunk/tkabber/plugins/chat/popupmenu.tcl
   trunk/tkabber/plugins/general/headlines.tcl
   trunk/tkabber/plugins/general/message_archive.tcl
   trunk/tkabber/plugins/general/offline.tcl
   trunk/tkabber/plugins/roster/metacontacts.tcl
   trunk/tkabber/plugins/unix/dockingtray.tcl
   trunk/tkabber/plugins/unix/systray.tcl
   trunk/tkabber/plugins/unix/tktray.tcl
   trunk/tkabber/plugins/unix/wmdock.tcl
   trunk/tkabber/privacy.tcl
   trunk/tkabber/search.tcl
   trunk/tkabber/utils.tcl
Log:
	* gpgme.tcl, utils.tcl, disco.tcl, search.tcl, privacy.tcl,
	  ifacetk/iface.tcl, ifacetk/roster.tcl, ifacetk/idefault.tcl,
	  plugins/chat/popupmenu.tcl, plugins/unix/tktray.tcl,
	  plugins/unix/systray.tcl, plugins/unix/dockingtray.tcl,
	  plugins/unix/wmdock.tcl, plugins/general/headlines.tcl,
	  plugins/general/offline.tcl, plugins/general/message_archive.tcl,
	  plugins/roster/metacontacts.tcl:
	  Replaced direct bindings to mouse buttons 2 and 3 by virtual
	  events <<PasteSelection>> and <<ContextMenu>>, because in MacOSX
	  and in Unix buttons 2 and 3 correspond to different mous buttons
	  (thanks to Vitaly Takmazov).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/ChangeLog	2014-01-26 09:48:25 UTC (rev 2099)
@@ -13,6 +13,18 @@
 
 	* hooks.tcl: Initialize flags variable when hook is created.
 
+	* gpgme.tcl, utils.tcl, disco.tcl, search.tcl, privacy.tcl,
+	  ifacetk/iface.tcl, ifacetk/roster.tcl, ifacetk/idefault.tcl,
+	  plugins/chat/popupmenu.tcl, plugins/unix/tktray.tcl,
+	  plugins/unix/systray.tcl, plugins/unix/dockingtray.tcl,
+	  plugins/unix/wmdock.tcl, plugins/general/headlines.tcl,
+	  plugins/general/offline.tcl, plugins/general/message_archive.tcl,
+	  plugins/roster/metacontacts.tcl:
+	  Replaced direct bindings to mouse buttons 2 and 3 by virtual
+	  events <<PasteSelection>> and <<ContextMenu>>, because in MacOSX
+	  and in Unix buttons 2 and 3 correspond to different mous buttons
+	  (thanks to Vitaly Takmazov).
+
 2014-01-22  Sergei Golovan  <sgolovan at nes.ru>
 
 	* gpgme.tcl, chats.tcl: Adjusted priority of rewrite_message_hook

Modified: trunk/tkabber/disco.tcl
===================================================================
--- trunk/tkabber/disco.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/disco.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -367,7 +367,7 @@
     pack $sw -side top -expand yes -fill both
     $tw bindText <Double-ButtonPress-1> \
 	[list [namespace current]::textaction $w]
-    $tw bindText <ButtonPress-3> \
+    $tw bindText <<ContextMenu>> \
 	[list [namespace current]::textpopup $w]
     balloon::setup $tw -command [list [namespace current]::textballoon $w]
     bindscroll $tw.c

Modified: trunk/tkabber/gpgme.tcl
===================================================================
--- trunk/tkabber/gpgme.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/gpgme.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -641,7 +641,7 @@
 	 -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0
 
     if {[info exists params(reason)] && [string equal $params(reason) nokey]} {
-	bind $lb <3> [list ::ssj::signed:popup [double% $pinfo]]
+	bind $lb <<ContextMenu>> [list ::ssj::signed:popup [double% $pinfo]]
     }
     return $lb
 }

Modified: trunk/tkabber/ifacetk/idefault.tcl
===================================================================
--- trunk/tkabber/ifacetk/idefault.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/ifacetk/idefault.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -109,3 +109,21 @@
     event add <<OpenSearchPanel>> <Control-ucircumflex>
 }
 
+if {[event info <<ContextMenu>>] == ""} {
+    # tk < 8.6
+    if {$::aquaP} {
+	# workaround for tk < 8.6.1
+	set context 2
+    } else {
+	set context 3
+    }
+    event add <<ContextMenu>> <$context>
+}
+if {[event info <<PasteSelection>>] == ""} {
+    if {$::aquaP} {
+	set middle 2
+    } else {
+	set middle 3
+    }
+    event add <<PasteSelection>> <$middle>
+}

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/ifacetk/iface.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -269,12 +269,12 @@
     bind Entry <Map> { selection handle %W "EncodeEntrySelection %W" }
 
     if {[info tclversion] < 8.4} {
-	bind Text <ButtonRelease-2> {
+	bind Text <<PasteSelection>> {
 	    if {![catch {::tk::GetSelection %W} sel]} {
 		%W insert current $sel
 	    }
 	}
-	bind Entry <ButtonRelease-2> {
+	bind Entry <<PasteSelection>> {
 	    if {![catch {::tk::GetSelection %W} sel]} {
 		%W insert insert $sel
 	    }
@@ -824,7 +824,7 @@
     $w bind <Return> [double% {set userstatus $userstatus}]
     trace variable ::userstatus w \
 	[list [namespace current]::save_availability_status $w]
-    $w bind <Button-3> [list [namespace current]::show_status_context_menu [double% $w]]
+    $w bind <<ContextMenu>> [list [namespace current]::show_status_context_menu [double% $w]]
     if {$usetabbar} {
 	pack .presence.button -side left
 	pack .presence.status -side left -fill x -expand yes
@@ -950,8 +950,8 @@
 		}
 	    }
 
-	.nb bindtabs <3> [list [namespace current]::tab_menu %X %Y]
-	.nb bindtabs <2> [list [namespace current]::destroy_tab]
+	.nb bindtabs <<ContextMenu>> [list [namespace current]::tab_menu %X %Y]
+	.nb bindtabs <<PasteSelection>> [list [namespace current]::destroy_tab]
 	.nb bindtabs <<ScrollUp>> [list [namespace current]::tab_move .nb -1]
 	.nb bindtabs <<ScrollDown>> [list [namespace current]::tab_move .nb 1]
 

Modified: trunk/tkabber/ifacetk/roster.tcl
===================================================================
--- trunk/tkabber/ifacetk/roster.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/ifacetk/roster.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -1320,7 +1320,7 @@
 	    $c bind jid$tag&&$type <Any-Leave> {+ balloon::destroy}
 
 	    if {![string equal $iroster($w,popup) ""]} {
-		$c bind jid$tag&&$type <3> [list [double% $iroster($w,popup)] \
+		$c bind jid$tag&&$type <<ContextMenu>> [list [double% $iroster($w,popup)] \
 						 $doubledjid $doubledjids]
 	    }
 	}
@@ -1331,7 +1331,7 @@
 	    }
 
 	    if {![string equal $iroster($w,grouppopup) {}]} {
-		$c bind jid$tag&&group <3> \
+		$c bind jid$tag&&group <<ContextMenu>> \
 		        [list [double% $iroster($w,grouppopup)] $doubledjid]
 	    }
 	}

Modified: trunk/tkabber/plugins/chat/popupmenu.tcl
===================================================================
--- trunk/tkabber/plugins/chat/popupmenu.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/chat/popupmenu.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -24,7 +24,7 @@
     global usetabbar
 
     set cw [chat::chat_win $chatid]
-    bind $cw <Button-3> [list [namespace current]::popup_menu %W %X %Y %x %y]
+    bind $cw <<ContextMenu>> [list [namespace current]::popup_menu %W %X %Y %x %y]
 
     if {!$usetabbar} {
 	set top [winfo toplevel $cw]

Modified: trunk/tkabber/plugins/general/headlines.tcl
===================================================================
--- trunk/tkabber/plugins/general/headlines.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/general/headlines.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -193,7 +193,7 @@
     $sw setwidget $tw
     pack $sw -side top -expand yes -fill both
 
-    $tw bindText <ButtonPress-3> [list [namespace current]::select_popup $hw]
+    $tw bindText <<ContextMenu>> [list [namespace current]::select_popup $hw]
     $tw bindText <Double-ButtonPress-1> \
 		 [list [namespace current]::action browse $hw]
     balloon::setup $tw -command [list [namespace current]::balloon $hw]

Modified: trunk/tkabber/plugins/general/message_archive.tcl
===================================================================
--- trunk/tkabber/plugins/general/message_archive.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/general/message_archive.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -107,7 +107,7 @@
 	    "[namespace current]::select_and_print_body \
 	     [double% $dw] [double% $l] \[[double% $l] nearest \[::mclistbox::convert %W -y %y\]\]"
 
-#    bind $l <3> \
+#    bind $l <<ContextMenu>> \
 #	    "[namespace current]::select_and_popup_menu \
 #	     [double% $l] \[[double% $l] nearest \[::mclistbox::convert %W -y %y\]\]"
 

Modified: trunk/tkabber/plugins/general/offline.tcl
===================================================================
--- trunk/tkabber/plugins/general/offline.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/general/offline.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -63,7 +63,7 @@
 
     pack $sw -side top -expand yes -fill both
 
-    $tw bindText <ButtonPress-3> \
+    $tw bindText <<ContextMenu>> \
 	    [list [namespace current]::message_popup $tw]
     $tw bindText <Double-ButtonPress-1> \
 	    [list [namespace current]::message_action fetch $tw]

Modified: trunk/tkabber/plugins/roster/metacontacts.tcl
===================================================================
--- trunk/tkabber/plugins/roster/metacontacts.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/roster/metacontacts.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -213,7 +213,7 @@
     pack $sw -side top -expand yes -fill both -in $f -pady 1m -padx 1m
     $sw setwidget $lf
 
-    bind $lf <3> [namespace code [list select_and_popup_menu %W [double% $xlib] %x %y]]
+    bind $lf <<ContextMenu>> [namespace code [list select_and_popup_menu %W [double% $xlib] %x %y]]
 
     bind $lf <Control-Key-Up> [namespace code [list move_selected %W [double% $xlib] -1]]
     bind $lf <Control-Key-Down> [namespace code [list move_selected %W [double% $xlib] 1]]

Modified: trunk/tkabber/plugins/unix/dockingtray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/dockingtray.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/unix/dockingtray.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -71,8 +71,8 @@
     set m [ifacetk::systray::popupmenu $icon.menu]
 
     bind $mb <ButtonRelease-1> ifacetk::systray::restore
-    bind $mb <ButtonRelease-2> ifacetk::systray::withdraw
-    bind $mb <ButtonRelease-3> [list tk_popup [double% $m] %X %Y]
+    bind $mb <<PasteSelection>> ifacetk::systray::withdraw
+    bind $mb <<ContextMenu>> [list tk_popup [double% $m] %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }
 

Modified: trunk/tkabber/plugins/unix/systray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/systray.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/unix/systray.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -71,8 +71,8 @@
     set m [ifacetk::systray::popupmenu $icon.menu]
 
     bind $icon <ButtonRelease-1> ifacetk::systray::restore
-    bind $icon <ButtonRelease-2> ifacetk::systray::withdraw
-    bind $icon <ButtonRelease-3> [list tk_popup [double% $m] %X %Y]
+    bind $icon <<PasteSelection>> ifacetk::systray::withdraw
+    bind $icon <<ContextMenu>> [list tk_popup [double% $m] %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }
 

Modified: trunk/tkabber/plugins/unix/tktray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/tktray.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/unix/tktray.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -65,8 +65,8 @@
     set m [ifacetk::systray::popupmenu $icon.menu]
 
     bind $icon <ButtonRelease-1> ifacetk::systray::restore
-    bind $icon <ButtonRelease-2> ifacetk::systray::withdraw
-    bind $icon <ButtonRelease-3> [list tk_popup [double% $m] %X %Y]
+    bind $icon <<PasteSelection>> ifacetk::systray::withdraw
+    bind $icon <<ContextMenu>> [list tk_popup [double% $m] %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }
 

Modified: trunk/tkabber/plugins/unix/wmdock.tcl
===================================================================
--- trunk/tkabber/plugins/unix/wmdock.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/plugins/unix/wmdock.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -141,7 +141,7 @@
     .icon.c create text 26 52 -anchor s -text "no" -fill white -tag text
     pack .icon.c
     
-    bind .icon <3> ::wmdock::showhide
+    bind .icon <<ContextMenu>> ::wmdock::showhide
     balloon::setup .icon -command [list ::wmdock::balloon]
 }
 

Modified: trunk/tkabber/privacy.tcl
===================================================================
--- trunk/tkabber/privacy.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/privacy.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -699,7 +699,7 @@
     pack $sw -side top -expand yes -fill both -in $f -pady 1m -padx 1m
     $sw setwidget $lf
 
-    bind $lf <3> [list [namespace current]::select_and_popup_menu %W %x %y]
+    bind $lf <<ContextMenu>> [list [namespace current]::select_and_popup_menu %W %x %y]
 
     set addentry [entry $tools.addentry]
     set additem [button $tools.additem \

Modified: trunk/tkabber/search.tcl
===================================================================
--- trunk/tkabber/search.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/search.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -171,7 +171,7 @@
     set lastsort($sww.listbox) ""
     bind $sww.listbox <Destroy> +[list [namespace current]::DeleteLastsort %W]
     
-    bind $sww.listbox <3> \
+    bind $sww.listbox <<ContextMenu>> \
 	"[namespace current]::SelectAndPopupMenu [list [double% $sww.listbox]] \
 	     \[[double% $sww.listbox] nearest \[::mclistbox::convert %W -y %y\]\] \
 	     [double% $xlib]"

Modified: trunk/tkabber/utils.tcl
===================================================================
--- trunk/tkabber/utils.tcl	2014-01-26 09:31:54 UTC (rev 2098)
+++ trunk/tkabber/utils.tcl	2014-01-26 09:48:25 UTC (rev 2099)
@@ -259,7 +259,7 @@
     proc textUndoable {path args} {
 	eval {text $path -undo 1} $args
 	bind $path <Key-space> +[list %W edit separator]
-	bind $path <3> [list text_context_menu %W %X %Y %x %y]
+	bind $path <<ContextMenu>> [list text_context_menu %W %X %Y %x %y]
 	hook::run text_on_create_hook $path
 	return $path
     }
@@ -288,7 +288,7 @@
 
     proc textUndoable {path args} {
 	eval {text $path} $args
-	bind $path <3> [list text_context_menu %W %X %Y %x %y]
+	bind $path <<ContextMenu>> [list text_context_menu %W %X %Y %x %y]
 	hook::run text_on_create_hook $path
 	return $path
     }



More information about the Tkabber-dev mailing list