From 4c85d14a216327baa1f5a4d7b74995e0bfd0fde7 Mon Sep 17 00:00:00 2001 From: ericm Date: Wed, 19 Jul 2000 23:22:20 +0000 Subject: * library/text.tcl: Enhanced binding to behave like normal bindings when the text widget is disabled (ie, it advances focus to the next widget). --- ChangeLog | 4 ++++ library/text.tcl | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d95bce..42d1917 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2000-07-19 Eric Melski + * library/text.tcl: Enhanced binding to behave like normal + bindings when the text widget is disabled (ie, it advances + focus to the next widget). + * generic/tkText.c (TextSearchCmd): Added a test for a NULL segment pointer when doing backwards searches for "" on an empty text widget. [Bug: 6007]. diff --git a/library/text.tcl b/library/text.tcl index 9eb2cd0..742f82f 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk text widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: text.tcl,v 1.12 2000/04/17 23:24:29 ericm Exp $ +# RCS: @(#) $Id: text.tcl,v 1.13 2000/07/19 23:22:20 ericm Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -36,7 +36,7 @@ #------------------------------------------------------------------------- #------------------------------------------------------------------------- -# The code below creates the default class bindings for entries. +# The code below creates the default class bindings for text widgets. #------------------------------------------------------------------------- # Standard Motif bindings: @@ -182,9 +182,11 @@ bind Text { } bind Text { - tkTextInsert %W \t - focus %W - break + if { [string equal [%W cget -state] "normal"] } { + tkTextInsert %W \t + focus %W + break + } } bind Text { # Needed only to keep binding from triggering; doesn't @@ -740,7 +742,10 @@ proc tkTextResetAnchor {w index} { global tkPriv if {[string equal [$w tag ranges sel] ""]} { - $w mark set anchor $index + # Don't move the anchor if there is no selection now; this makes + # the widget behave "correctly" when the user clicks once, then + # shift-clicks somewhere -- ie, the area between the two clicks will be + # selected. [Bug: 5929]. return } set a [$w index $index] -- cgit v0.12