diff options
author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-08-23 10:50:31 (GMT) |
---|---|---|
committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-08-23 10:50:31 (GMT) |
commit | 54ef52d3c9387a0271e2df283dcc7b7a2e03df80 (patch) | |
tree | 21184821e6ee24c7c736d12c8865c1de7841117d | |
parent | 03192a514be2dac569d52dee013dfab226d64b08 (diff) | |
parent | acd75fc383a8865efc7d0aeb9cb620610d8267dc (diff) | |
download | tk-54ef52d3c9387a0271e2df283dcc7b7a2e03df80.zip tk-54ef52d3c9387a0271e2df283dcc7b7a2e03df80.tar.gz tk-54ef52d3c9387a0271e2df283dcc7b7a2e03df80.tar.bz2 |
[Bug 3555644]: Better use of virtual events, Add <<ToggleSelection>> virtual event.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | doc/event.n | 5 | ||||
-rw-r--r-- | library/tk.tcl | 3 | ||||
-rw-r--r-- | library/ttk/entry.tcl | 2 | ||||
-rw-r--r-- | library/ttk/treeview.tcl | 2 |
5 files changed, 16 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2012-08-23 Jan Nijtmans <nijtmans@users.sf.net> + + * library/tk.tcl: [Bug 3555644]: Better use of virtual events, + * library/ttk/entry.tcl Add <<ToggleSelection>> virtual event. + * library/ttk/treeview.tcl + 2012-08-22 Jan Nijtmans <nijtmans@users.sf.net> TIP #403 IMPLEMENTATION diff --git a/doc/event.n b/doc/event.n index f45a13f..52cb992 100644 --- a/doc/event.n +++ b/doc/event.n @@ -480,7 +480,12 @@ range of selected contents. Move to the previous group of items (i.e., visible word) in the current widget while extending the range of selected contents. .TP +\fB<<ToggleSelection>>\fR +. +Toggle the selection. +.TP \fB<<Undo>>\fR +. Undo the last action. .SH EXAMPLES .SS "MAPPING KEYS TO VIRTUAL EVENTS" diff --git a/library/tk.tcl b/library/tk.tcl index 0d8853f..cac9075 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -391,6 +391,7 @@ switch -exact -- [tk windowingsystem] { event add <<NextPara>> <Control-Down> event add <<SelectPrevPara>> <Control-Shift-Up> event add <<SelectPrevPara>> <Control-Shift-Down> + event add <<ToggleSelection>> <Control-ButtonPress-1> # Some OS's define a goofy (as in, not <Shift-Tab>) keysym that is # returned when the user presses <Shift-Tab>. In order for tab @@ -439,6 +440,7 @@ switch -exact -- [tk windowingsystem] { event add <<NextPara>> <Control-Down> event add <<SelectPrevPara>> <Control-Shift-Up> event add <<SelectPrevPara>> <Control-Shift-Down> + event add <<ToggleSelection>> <Control-ButtonPress-1> } "aqua" { event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X> @@ -476,6 +478,7 @@ switch -exact -- [tk windowingsystem] { event add <<NextPara>> <Option-Down> event add <<SelectPrevPara>> <Shift-Option-Up> event add <<SelectPrevPara>> <Shift-Option-Down> + event add <<ToggleSelection>> <Command-ButtonPress-1> } } diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index 22c4115..f5ba19e 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -78,7 +78,7 @@ bind TEntry <B1-Leave> { ttk::Repeatedly ttk::entry::AutoScroll %W } bind TEntry <B1-Enter> { ttk::CancelRepeat } bind TEntry <ButtonRelease-1> { ttk::CancelRepeat } -bind TEntry <Control-ButtonPress-1> { +bind TEntry <<ToggleSelection>> { %W instate {!readonly !disabled} { %W icursor @%x ; focus %W } } diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 1160e9b..8772587 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -43,7 +43,7 @@ bind Treeview <KeyPress-space> { ttk::treeview::ToggleFocus %W } bind Treeview <Shift-ButtonPress-1> \ { ttk::treeview::Select %W %x %y extend } -bind Treeview <Control-ButtonPress-1> \ +bind Treeview <<ToggleSelection>> \ { ttk::treeview::Select %W %x %y toggle } ttk::copyBindings TtkScrollable Treeview |