diff options
author | hobbs <hobbs> | 2006-09-06 22:01:24 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-09-06 22:01:24 (GMT) |
commit | cb44d676da5035f163cc11087f72fcd583dc157e (patch) | |
tree | 983074bdc91b005de21970a3ec98bae0c6d5af63 /generic/tkText.c | |
parent | 4912d9573af7ec34498035d73747de8a7f729510 (diff) | |
download | tk-cb44d676da5035f163cc11087f72fcd583dc157e.zip tk-cb44d676da5035f163cc11087f72fcd583dc157e.tar.gz tk-cb44d676da5035f163cc11087f72fcd583dc157e.tar.bz2 |
* generic/tkEntry.c: move hard-coded ALWAYS_SHOW_SELECTION
* generic/tkInt.h: control of entry/text selection display
* generic/tkText.c: based on focus to the Tcl level,
* generic/tkTextBTree.c: controlled by ::tk::AlwaysShowSelection
* generic/tkTextDisp.c: (boolean, private). [Bug 1553691]
* generic/tkWindow.c:
* library/tk.tcl
* unix/tkUnixPort.h:
Diffstat (limited to 'generic/tkText.c')
-rw-r--r-- | generic/tkText.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index a06b90f..33edca7 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.33.2.2 2006/09/06 19:53:22 hobbs Exp $ + * RCS: @(#) $Id: tkText.c,v 1.33.2.3 2006/09/06 22:01:25 hobbs Exp $ */ #include "default.h" @@ -1281,9 +1281,9 @@ TextEventProc(clientData, eventPtr) textPtr->flags &= ~(GOT_FOCUS | INSERT_ON); textPtr->insertBlinkHandler = (Tcl_TimerToken) NULL; } -#ifndef ALWAYS_SHOW_SELECTION - TkTextRedrawTag(textPtr, NULL, NULL, textPtr->selTagPtr, 1); -#endif + if (!TkpAlwaysShowSelection(textPtr->tkwin)) { + TkTextRedrawTag(textPtr, NULL, NULL, textPtr->selTagPtr, 1); + } TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index); TkTextIndexForwChars(&index, 1, &index2); TkTextChanged(textPtr, &index, &index2); @@ -1896,24 +1896,25 @@ TkTextLostSelection(clientData) { register TkText *textPtr = (TkText *) clientData; XEvent event; -#ifdef ALWAYS_SHOW_SELECTION - TkTextIndex start, end; - if (!textPtr->exportSelection) { - return; - } + if (TkpAlwaysShowSelection(textPtr->tkwin)) { + TkTextIndex start, end; - /* - * On Windows and Mac systems, we want to remember the selection - * for the next time the focus enters the window. On Unix, - * just remove the "sel" tag from everything in the widget. - */ + if (!textPtr->exportSelection) { + return; + } - TkTextMakeByteIndex(textPtr->tree, 0, 0, &start); - TkTextMakeByteIndex(textPtr->tree, TkBTreeNumLines(textPtr->tree), 0, &end); - TkTextRedrawTag(textPtr, &start, &end, textPtr->selTagPtr, 1); - TkBTreeTag(&start, &end, textPtr->selTagPtr, 0); -#endif + /* + * On Windows and Mac systems, we want to remember the selection + * for the next time the focus enters the window. On Unix, + * just remove the "sel" tag from everything in the widget. + */ + + TkTextMakeByteIndex(textPtr->tree, 0, 0, &start); + TkTextMakeByteIndex(textPtr->tree, TkBTreeNumLines(textPtr->tree), 0, &end); + TkTextRedrawTag(textPtr, &start, &end, textPtr->selTagPtr, 1); + TkBTreeTag(&start, &end, textPtr->selTagPtr, 0); + } /* * Send an event that the selection changed. This is equivalent to |