summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2006-09-06 22:39:28 (GMT)
committerhobbs <hobbs@noemail.net>2006-09-06 22:39:28 (GMT)
commitcc68de7c1d6294f8cfd7695c71825ed9a76c11ba (patch)
tree2ba9cc0bf93a726ed5be5bd91f8d50a43b16fb71 /generic/tkEntry.c
parent614ca8f4ec9a9d12626edf738afe13cc254af7ac (diff)
downloadtk-cc68de7c1d6294f8cfd7695c71825ed9a76c11ba.zip
tk-cc68de7c1d6294f8cfd7695c71825ed9a76c11ba.tar.gz
tk-cc68de7c1d6294f8cfd7695c71825ed9a76c11ba.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: FossilOrigin-Name: 25cf9158b784bb5826fdd96a2adf07ad623480a2
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
}
/*