summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/menu.n15
-rw-r--r--doc/messageBox.n39
-rw-r--r--generic/tkInt.decls2
-rw-r--r--generic/tkIntPlatDecls.h7
-rw-r--r--generic/tkStubInit.c2
-rw-r--r--generic/tkText.c12
-rw-r--r--library/menu.tcl2
-rw-r--r--tests/menu.test9
-rw-r--r--tests/text.test5
-rw-r--r--tests/textDisp.test12
-rwxr-xr-xwin/configure20
-rw-r--r--win/makefile.vc13
-rw-r--r--win/tcl.m420
13 files changed, 112 insertions, 46 deletions
diff --git a/doc/menu.n b/doc/menu.n
index 6d0dc8a..1c943f9 100644
--- a/doc/menu.n
+++ b/doc/menu.n
@@ -285,15 +285,10 @@ operations on the widget. It has the following general form:
determine the exact behavior of the command.
.PP
Many of the widget commands for a menu take as one argument an
-indicator of which entry of the menu to operate on. These
+indicator of which entry of the menu to operate on. These
indicators are called \fIindex\fRes and may be specified in
any of the following forms:
.TP 12
-\fInumber\fR
-Specifies the entry numerically, where 0 corresponds
-to the top-most entry of the menu, 1 to the entry below it, and
-so on.
-.TP 12
\fBactive\fR
Indicates the entry that is currently active. If no entry is
active then this form is equivalent to \fBnone\fR. This form may
@@ -323,6 +318,11 @@ For example,
.QW \fB@0\fR
indicates the top-most entry in the window.
.TP 12
+\fInumber\fR
+Specifies the entry numerically, where 0 corresponds
+to the top-most entry of the menu, 1 to the entry below it, and
+so on.
+.TP 12
\fIpattern\fR
If the index does not satisfy one of the above forms then this
form is used. \fIPattern\fR is pattern-matched against the label of
@@ -330,6 +330,9 @@ each entry in the menu, in order from the top down, until a
matching entry is found. The rules of \fBTcl_StringMatch\fR
are used.
.PP
+If the index could match more than one of the above forms, then
+the form earlier in the above list takes precedence.
+.PP
The following widget commands are possible for menu widgets:
.TP
\fIpathName \fBactivate \fIindex\fR
diff --git a/doc/messageBox.n b/doc/messageBox.n
index bbeffee..5ce1745 100644
--- a/doc/messageBox.n
+++ b/doc/messageBox.n
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
+'\"
.TH tk_messageBox n 4.2 Tk "Tk Built-In Commands"
.so man.macros
.BS
@@ -13,7 +13,6 @@ tk_messageBox \- pops up a message window and waits for user response.
.SH SYNOPSIS
\fBtk_messageBox \fR?\fIoption value ...\fR?
.BE
-
.SH DESCRIPTION
.PP
This procedure creates and displays a message window with an
@@ -22,70 +21,84 @@ the buttons in the message window is identified by a unique symbolic
name (see the \fB\-type\fR options). After the message window is
popped up, \fBtk_messageBox\fR waits for the user to select one of the
buttons. Then it returns the symbolic name of the selected button.
-
+.PP
The following option-value pairs are supported:
.TP
\fB\-default\fR \fIname\fR
+.
\fIName\fR gives the symbolic name of the default button for
this message window (
.QW ok ,
.QW cancel ,
-and so on). See \fB\-type\fR
+and so on). See \fB\-type\fR
for a list of the symbolic names. If this option is not specified,
the first button in the dialog will be made the default.
.TP
\fB\-detail\fR \fIstring\fR
-.VS 8.5
+.
Specifies an auxiliary message to the main message given by the
-\fB\-message\fR option. Where supported by the underlying OS, the
-message detail will be presented in a less emphasized font than the
+\fB\-message\fR option. The message detail will be presented beneath the main
+message and, where supported by the OS, in a less emphasized font than the
main message.
-.VE 8.5
.TP
\fB\-icon\fR \fIiconImage\fR
+.
Specifies an icon to display. \fIIconImage\fR must be one of the
following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or
\fBwarning\fR. If this option is not specified, then the info icon will be
displayed.
.TP
\fB\-message\fR \fIstring\fR
-Specifies the message to display in this message box.
+.
+Specifies the message to display in this message box. The
+default value is an empty string.
.TP
\fB\-parent\fR \fIwindow\fR
+.
Makes \fIwindow\fR the logical parent of the message box. The message
box is displayed on top of its parent window.
.TP
\fB\-title\fR \fItitleString\fR
-Specifies a string to display as the title of the message box. The
-default value is an empty string.
+.
+Specifies a string to display as the title of the message box. This option
+is ignored on Mac OS X, where platform guidelines forbid the use of a title
+on this kind of dialog.
.TP
\fB\-type\fR \fIpredefinedType\fR
+.
Arranges for a predefined set of buttons to be displayed. The
following values are possible for \fIpredefinedType\fR:
.RS
.TP 18
\fBabortretryignore\fR
+.
Displays three buttons whose symbolic names are \fBabort\fR,
\fBretry\fR and \fBignore\fR.
.TP 18
\fBok\fR
+.
Displays one button whose symbolic name is \fBok\fR.
.TP 18
\fBokcancel\fR
+.
Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR.
.TP 18
\fBretrycancel\fR
+.
Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR.
.TP 18
\fByesno\fR
+.
Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR.
.TP 18
\fByesnocancel\fR
+.
Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR
and \fBcancel\fR.
.RE
.PP
.SH EXAMPLE
+.PP
.CS
set answer [\fBtk_messageBox\fR \-message "Really quit?" \e
\-icon question \-type yesno \e
@@ -96,6 +109,8 @@ switch \-\- $answer {
\-type ok}
}
.CE
-
.SH KEYWORDS
message box
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 7921852..f24d48c 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -957,7 +957,7 @@ declare 51 aqua {
void TkGenWMDestroyEvent(Tk_Window tkwin)
}
declare 52 aqua {
- TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag);
+ void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag)
}
# removed duplicate from tkPlat table (tk.decls)
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index 7654b5d..86127fe 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -723,7 +723,7 @@ typedef struct TkIntPlatStubs {
Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */
int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */
void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */
- VOID *reserved52;
+ void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */
unsigned long (*tkpGetMS) (void); /* 53 */
VOID * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */
int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 55 */
@@ -1129,7 +1129,10 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkGenWMDestroyEvent \
(tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */
#endif
-/* Slot 52 is reserved */
+#ifndef TkMacOSXSetDrawingEnabled
+#define TkMacOSXSetDrawingEnabled \
+ (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */
+#endif
#ifndef TkpGetMS
#define TkpGetMS \
(tkIntPlatStubsPtr->tkpGetMS) /* 53 */
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 3ee54dd..90a124f 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -588,7 +588,7 @@ TkIntPlatStubs tkIntPlatStubs = {
TkGetTransientMaster, /* 49 */
TkGenerateButtonEvent, /* 50 */
TkGenWMDestroyEvent, /* 51 */
- NULL, /* 52 */
+ TkMacOSXSetDrawingEnabled, /* 52 */
TkpGetMS, /* 53 */
TkMacOSXDrawable, /* 54 */
TkpScanWindowId, /* 55 */
diff --git a/generic/tkText.c b/generic/tkText.c
index 139e71d..f023509 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -2999,11 +2999,9 @@ DeleteIndexRange(
* The code below is ugly, but it's needed to make sure there is always a
* dummy empty line at the end of the text. If the final newline of the
* file (just before the dummy line) is being deleted, then back up index
- * to just before the newline. If there is a newline just before the first
- * character being deleted, then back up the first index too, so that an
- * even number of lines gets deleted. Furthermore, remove any tags that
- * are present on the newline that isn't going to be deleted after all
- * (this simulates deleting the newline and then adding a "clean" one back
+ * to just before the newline. Furthermore, remove any tags that are
+ * present on the newline that isn't going to be deleted after all (this
+ * simulates deleting the newline and then adding a "clean" one back
* again). Note that index1 and index2 might now be equal again which
* means that no text will be deleted but tags might be removed.
*/
@@ -3018,10 +3016,6 @@ DeleteIndexRange(
oldIndex2 = index2;
TkTextIndexBackChars(NULL, &oldIndex2, 1, &index2, COUNT_INDICES);
line2--;
- if ((index1.byteIndex == 0) && (line1 != 0)) {
- TkTextIndexBackChars(NULL, &index1, 1, &index1, COUNT_INDICES);
- line1--;
- }
arrayPtr = TkBTreeGetTags(&index2, NULL, &arraySize);
if (arrayPtr != NULL) {
for (i = 0; i < arraySize; i++) {
diff --git a/library/menu.tcl b/library/menu.tcl
index fd814b3..4875477 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -1037,7 +1037,7 @@ proc ::tk::MenuFind {w char} {
proc ::tk::TraverseToMenu {w char} {
variable ::tk::Priv
- if {$char eq ""} {
+ if {![winfo exists $w] || $char eq ""} {
return
}
while {[winfo class $w] eq "Menu"} {
diff --git a/tests/menu.test b/tests/menu.test
index 3cb47c3..cfe00b9 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -754,8 +754,13 @@ test menu-3.41 {MenuWidgetCmd procedure, "index" option} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test"
- list [catch {.m1 index "test"} msg] $msg [destroy .m1]
-} {0 1 {}}
+ .m1 add command -label "3"
+ .m1 add command -label "another label"
+ .m1 add command -label "end"
+ .m1 add command -label "3a"
+ .m1 add command -label "final entry"
+ list [.m1 index "test"] [.m1 index "3"] [.m1 index "3a"] [.m1 index "end"] [destroy .m1]
+} {1 3 5 6 {}}
test menu-3.42 {MenuWidgetCmd procedure, "insert" option} {
catch {destroy .m1}
menu .m1
diff --git a/tests/text.test b/tests/text.test
index e75f38a..fa00ce3 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -726,7 +726,7 @@ test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup {
.mytop.t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n"
}
.mytop.t tag configure hidden -elide true
- .mytop.t tag add hidden 2.15 3.10
+ .mytop.t tag add hidden 2.20 3.10
.mytop.t configure -wrap char
lappend res [.mytop.t count -displaylines 2.0 3.0]
lappend res [.mytop.t count -displaylines 2.0 3.40]
@@ -1267,9 +1267,10 @@ test text-17.8 {DeleteChars procedure} {
.t tag add sel 1.0 end
.t delete 4.0 end
list [.t tag ranges sel] [.t get 1.0 end]
-} {{1.0 3.5} {Line 1
+} {{1.0 4.0} {Line 1
abcde
12345
+
}}
test text-17.9 {DeleteChars procedure} {
setup
diff --git a/tests/textDisp.test b/tests/textDisp.test
index aed842c..a6bbfd7 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -615,6 +615,10 @@ catch {destroy .f2}
.t configure -borderwidth 0 -wrap char
wm geom . {}
update
+set bw [.t cget -borderwidth]
+set px [.t cget -padx]
+set py [.t cget -pady]
+set hlth [.t cget -highlightthickness]
test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
# This test was failing on Windows because the title bar on .
# was a certain minimum size and it was interfering with the size
@@ -653,7 +657,7 @@ test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {textfont
update
.t delete 15.0 end
list [.t bbox 7.0] [.t bbox 12.0]
-} [list [list 3 [expr {2*$fixedDiff + 29}] 7 $fixedHeight] [list 3 [expr {7*$fixedDiff + 94}] 7 $fixedHeight]]
+} [list [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + $fixedHeight}] $fixedWidth $fixedHeight] [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 6 * $fixedHeight}] $fixedWidth $fixedHeight]]
test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
@@ -662,7 +666,7 @@ test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 13.0 end
update
list [.t index @0,0] $tk_textRelayout $tk_textRedraw
-} {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}}
+} {6.0 {13.0 7.0 6.40 6.20 6.0} {6.0 6.20 6.40 7.0 13.0}}
test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around, not once but really quite a few times.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
@@ -671,7 +675,7 @@ test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 14.0 end
update
list [.t index @0,0] $tk_textRelayout $tk_textRedraw
-} {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}}
+} {6.60 {14.0 7.0 6.80 6.60} {6.60 6.80 7.0 14.0}}
test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16"
@@ -3659,7 +3663,7 @@ test textDisp-28.1 {"yview" option with bizarre scroll command} {
set result [.t2.t index @0,0]
update
lappend result [.t2.t index @0,0]
-} {6.0 1.0}
+} {6.0 2.0}
test textDisp-29.1 {miscellaneous: lines wrap but are still too long} {textfonts} {
catch {destroy .t2}
diff --git a/win/configure b/win/configure
index 35f57ca..57e0453 100755
--- a/win/configure
+++ b/win/configure
@@ -3827,6 +3827,13 @@ echo "${ECHO_T}using shared flags" >&6
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
SHLIB_LD_LIBS='${LIBS}'
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ lflags="${lflags} -nodefaultlib:libucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
fi
# DLLSUFFIX is separate because it is the building block for
# users of tclConfig.sh that may build shared or static.
@@ -3864,6 +3871,15 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6
fi
LIBS="user32.lib advapi32.lib ws2_32.lib"
+
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ LIBS="$LIBS ucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
+
if test "$do64bit" != "no" ; then
# The space-based-path will work for the Makefile, but will
# not work if AC_TRY_COMPILE is called. TEA has the
@@ -3938,7 +3954,7 @@ fi
CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
# Do not use -O2 for Win64 - this has proved buggy in code gen.
CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}"
- lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
LINKBIN="\"${PATH64}/link.exe\""
# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
@@ -3950,7 +3966,7 @@ fi
CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
# -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy)
CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}"
- lflags="-nologo"
+ lflags="${lflags} -nologo"
LINKBIN="link"
fi
diff --git a/win/makefile.vc b/win/makefile.vc
index 4b9475f..d2795c9 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -42,7 +42,7 @@ the build instructions.
# turn on the 64-bit compiler, if your SDK has it.
#
# 3) Targets are:
-# release -- Builds the core, the shell. (default)
+# release -- Builds the core, the shell and the dlls. (default)
# dlls -- Just builds the windows extensions.
# shell -- Just builds the shell and the core.
# core -- Only builds the core [tkXX.(dll|lib)].
@@ -443,7 +443,7 @@ cdebug = $(OPTIMIZATIONS)
cdebug =
!endif
!if $(SYMBOLS)
-cdebug = $(cdebug) -Zi
+cdebug = $(cdebug) -Zi
!endif
!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
### Warnings are too many, can't support warnings into errors.
@@ -476,6 +476,7 @@ CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES)
+
#---------------------------------------------------------------------
# Link flags
#---------------------------------------------------------------------
@@ -496,6 +497,10 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)
lflags = $(lflags) -profile
!endif
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
+lflags = $(lflags) -nodefaultlib:libucrt.lib
+!endif
+
!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
### Align sections for PE size savings.
lflags = $(lflags) -opt:nowin98
@@ -520,6 +525,10 @@ baselibs = kernel32.lib user32.lib
baselibs = $(baselibs) bufferoverflowU.lib
!endif
!endif
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
+baselibs = $(baselibs) ucrt.lib
+!endif
+
guilibs = $(baselibs) gdi32.lib
diff --git a/win/tcl.m4 b/win/tcl.m4
index 44fd47e..6f10a96 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -783,6 +783,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
SHLIB_LD_LIBS='${LIBS}'
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ lflags="${lflags} -nodefaultlib:libucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
fi
# DLLSUFFIX is separate because it is the building block for
# users of tclConfig.sh that may build shared or static.
@@ -817,6 +824,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
LIBS="user32.lib advapi32.lib ws2_32.lib"
+
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ LIBS="$LIBS ucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
+
if test "$do64bit" != "no" ; then
# The space-based-path will work for the Makefile, but will
# not work if AC_TRY_COMPILE is called. TEA has the
@@ -831,7 +847,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
# Do not use -O2 for Win64 - this has proved buggy in code gen.
CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}"
- lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
LINKBIN="\"${PATH64}/link.exe\""
# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
@@ -843,7 +859,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
# -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy)
CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}"
- lflags="-nologo"
+ lflags="${lflags} -nologo"
LINKBIN="link"
fi