summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-09-06 22:39:28 (GMT)
committerhobbs <hobbs>2006-09-06 22:39:28 (GMT)
commit76db84f0e28288ac0e6da5dc33d1a97626efcf54 (patch)
tree2ba9cc0bf93a726ed5be5bd91f8d50a43b16fb71 /generic/tkEntry.c
parent94edca83e594d771323cb9f0b5a4e1e0d03d8dc5 (diff)
downloadtk-76db84f0e28288ac0e6da5dc33d1a97626efcf54.zip
tk-76db84f0e28288ac0e6da5dc33d1a97626efcf54.tar.gz
tk-76db84f0e28288ac0e6da5dc33d1a97626efcf54.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/tkWindow.c: controlled by ::tk::AlwaysShowSelection * library/tk.tcl: (boolean, private). [Bug 1553691] * macosx/tkMacOSXDefault.h: * unix/tkUnixDefault.h: * unix/tkUnixPort.h: * win/tkWinDefault.h:
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r--generic/tkEntry.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 6f97c0c..1d9d084 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.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: tkEntry.c,v 1.39 2005/11/17 10:57:35 dkf Exp $
+ * RCS: @(#) $Id: tkEntry.c,v 1.40 2006/09/06 22:39:28 hobbs Exp $
*/
#include "tkInt.h"
@@ -1602,15 +1602,14 @@ DisplayEntry(
baseY = (Tk_Height(tkwin) + fm.ascent - fm.descent) / 2;
/*
- * On Windows and Mac, we need to hide the selection whenever we don't
- * have the focus.
+ * Hide the selection whenever we don't have the focus, unless we
+ * always want to show selection.
*/
-
-#ifdef ALWAYS_SHOW_SELECTION
- showSelection = 1;
-#else
- showSelection = (entryPtr->flags & GOT_FOCUS);
-#endif
+ if (TkpAlwaysShowSelection(entryPtr->tkwin)) {
+ showSelection = 1;
+ } else {
+ showSelection = (entryPtr->flags & GOT_FOCUS);
+ }
/*
* Draw the background in three layers. From bottom to top the layers are:
@@ -2790,15 +2789,15 @@ EntryLostSelection(
* On Windows and Mac systems, we want to remember the selection for the
* next time the focus enters the window. On Unix, we need to clear the
* selection since it is always visible.
+ * This is controlled by ::tk::AlwaysShowSelection.
*/
-#ifdef ALWAYS_SHOW_SELECTION
- if ((entryPtr->selectFirst >= 0) && entryPtr->exportSelection) {
+ if (TkpAlwaysShowSelection(entryPtr->tkwin)
+ && (entryPtr->selectFirst >= 0) && entryPtr->exportSelection) {
entryPtr->selectFirst = -1;
entryPtr->selectLast = -1;
EventuallyRedraw(entryPtr);
}
-#endif
}
/*