diff options
author | dgp <dgp@users.sourceforge.net> | 2008-01-23 16:39:10 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-01-23 16:39:10 (GMT) |
commit | fdc79d88bf0fa98a3137165409cca494d41289f7 (patch) | |
tree | 14d896642851057ef485bead30dd197b17bd753e | |
parent | 6e453ace6bf2cb69251e10bb67360f2a8b149afb (diff) | |
download | tk-fdc79d88bf0fa98a3137165409cca494d41289f7.zip tk-fdc79d88bf0fa98a3137165409cca494d41289f7.tar.gz tk-fdc79d88bf0fa98a3137165409cca494d41289f7.tar.bz2 |
merge updates from HEAD
-rw-r--r-- | ChangeLog | 74 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | changes | 10 | ||||
-rw-r--r-- | doc/canvas.n | 72 | ||||
-rw-r--r-- | doc/ttk_treeview.n | 4 | ||||
-rw-r--r-- | generic/tk.h | 6 | ||||
-rw-r--r-- | generic/tkMenubutton.c | 13 | ||||
-rw-r--r-- | generic/ttk/ttkFrame.c | 71 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.c | 23 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.h | 3 | ||||
-rw-r--r-- | library/demos/nl.msg | 213 | ||||
-rw-r--r-- | library/tk.tcl | 4 | ||||
-rw-r--r-- | library/ttk/treeview.tcl | 20 | ||||
-rw-r--r-- | library/ttk/utils.tcl | 62 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 4 | ||||
-rw-r--r-- | tests/ttk/treeview.test | 161 | ||||
-rwxr-xr-x | unix/configure | 4 | ||||
-rw-r--r-- | unix/configure.in | 4 | ||||
-rw-r--r-- | unix/tk.spec | 4 | ||||
-rwxr-xr-x | win/configure | 2 | ||||
-rw-r--r-- | win/configure.in | 4 | ||||
-rw-r--r-- | win/makefile.vc | 4 | ||||
-rw-r--r-- | win/nmakehlp.c | 8 | ||||
-rw-r--r-- | win/tkWinButton.c | 6 | ||||
-rw-r--r-- | win/tkWinInt.h | 49 | ||||
-rw-r--r-- | win/tkWinScrlbr.c | 8 | ||||
-rw-r--r-- | win/tkWinWm.c | 30 | ||||
-rw-r--r-- | win/ttkWinTheme.c | 107 |
28 files changed, 580 insertions, 394 deletions
@@ -1,7 +1,79 @@ -2007-12-12 Jeff Hobbs <jeffh@ActiveState.com> +2008-01-08 Joe English <jenglish@users.sourceforge.net> + + * generic/ttk/ttkFrame.c: BUGFIX: fix crash in [ttk::labelframe] + when -style option specified [Bug 1867122]. + +2008-01-08 Joe English <jenglish@users.sourceforge.net> + + * win/ttkWinTheme.c: Add tristate support to checkbuttons + and radiobuttons [Bug 1865898]. Fix check and radio indicator + size [Bug 1679067]. + +2008-01-06 Joe English <jenglish@users.sourceforge.net> + + * generic/ttk/ttkWidget.c, generic/ttk/ttkWidget.h: + Call Tk_MakeWindowExist() in widget constructor. + Removed now-unnecessary initial ConfigureNotify processing. + +2008-01-06 Joe English <jenglish@users.sourceforge.net> + + * library/ttk/treeview.tcl, library/ttk/utils.tcl: + Fix MouseWheel bindings for ttk::treeview widget + (Fixes #1442006, #1821939, #1862692) + +2008-01-02 Don Porter <dgp@users.sourceforge.net> + + * generic/tk.h: Bump version number to 8.5.1b1 to distinguish + * library/tk.tcl: CVS development snapshots from the 8.5.0 and + * unix/configure.in: 8.5.1 releases. + * unix/tk.spec: + * win/configure.in: + + * unix/configure: autoconf (2.59) + * win/configure: + +2007-12-30 Donal K. Fellows <dkf@users.sf.net> + + * doc/canvas.n: Documented exact behaviour of items with respect to + when they are the current item. [Bug 1774593] Also documented the + clipping behaviour of window items. + + * library/demos/nl.msg: Corrected following testing "in the field" by + Arjen Markus. [Bug 1860802] + +2007-12-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk> *** 8.5.0 TAGGED FOR RELEASE *** + * doc/canvas.n: Documented -outlineoffset item option. [Bug 1836621] + +2007-12-14 Don Porter <dgp@users.sourceforge.net> + + * changes: More updates for 8.5.0 release. + +2007-12-14 Joe English <jenglish@users.sourceforge.net> + + * doc/ttk_treeview.n: Fix typo [Bug 1850713]. + +2007-12-14 Pat Thoyts <patthoyts@users.sourceforge.net> + + * win/tkWinInt.h: Add in missing function definitions + * win/tkWinButton.c: to support plain MSVC6 and use INT_PTR + * win/tkWinScrlBar.c: rather than LONG_PTR which isn'tr defined + * win/tkWinWm.c: in the msvc6 headers. + +2007-12-14 Pat Thoyts <patthoyts@users.sourceforge.net> + + * win/nmakehlp.c: Support compilation with MSVC9 for AMD64. + * win/makefile.vc: + +2007-12-13 Jeff Hobbs <jeffh@ActiveState.com> + + * generic/tkMenubutton.c (ConfigureMenuButton): trace the + -textvariable even if an image exists as it may use -compound. + +2007-12-12 Jeff Hobbs <jeffh@ActiveState.com> + * generic/tkText.c (DeleteIndexRange, TextEditCmd, UpdateDirtyFlag): * tests/text.test (text-25.10.1,25.11.[12]): Don't require [update idle] to trigger Modified event [Bug 1809538] @@ -1,11 +1,11 @@ README: Tk - This is the Tk 8.5.0 source distribution. + This is the Tk 8.5.1 source distribution. Tcl/Tk is also available through NetCVS: http://tcl.sourceforge.net/ You can get any source release of Tcl from the file distributions link at the above URL. -RCS: @(#) $Id: README,v 1.47.2.4 2007/11/21 16:46:25 dgp Exp $ +RCS: @(#) $Id: README,v 1.47.2.5 2008/01/23 16:39:11 dgp Exp $ 1. Introduction --------------- @@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was released on March 13, 1991. Changes that aren't backward compatible are marked specially. -RCS: @(#) $Id: changes,v 1.107.2.5 2007/12/13 06:28:46 dgp Exp $ +RCS: @(#) $Id: changes,v 1.107.2.6 2008/01/23 16:39:11 dgp Exp $ 3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from the interpreter when the main window is deleted (otherwise there will @@ -6456,6 +6456,12 @@ steffen, kupries) 2007-12-12 (bug fix)[1845899] Aqua: [wm transient] (steffen) +2007-12-12 (bug fix)[1809538,1799782,1737288] fixes for the <<Modified>> +virtual event on [text] widgets (hobbs) + +2007-12-13 (bug fix) correctly trace menubutton -textvariable for -compound +use (hobbs) + Several documentation and release notes improvements ---- Released 8.5.0, December 14, 2007 --- See ChangeLog for details --- +--- Released 8.5.0, December 18, 2007 --- See ChangeLog for details --- diff --git a/doc/canvas.n b/doc/canvas.n index 8add34a..ebe61ff 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: canvas.n,v 1.24.2.4 2007/11/01 16:37:14 dgp Exp $ +'\" RCS: @(#) $Id: canvas.n,v 1.24.2.5 2008/01/23 16:39:11 dgp Exp $ '\" .so man.macros .TH canvas n 8.3 Tk "Tk Built-In Commands" @@ -155,7 +155,8 @@ all the items in the canvas. The tag \fBcurrent\fR is managed automatically by Tk; it applies to the \fIcurrent item\fR, which is the topmost item whose drawn area covers the position of -the mouse cursor. +the mouse cursor (different item types interpret this in varying ways; see the +individual item type documentation for details). If the mouse is not in the canvas widget or is not over an item, then no item has the \fBcurrent\fR tag. .PP @@ -1126,6 +1127,17 @@ in a solid fashion. \fINote that stipples are not well supported on platforms that do not use X11 as their drawing API.\fR .TP +\fB\-outlineoffset \fIoffset\fR +. +Specifies the offset of the stipple pattern used for outlines. The +offset value can be of the form +.QW \fIx\fB,\fIy\fR +or the description of a side (one of \fBn\fR, \fBne\fR, \fBe\fR, +\fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR). This +option only has an effect when the outline is drawn as a stipple +pattern, and is only supported under X11. +.\" TODO: What does this actually do? What do the acceptable forms mean?! +.TP \fB\-stipple \fIbitmap\fR .TP \fB\-activestipple \fIbitmap\fR @@ -1184,7 +1196,9 @@ After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. An arc item becomes the current item when the mouse pointer is +over any part that is painted or (when fully transparent) that would be +painted if both the \fB\-fill\fR and \fB\-outline\fR options were non-empty. .PP The following standard options are supported by arcs: .CS @@ -1199,6 +1213,7 @@ The following standard options are supported by arcs: \-outline \-activeoutline \-disabledoutline +\-outlineoffset \-outlinestipple \-activeoutlinestipple \-disabledoutlinestipple @@ -1247,14 +1262,16 @@ Bitmaps are created with widget commands of the following form: \fIpathName \fBcreate bitmap \fIx y \fR?\fIoption value option value ...\fR? \fIpathName \fBcreate bitmap \fIcoordList\fR ?\fIoption value option value ...\fR? .CE -The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a +The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR (which must have two +elements) specify the coordinates of a point used to position the bitmap on the display (see the \fB\-anchor\fR option below for more information on how bitmaps are displayed). After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. A bitmap item becomes the current item when the mouse pointer +is over any part of its bounding box. .PP The following standard options are supported by bitmaps: .CS @@ -1320,7 +1337,8 @@ After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. An image item becomes the current item when the mouse pointer +is over any part of its bounding box. .PP The following standard options are supported by images: .CS @@ -1365,7 +1383,9 @@ After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. A line item is the current item whenever the mouse pointer is +over any segment of the line, whether drawn or not and whether or not the line +is smoothed. .PP The following standard options are supported by lines: .CS @@ -1477,7 +1497,9 @@ After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. An oval item becomes the current item when the mouse pointer is +over any part that is painted or (when fully transparent) that would be +painted if both the \fB\-fill\fR and \fB\-outline\fR options were non-empty. .PP The following standard options are supported by ovals: .CS @@ -1492,6 +1514,7 @@ The following standard options are supported by ovals: \-outline \-activeoutline \-disabledoutline +\-outlineoffset \-outlinestipple \-activeoutlinestipple \-disabledoutlinestipple @@ -1524,7 +1547,9 @@ After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. A polygon item is the current item whenever the mouse pointer +is over any part of the polygon, whether drawn or not and whether or not the +outline is smoothed. .PP The following standard options are supported by polygons: .CS @@ -1609,7 +1634,8 @@ following form: \fIpathName \fBcreate rectangle \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR? \fIpathName \fBcreate rectangle \fIcoordList\fR ?\fIoption value option value ...\fR? .CE -The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR give +The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR +(which must have four elements) give the coordinates of two diagonally opposite corners of the rectangle (the rectangle will include its upper and left edges but not its lower or right edges). @@ -1617,7 +1643,10 @@ After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. A rectangle item becomes the current item when the mouse +pointer is over any part that is painted or (when fully transparent) that +would be painted if both the \fB\-fill\fR and \fB\-outline\fR options were +non-empty. .PP The following standard options are supported by rectangles: .CS @@ -1632,6 +1661,7 @@ The following standard options are supported by rectangles: \-outline \-activeoutline \-disabledoutline +\-outlineoffset \-outlinestipple \-activeoutlinestipple \-disabledoutlinestipple @@ -1658,14 +1688,16 @@ form: \fIpathName \fBcreate text \fIx y \fR?\fIoption value option value ...\fR? \fIpathName \fBcreate text \fIcoordList\fR ?\fIoption value option value ...\fR? .CE -The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a +The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR (which must have two +elements) specify the coordinates of a point used to position the text on the display (see the options below for more information on how text is displayed). After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. A text item becomes the current item when the mouse pointer +is over any part of its bounding box. .PP The following standard options are supported by text items: .CS @@ -1739,14 +1771,18 @@ Window items are created with widget commands of the following form: \fIpathName \fBcreate window \fIx y \fR?\fIoption value option value ...\fR? \fIpathName \fBcreate window \fIcoordList\fR ?\fIoption value option value ...\fR? .CE -The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a +The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR (which must have two +elements) specify the coordinates of a point used to position the window on the display (see the \fB\-anchor\fR option below for more information on how bitmaps are displayed). After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's -configuration. +configuration. Theoretically, a window item becomes the current item when the +mouse pointer is over any part of its bounding box, but in practice this +typically does not happen because the mouse pointer ceases to be over the +canvas at that point. .PP The following standard options are supported by window items: .CS @@ -1787,7 +1823,11 @@ the canvas widget or a child of some ancestor of the canvas widget. Note: due to restrictions in the ways that windows are managed, it is not possible to draw other graphical items (such as lines and images) on top of window items. A window item always obscures any graphics that -overlap it, regardless of their order in the display list. +overlap it, regardless of their order in the display list. Also note that +window items, unlike other canvas items, are not clipped for display by their +containing canvas's border, and are instead clipped by the parent widget of +the window specified by the \fB\-window\fR option; when the parent widget is +the canvas, this means that the window item can overlap the canvas's border. .SH "APPLICATION-DEFINED ITEM TYPES" .PP It is possible for individual applications to define new item diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index 2bfe559..ee65f5f 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_treeview.n,v 1.5.2.5 2007/12/13 06:28:47 dgp Exp $ +'\" RCS: @(#) $Id: ttk_treeview.n,v 1.5.2.6 2008/01/23 16:39:11 dgp Exp $ '\" .so man.macros .TH ttk::treeview n 8.5 Tk "Tk Themed Widget" @@ -339,7 +339,7 @@ The binding \fIscript\fR undergoes \fB%\fR-substitutions before evaluation; see \fBbind(n)\fR for details. .RE .TP -\fIpathName \fBtag configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +\fIpathName \fBtag configure\fR \fItagName\fR ?\fIoption\fR? ?\fIvalue option value...\fR? Query or modify the options for the specified \fItagName\fR. If one or more \fIoption/value\fR pairs are specified, sets the value of those options for the specified tag. diff --git a/generic/tk.h b/generic/tk.h index 5b08cf1..cd8ea82 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.98.2.6 2007/11/21 16:46:25 dgp Exp $ + * RCS: @(#) $Id: tk.h,v 1.98.2.7 2008/01/23 16:39:11 dgp Exp $ */ #ifndef _TK @@ -53,10 +53,10 @@ extern "C" { #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 5 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 0 +#define TK_RELEASE_SERIAL 1 #define TK_VERSION "8.5" -#define TK_PATCH_LEVEL "8.5.0" +#define TK_PATCH_LEVEL "8.5.1b1" /* * A special definition used to allow this header file to be included from diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index a2db54c..d42b263 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.c,v 1.15.2.2 2007/09/07 01:25:35 dgp Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.15.2.3 2008/01/23 16:39:12 dgp Exp $ */ #include "tkInt.h" @@ -610,15 +610,12 @@ ConfigureMenuButton( Tk_FreeSavedOptions(&savedOptions); } - if ((mbPtr->image == NULL) && (mbPtr->bitmap == None) - && (mbPtr->textVarName != NULL)) { - + if (mbPtr->textVarName != NULL) { /* - * The menubutton displays the value of a variable. Set up a trace to - * watch for any changes in it, create the variable if it doesn't - * exist, and fetch its current value. + * If no image or -compound is used, display the value of a variable. + * Set up a trace to watch for any changes in it, create the variable + * if it doesn't exist, and fetch its current value. */ - CONST char *value; value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY); diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index b4cf916..9c5b2d4 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -1,4 +1,4 @@ -/* $Id: ttkFrame.c,v 1.5.2.4 2007/11/25 19:19:21 dgp Exp $ +/* $Id: ttkFrame.c,v 1.5.2.5 2008/01/23 16:39:12 dgp Exp $ * Copyright (c) 2004, Joe English * * ttk::frame and ttk::labelframe widgets. @@ -27,16 +27,15 @@ typedef struct { FramePart frame; } Frame; -static Tk_OptionSpec FrameOptionSpecs[] = -{ +static Tk_OptionSpec FrameOptionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", NULL, Tk_Offset(Frame,frame.borderWidthObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, - Tk_Offset(Frame,frame.paddingObj), -1, + Tk_Offset(Frame,frame.paddingObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", NULL, - Tk_Offset(Frame,frame.reliefObj), -1, + Tk_Offset(Frame,frame.reliefObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_PIXELS, "-width", "width", "Width", "0", Tk_Offset(Frame,frame.widthObj), -1, @@ -48,8 +47,7 @@ static Tk_OptionSpec FrameOptionSpecs[] = WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; -static WidgetCommandSpec FrameCommands[] = -{ +static WidgetCommandSpec FrameCommands[] = { { "configure", TtkWidgetConfigureCommand }, { "cget", TtkWidgetCgetCommand }, { "instate", TtkWidgetInstateCommand }, @@ -70,7 +68,7 @@ static Ttk_Padding FrameMargins(Frame *framePtr) /* Check -padding: */ if (framePtr->frame.paddingObj) { - Ttk_GetPaddingFromObj(NULL, + Ttk_GetPaddingFromObj(NULL, framePtr->core.tkwin, framePtr->frame.paddingObj, &margins); } @@ -78,7 +76,7 @@ static Ttk_Padding FrameMargins(Frame *framePtr) */ if (framePtr->frame.borderWidthObj) { int border = 0; - Tk_GetPixelsFromObj(NULL, + Tk_GetPixelsFromObj(NULL, framePtr->core.tkwin, framePtr->frame.borderWidthObj, &border); margins = Ttk_AddPadding(margins, Ttk_UniformPadding((short)border)); } @@ -99,7 +97,7 @@ static int FrameSize(void *recordPtr, int *widthPtr, int *heightPtr) /* * FrameConfigure -- configure hook. - * <<NOTE-SIZE>> Usually the size of a frame is controlled by + * <<NOTE-SIZE>> Usually the size of a frame is controlled by * a geometry manager (pack, grid); the -width and -height * options are only effective if geometry propagation is turned * off or if the [place] GM is used for child widgets. @@ -135,7 +133,7 @@ static int FrameConfigure(Tcl_Interp *interp, void *recordPtr, int mask) interp,framePtr->core.tkwin,framePtr->frame.widthObj,&width) || TCL_OK != Tk_GetPixelsFromObj( interp,framePtr->core.tkwin,framePtr->frame.heightObj,&height) - ) + ) { return TCL_ERROR; } @@ -147,8 +145,7 @@ static int FrameConfigure(Tcl_Interp *interp, void *recordPtr, int mask) return TtkCoreConfigure(interp, recordPtr, mask); } -static WidgetSpec FrameWidgetSpec = -{ +static WidgetSpec FrameWidgetSpec = { "TFrame", /* className */ sizeof(Frame), /* recordSize */ FrameOptionSpecs, /* optionSpecs */ @@ -190,7 +187,7 @@ int TtkGetLabelAnchorFromObj( case 's' : flags = TTK_PACK_BOTTOM; break; default : goto error; } - + /* Remaining characters are as per -sticky: */ while ((c = *string++) != '\0') { @@ -251,16 +248,15 @@ typedef struct { #define LABELWIDGET_CHANGED 0x100 -static Tk_OptionSpec LabelframeOptionSpecs[] = -{ +static Tk_OptionSpec LabelframeOptionSpecs[] = { {TK_OPTION_STRING, "-labelanchor", "labelAnchor", "LabelAnchor", "nw", Tk_Offset(Labelframe, label.labelAnchorObj),-1, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-text", "text", "Text", "", - Tk_Offset(Labelframe,label.textObj), -1, - 0,0,GEOMETRY_CHANGED }, + Tk_Offset(Labelframe,label.textObj), -1, + 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", - "-1", Tk_Offset(Labelframe,label.underlineObj), -1, + "-1", Tk_Offset(Labelframe,label.underlineObj), -1, 0,0,0 }, {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget", NULL, -1, Tk_Offset(Labelframe,label.labelWidget), @@ -303,10 +299,10 @@ static void LabelframeStyleOptions(Labelframe *lf, LabelframeStyle *style) Ttk_GetBorderFromObj(NULL, objPtr, &style->labelMargins); } else { if (style->labelAnchor & (TTK_PACK_TOP|TTK_PACK_BOTTOM)) { - style->labelMargins = + style->labelMargins = Ttk_MakePadding(DEFAULT_LABELINSET,0,DEFAULT_LABELINSET,0); } else { - style->labelMargins = + style->labelMargins = Ttk_MakePadding(0,DEFAULT_LABELINSET,0,DEFAULT_LABELINSET); } } @@ -321,16 +317,19 @@ static void LabelframeStyleOptions(Labelframe *lf, LabelframeStyle *style) * Extract the requested width and height of the labelframe's label: * taken from the label widget if specified, otherwise the text label. */ -static void +static void LabelframeLabelSize(Labelframe *lframePtr, int *widthPtr, int *heightPtr) { Tk_Window labelWidget = lframePtr->label.labelWidget; + Ttk_Layout labelLayout = lframePtr->label.labelLayout; if (labelWidget) { *widthPtr = Tk_ReqWidth(labelWidget); *heightPtr = Tk_ReqHeight(labelWidget); + } else if (labelLayout) { + Ttk_LayoutSize(labelLayout, 0, widthPtr, heightPtr); } else { - Ttk_LayoutSize(lframePtr->label.labelLayout, 0, widthPtr, heightPtr); + *widthPtr = *heightPtr = 0; } } @@ -371,14 +370,14 @@ static int LabelframeSize(void *recordPtr, int *widthPtr, int *heightPtr) /* Request minimum size based on border width and label size: */ - Tk_SetMinimumRequestSize(corePtr->tkwin, + Tk_SetMinimumRequestSize(corePtr->tkwin, labelWidth + 2*style.borderWidth, labelHeight + 2*style.borderWidth); return 0; } -/* +/* * LabelframeGetLayout -- * Getlayout widget hook. */ @@ -410,7 +409,7 @@ static Ttk_Layout LabelframeGetLayout( /* * LabelframeDoLayout -- - * Labelframe layout hook. + * Labelframe layout hook. * * Side effects: Computes labelParcel. */ @@ -447,11 +446,14 @@ static void LabelframeDoLayout(void *recordPtr) } } - /* + /* * Place border and label: */ Ttk_PlaceLayout(corePtr->layout, corePtr->state, borderParcel); - Ttk_PlaceLayout(lframePtr->label.labelLayout, corePtr->state, labelParcel); + if (lframePtr->label.labelLayout) { + Ttk_PlaceLayout( + lframePtr->label.labelLayout, corePtr->state, labelParcel); + } /* labelWidget placed in LabelframePlaceSlaves GM hook */ lframePtr->label.labelParcel = labelParcel; } @@ -460,14 +462,16 @@ static void LabelframeDisplay(void *recordPtr, Drawable d) { Labelframe *lframePtr = recordPtr; Ttk_DrawLayout(lframePtr->core.layout, lframePtr->core.state, d); - Ttk_DrawLayout(lframePtr->label.labelLayout, lframePtr->core.state, d); + if (lframePtr->label.labelLayout) { + Ttk_DrawLayout(lframePtr->label.labelLayout, lframePtr->core.state, d); + } } /* +++ Labelframe geometry manager hooks. */ /* LabelframePlaceSlaves -- - * Sets the position and size of the labelwidget. + * Sets the position and size of the labelwidget. */ static void LabelframePlaceSlaves(void *recordPtr) { @@ -534,7 +538,7 @@ static void LabelframeCleanup(void *recordPtr) } /* RaiseLabelWidget -- - * Raise the -labelwidget to ensure that the labelframe doesn't + * Raise the -labelwidget to ensure that the labelframe doesn't * obscure it (if it's not a direct child), or bring it to * the top of the stacking order (if it is). */ @@ -605,8 +609,7 @@ static int LabelframeConfigure(Tcl_Interp *interp,void *recordPtr,int mask) return TCL_OK; } -static WidgetSpec LabelframeWidgetSpec = -{ +static WidgetSpec LabelframeWidgetSpec = { "TLabelframe", /* className */ sizeof(Labelframe), /* recordSize */ LabelframeOptionSpecs, /* optionSpecs */ @@ -641,7 +644,7 @@ void TtkFrame_Init(Tcl_Interp *interp) Ttk_RegisterLayout(theme, "TFrame", FrameLayout); Ttk_RegisterLayout(theme, "TLabelframe", LabelframeLayout); - Ttk_RegisterLayout(theme, "TLabelframe.Label", LabelSublayout); + Ttk_RegisterLayout(theme, "Label", LabelSublayout); RegisterWidget(interp, "ttk::frame", &FrameWidgetSpec); RegisterWidget(interp, "ttk::labelframe", &LabelframeWidgetSpec); diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index b8736da..8f60b00 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.c,v 1.7.2.1 2007/11/01 16:37:20 dgp Exp $ +/* $Id: ttkWidget.c,v 1.7.2.2 2008/01/23 16:39:12 dgp Exp $ * Copyright (c) 2003, Joe English * * Core widget utilities. @@ -232,17 +232,8 @@ WidgetCleanup(char *memPtr) * It turns out this is impossible to do correctly in a binding script, * because Tk filters out focus events with detail == NotifyInferior. * - * For Deactivate/Activate pseudo-events, clear/set the background state flag. - * - * <<NOTE-REALIZED>> On the first ConfigureNotify event - * (which indicates that the window has just been created), - * update the layout. This is to work around two problems: - * (1) Virtual events aren't delivered to unrealized widgets - * (see bug #835997), so any intervening <<ThemeChanged>> events - * will not have been processed. - * - * (2) Geometry calculations in the XP theme don't work - * until the widget is realized. + * For Deactivate/Activate pseudo-events, set/clear the background state + * flag. */ static const unsigned CoreEventMask @@ -260,12 +251,6 @@ static void CoreEventProc(ClientData clientData, XEvent *eventPtr) switch (eventPtr->type) { case ConfigureNotify : - if (!(corePtr->flags & WIDGET_REALIZED)) { - /* See <<NOTE-REALIZED>> */ - (void)UpdateLayout(corePtr->interp, corePtr); - SizeChanged(corePtr); - corePtr->flags |= WIDGET_REALIZED; - } TtkRedisplayWidget(corePtr); break; case Expose : @@ -444,6 +429,8 @@ int TtkWidgetConstructorObjCmd( SizeChanged(corePtr); Tk_CreateEventHandler(tkwin, CoreEventMask, CoreEventProc, recordPtr); + Tk_MakeWindowExist(tkwin); + Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(tkwin), -1)); return TCL_OK; diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index 7f67b68..f81f5e7 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.h,v 1.6.2.1 2007/12/04 17:05:21 dgp Exp $ +/* $Id: ttkWidget.h,v 1.6.2.2 2008/01/23 16:39:12 dgp Exp $ * Copyright (c) 2003, Joe English * Helper routines for widget implementations. */ @@ -11,7 +11,6 @@ */ #define WIDGET_DESTROYED 0x0001 #define REDISPLAY_PENDING 0x0002 /* scheduled call to RedisplayWidget */ -#define WIDGET_REALIZED 0x0010 /* set at first ConfigureNotify */ #define CURSOR_ON 0x0020 /* See TtkBlinkCursor() */ #define WIDGET_USER_FLAG 0x0100 /* 0x0100 - 0x8000 for user flags */ diff --git a/library/demos/nl.msg b/library/demos/nl.msg index 1c3a8c3..b17ceaa 100644 --- a/library/demos/nl.msg +++ b/library/demos/nl.msg @@ -1,118 +1,125 @@ -mcset nl "Widget Demonstration" "Demonstratie van widgets" -mcset nl "tkWidgetDemo" "tkWidgetDemo" -mcset nl "&File" "&Bestand" -mcset nl "About..." "Info..." -mcset nl "&About..." "&Info..." -mcset nl "<F1>" "<F1>" -mcset nl "&Quit" "&Einde" -mcset nl "Meta+Q" "Meta+E" ;# Displayed hotkey -mcset nl "Meta-q" "Meta-e" ;# Actual binding sequence -mcset nl "Ctrl+Q" "Ctrl+E" ;# Displayed hotkey -mcset nl "Control-q" "Control-e" ;# Actual binding sequence -mcset nl "Dismiss" "Sluiten" -mcset nl "See Variables" "Bekijk Variabelen" -mcset nl "Variable Values" "Waarden Variabelen" -mcset nl "OK" "OK" -mcset nl "Run the \"%s\" sample program" "Start voorbeeld \"%s\"" -mcset nl "Print Code" "Code Afdrukken" -mcset nl "Demo code: %s" "Code van Demo %s" -mcset nl "About Widget Demo" "Over deze demonstratie" -mcset nl "Tk widget demonstration" "Demonstratie van Tk widgets" -mcset nl "Copyright (c) %s" "Copyright (c) %s" +::msgcat::mcset nl "Widget Demonstration" "Demonstratie van widgets" +::msgcat::mcset nl "tkWidgetDemo" "tkWidgetDemo" +::msgcat::mcset nl "&File" "&Bestand" +::msgcat::mcset nl "About..." "Info..." +::msgcat::mcset nl "&About..." "&Info..." +::msgcat::mcset nl "<F1>" "<F1>" +::msgcat::mcset nl "&Quit" "&Einde" +::msgcat::mcset nl "Meta+Q" "Meta+E" ;# Displayed hotkey +::msgcat::mcset nl "Meta-q" "Meta-e" ;# Actual binding sequence +::msgcat::mcset nl "Ctrl+Q" "Ctrl+E" ;# Displayed hotkey +::msgcat::mcset nl "Control-q" "Control-e" ;# Actual binding sequence +::msgcat::mcset nl "Dismiss" "Sluiten" +::msgcat::mcset nl "See Variables" "Bekijk Variabelen" +::msgcat::mcset nl "Variable Values" "Waarden Variabelen" +::msgcat::mcset nl "OK" "OK" +::msgcat::mcset nl "Run the \"%s\" sample program" "Start voorbeeld \"%s\"" +::msgcat::mcset nl "Print Code" "Code Afdrukken" +::msgcat::mcset nl "Demo code: %s" "Code van Demo %s" +::msgcat::mcset nl "About Widget Demo" "Over deze demonstratie" +::msgcat::mcset nl "Tk widget demonstration" "Demonstratie van Tk widgets" +::msgcat::mcset nl "Copyright (c) %s" "Copyright (c) %s" -mcset nl "Tk Widget Demonstrations" "Demostratie van Tk widgets" -mcset nl "This application provides a front end for several short scripts" \ - "Dit programma is een schil rond enkele korte scripts waarmee" -mcset nl "that demonstrate what you can do with Tk widgets. Each of the" \ - "gedemonstreerd wordt wat je kunt doen met Tk widgets. Elk van de" -mcset nl "numbered lines below describes a demonstration; you can click on" \ - "genummerde regels hieronder omschrijft een demonstratie; je kunt de" -mcset nl "it to invoke the demonstration. Once the demonstration window" \ - "demonstratie starten door op de regel te klikken." -mcset nl "appears, you can click the" \ - "Zodra het nieuwe venster verschijnt, kun je op de knop" -mcset nl "See Code" "Bekijk Code" ;# This is also button text! -mcset nl "button to see the Tcl/Tk code that created the demonstration. If" \ - "drukken om de achterliggende Tcl/Tk code te zien. Als je dat wilt," -mcset nl "you wish, you can edit the code and click the" \ - "kun je de code wijzigen en op de knop" -mcset nl "Rerun Demo" "Herstart Demo" ;# This is also button text! -mcset nl "button in the code window to reinvoke the demonstration with the" \ - "drukken in het codevenster om de demonstratie uit te voeren met de" -mcset nl "modified code." \ - "nieuwe code." +::msgcat::mcset nl "Tk Widget Demonstrations" "Demostratie van Tk widgets" +::msgcat::mcset nl "This application provides a front end for several short scripts" \ + "Dit programma is een schil rond enkele korte scripts waarmee" +::msgcat::mcset nl "that demonstrate what you can do with Tk widgets. Each of the" \ + "gedemonstreerd wordt wat je kunt doen met Tk widgets. Elk van de" +::msgcat::mcset nl "numbered lines below describes a demonstration; you can click on" \ + "genummerde regels hieronder omschrijft een demonstratie; je kunt de" +::msgcat::mcset nl "it to invoke the demonstration. Once the demonstration window" \ + "demonstratie starten door op de regel te klikken." +::msgcat::mcset nl "appears, you can click the" \ + "Zodra het nieuwe venster verschijnt, kun je op de knop" +::msgcat::mcset nl "See Code" "Bekijk Code" ;# This is also button text! +::msgcat::mcset nl "button to see the Tcl/Tk code that created the demonstration. If" \ + "drukken om de achterliggende Tcl/Tk code te zien. Als je dat wilt," +::msgcat::mcset nl "you wish, you can edit the code and click the" \ + "kun je de code wijzigen en op de knop" +::msgcat::mcset nl "Rerun Demo" "Herstart Demo" ;# This is also button text! +::msgcat::mcset nl "button in the code window to reinvoke the demonstration with the" \ + "drukken in het codevenster om de demonstratie uit te voeren met de" +::msgcat::mcset nl "modified code." \ + "nieuwe code." -mcset nl "Labels, buttons, checkbuttons, and radiobuttons" \ - "Labels, knoppen, vinkjes/aankruishokjes en radioknoppen" +::msgcat::mcset nl "Labels, buttons, checkbuttons, and radiobuttons" \ + "Labels, knoppen, vinkjes/aankruishokjes en radioknoppen" -mcset nl "Labels (text and bitmaps)" "Labels (tekst en plaatjes)" -mcset nl "Labels and UNICODE text" "Labels en tekst in UNICODE" -mcset nl "Buttons" "Buttons (drukknoppen)" -mcset nl "Check-buttons (select any of a group)" "Check-buttons (een of meer uit een groep)" -mcset nl "Radio-buttons (select one of a group)" "Radio-buttons (een van een groep)" -mcset nl "A 15-puzzle game made out of buttons" "Een schuifpuzzel van buttons" -mcset nl "Iconic buttons that use bitmaps" "Buttons met pictogrammen" -mcset nl "Two labels displaying images" "Twee labels met plaatjes in plaats van tekst" -mcset nl "A simple user interface for viewing images" \ - "Een eenvoudige user-interface voor het bekijken van plaatjes" -mcset nl "Labelled frames" "Kaders met bijschrift" +::msgcat::mcset nl "Labels (text and bitmaps)" "Labels (tekst en plaatjes)" +::msgcat::mcset nl "Labels and UNICODE text" "Labels en tekst in UNICODE" +::msgcat::mcset nl "Buttons" "Buttons (drukknoppen)" +::msgcat::mcset nl "Check-buttons (select any of a group)" \ + "Check-buttons (een of meer uit een groep)" +::msgcat::mcset nl "Radio-buttons (select one of a group)" \ + "Radio-buttons (een van een groep)" +::msgcat::mcset nl "A 15-puzzle game made out of buttons" \ + "Een schuifpuzzel van buttons" +::msgcat::mcset nl "Iconic buttons that use bitmaps" \ + "Buttons met pictogrammen" +::msgcat::mcset nl "Two labels displaying images" \ + "Twee labels met plaatjes in plaats van tekst" +::msgcat::mcset nl "A simple user interface for viewing images" \ + "Een eenvoudige user-interface voor het bekijken van plaatjes" +::msgcat::mcset nl "Labelled frames" \ + "Kaders met bijschrift" -mcset nl "Listboxes" "Keuzelijsten" -mcset nl "The 50 states" "De 50 staten van de VS" -mcset nl "Colors: change the color scheme for the application" \ +::msgcat::mcset nl "Listboxes" "Keuzelijsten" +::msgcat::mcset nl "The 50 states" "De 50 staten van de VS" +::msgcat::mcset nl "Colors: change the color scheme for the application" \ "Kleuren: verander het kleurenschema voor het programma" -mcset nl "A collection of famous and infamous sayings" \ +::msgcat::mcset nl "A collection of famous and infamous sayings" \ "Beroemde en beruchte citaten en gezegden" -mcset nl "Entries and Spin-boxes" "Invulvelden en Spinboxen" -mcset nl "Entries without scrollbars" "Invulvelden zonder schuifbalk" -mcset nl "Entries with scrollbars" "Invulvelden met schuifbalk" -mcset nl "Validated entries and password fields" \ +::msgcat::mcset nl "Entries and Spin-boxes" "Invulvelden en Spinboxen" +::msgcat::mcset nl "Entries without scrollbars" "Invulvelden zonder schuifbalk" +::msgcat::mcset nl "Entries with scrollbars" "Invulvelden met schuifbalk" +::msgcat::mcset nl "Validated entries and password fields" \ "Invulvelden met controle of wachtwoorden" -mcset nl "Spin-boxes" "Spinboxen" -mcset nl "Simple Rolodex-like form" "Simpel kaartsysteem" +::msgcat::mcset nl "Spin-boxes" "Spinboxen" +::msgcat::mcset nl "Simple Rolodex-like form" "Simpel kaartsysteem" -mcset nl "Text" "Tekst" -mcset nl "Basic editable text" "Voorbeeld met te wijzigen tekst" -mcset nl "Text display styles" "Tekst met verschillende stijlen" -mcset nl "Hypertext (tag bindings)" "Hypertext (verwijzingen via \"tags\")" -mcset nl "A text widget with embedded windows" \ - "Tekstwidget met windows erin" -mcset nl "A search tool built with a text widget" \ - "Zoeken in tekst met behulp van een tekstwidget" +::msgcat::mcset nl "Text" "Tekst" +::msgcat::mcset nl "Basic editable text" "Voorbeeld met te wijzigen tekst" +::msgcat::mcset nl "Text display styles" "Tekst met verschillende stijlen" +::msgcat::mcset nl "Hypertext (tag bindings)" \ + "Hypertext (verwijzingen via \"tags\")" +::msgcat::mcset nl "A text widget with embedded windows" \ + "Tekstwidget met windows erin" +::msgcat::mcset nl "A search tool built with a text widget" \ + "Zoeken in tekst met behulp van een tekstwidget" -mcset nl "Canvases" "Canvaswidgets" -mcset nl "The canvas item types" "Objecten in een canvas" -mcset nl "A simple 2-D plot" "Eenvoudige 2D-grafiek" -mcset nl "Text items in canvases" "Tekstobjecten in een canvas" -mcset nl "An editor for arrowheads on canvas lines" \ - "Editor voor de vorm van de pijl (begin/eind van een lijn)" -mcset nl "A ruler with adjustable tab stops" \ - "Een meetlat met aanpasbare ruiters" -mcset nl "A building floor plan" "Plattegrond van een gebouw" -mcset nl "A simple scrollable canvas" "Een schuifbaar canvas" +::msgcat::mcset nl "Canvases" "Canvaswidgets" +::msgcat::mcset nl "The canvas item types" "Objecten in een canvas" +::msgcat::mcset nl "A simple 2-D plot" "Eenvoudige 2D-grafiek" +::msgcat::mcset nl "Text items in canvases" "Tekstobjecten in een canvas" +::msgcat::mcset nl "An editor for arrowheads on canvas lines" \ + "Editor voor de vorm van de pijl (begin/eind van een lijn)" +::msgcat::mcset nl "A ruler with adjustable tab stops" \ + "Een meetlat met aanpasbare ruiters" +::msgcat::mcset nl "A building floor plan" "Plattegrond van een gebouw" +::msgcat::mcset nl "A simple scrollable canvas" "Een schuifbaar canvas" -mcset nl "Scales" "Schaalverdelingen" -mcset nl "Horizontal scale" "Horizontale schaal" -mcset nl "Vertical scale" "Verticale schaal" +::msgcat::mcset nl "Scales" "Schaalverdelingen" +::msgcat::mcset nl "Horizontal scale" "Horizontale schaal" +::msgcat::mcset nl "Vertical scale" "Verticale schaal" -mcset nl "Paned Windows" "Vensters opgedeeld in stukken" -mcset nl "Horizontal paned window" "Horizontaal gedeeld venster" -mcset nl "Vertical paned window" "Verticaal gedeeld venster" +::msgcat::mcset nl "Paned Windows" "Vensters opgedeeld in stukken" +::msgcat::mcset nl "Horizontal paned window" "Horizontaal gedeeld venster" +::msgcat::mcset nl "Vertical paned window" "Verticaal gedeeld venster" -mcset nl "Menus" "Menu's" -mcset nl "Menus and cascades (sub-menus)" \ - "Menu's en cascades (submenu's)" -mcset nl "Menu-buttons" "Menu-buttons" +::msgcat::mcset nl "Menus" "Menu's" +::msgcat::mcset nl "Menus and cascades (sub-menus)" \ + "Menu's en cascades (submenu's)" +::msgcat::mcset nl "Menu-buttons" "Menu-buttons" -mcset nl "Common Dialogs" "Veel voorkomende dialoogvensters" -mcset nl "Message boxes" "Mededeling (message box)" -mcset nl "File selection dialog" "Selectie van bestanden" -mcset nl "Color picker" "Kleurenpalet" +::msgcat::mcset nl "Common Dialogs" "Veel voorkomende dialoogvensters" +::msgcat::mcset nl "Message boxes" "Mededeling (message box)" +::msgcat::mcset nl "File selection dialog" "Selectie van bestanden" +::msgcat::mcset nl "Color picker" "Kleurenpalet" -mcset nl "Miscellaneous" "Diversen" -mcset nl "The built-in bitmaps" "Ingebouwde plaatjes" -mcset nl "A dialog box with a local grab" \ - "Een dialoogvenster met een locale \"grab\"" -mcset nl "A dialog box with a global grab" \ - "Een dialoogvenster met een globale \"grab\"" +::msgcat::mcset nl "Miscellaneous" "Diversen" +::msgcat::mcset nl "The built-in bitmaps" "Ingebouwde plaatjes" +::msgcat::mcset nl "A dialog box with a local grab" \ + "Een dialoogvenster met een locale \"grab\"" +::msgcat::mcset nl "A dialog box with a global grab" \ + "Een dialoogvenster met een globale \"grab\"" diff --git a/library/tk.tcl b/library/tk.tcl index 9ee09fe..d170868 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.63.2.5 2007/11/21 16:46:27 dgp Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.63.2.6 2008/01/23 16:39:12 dgp Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -17,7 +17,7 @@ package require Tcl 8.5 ;# Guard against [source] in an 8.4- interp # Insist on running with compatible version of Tcl package require Tcl 8.5.0-8.6 # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.5.0 +package require -exact Tk 8.5.1b1 # Create a ::tk namespace namespace eval ::tk { diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 3ccb746..499a2e2 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -1,4 +1,4 @@ -# $Id: treeview.tcl,v 1.2 2006/12/18 19:33:14 jenglish Exp $ +# $Id: treeview.tcl,v 1.2.2.1 2008/01/23 16:39:12 dgp Exp $ # # ttk::treeview widget bindings and utilities. # @@ -56,13 +56,7 @@ bind Treeview <Shift-ButtonPress-1> \ bind Treeview <Control-ButtonPress-1> \ { ttk::treeview::Select %W %x %y toggle } -# Standard mousewheel bindings: -# -bind Treeview <MouseWheel> { %W yview scroll [expr {- (%D / 120) * 4}] units } -if {[string equal "x11" [tk windowingsystem]]} { - bind Treeview <ButtonPress-4> { %W yview scroll -5 units } - bind Treeview <ButtonPress-5> { %W yview scroll 5 units } -} +ttk::copyBindings TtkScrollable Treeview ### Binding procedures. # @@ -163,7 +157,7 @@ proc ttk::treeview::Select {w x y op} { } } -## DoubleClick -- Double-ButtonPress-1 binding. +## DoubleClick -- Double-ButtonPress-1 binding. # proc ttk::treeview::DoubleClick {w x y} { if {[set row [$w identify row $x $y]] ne ""} { @@ -261,7 +255,7 @@ proc ttk::treeview::heading.release {w} { # ## SelectOp $w $item [ choose | extend | toggle ] -- -# Dispatch to appropriate selection operation +# Dispatch to appropriate selection operation # depending on current value of -selectmode. # proc ttk::treeview::SelectOp {w item op} { @@ -282,10 +276,10 @@ proc ttk::treeview::select.extend.browse {w item} { BrowseTo $w $item } ## -selectmode multiple: # -proc ttk::treeview::select.choose.extended {w item} { +proc ttk::treeview::select.choose.extended {w item} { BrowseTo $w $item } -proc ttk::treeview::select.toggle.extended {w item} { +proc ttk::treeview::select.toggle.extended {w item} { $w selection toggle $item } proc ttk::treeview::select.extend.extended {w item} { @@ -304,7 +298,7 @@ proc ttk::treeview::select.extend.extended {w item} { # in preorder traversal order. $item1 and $item2 may be # in either order. # -# NOTES: +# NOTES: # This routine is O(N) in the size of the tree. # There's probably a way to do this that's O(N) in the number # of items returned, but I'm not clever enough to figure it out. diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl index 1ddda1a..1e566e8 100644 --- a/library/ttk/utils.tcl +++ b/library/ttk/utils.tcl @@ -1,5 +1,5 @@ # -# $Id: utils.tcl,v 1.3.2.1 2007/10/24 12:59:35 dgp Exp $ +# $Id: utils.tcl,v 1.3.2.2 2008/01/23 16:39:12 dgp Exp $ # # Utilities for widget implementations. # @@ -48,7 +48,7 @@ proc ttk::clickToFocus {w} { # # See also: tk::FocusOK # -# Note: This routine doesn't implement the same fallback heuristics +# Note: This routine doesn't implement the same fallback heuristics # as tk::FocusOK. # proc ttk::takesFocus {w} { @@ -78,8 +78,8 @@ proc ttk::takesFocus {w} { # proc ttk::focusFirst {w} { - if {[ttk::takesFocus $w]} { - return $w + if {[ttk::takesFocus $w]} { + return $w } foreach child [winfo children $w] { if {[set c [ttk::focusFirst $child]] ne ""} { @@ -239,7 +239,7 @@ proc ttk::CancelRepeat {} { after cancel $Repeat(timer) } -### Miscellaneous. +### Bindings. # ## ttk::copyBindings $from $to -- @@ -251,4 +251,56 @@ proc ttk::copyBindings {from to} { } } +## Standard mousewheel bindings. +# +# Usage: [ttk::copyBindings TtkScrollable $bindtag] +# adds mousewheel support to a scrollable widget. +# +# Platform inconsistencies: +# +# On X11, the server typically maps the mouse wheel to Button4 and Button5. +# +# On OSX, Tk generates sensible values for the %D field in <MouseWheel> events. +# +# On Windows, %D must be scaled by a factor of 120. +# In addition, Tk redirects mousewheel events to the window with +# keyboard focus instead of sending them to the window under the pointer. +# We do not attempt to fix that here, see also TIP#171. +# +# OSX conventionally uses Shift+MouseWheel for horizontal scrolling, +# and Option+MouseWheel for accelerated scrolling. +# +# The Shift+MouseWheel behavior is not conventional on Windows or most +# X11 toolkits, but it's useful. +# +# MouseWheel scrolling is accelerated on X11, which is conventional +# for Tk and appears to be conventional for other toolkits (although +# Gtk+ and Qt do not appear to use as large a factor). +# + +switch -- [tk windowingsystem] { + x11 { + bind TtkScrollable <ButtonPress-4> { %W yview scroll -5 units } + bind TtkScrollable <ButtonPress-5> { %W yview scroll 5 units } + bind TtkScrollable <Shift-ButtonPress-4> { %W xview scroll -5 units } + bind TtkScrollable <Shift-ButtonPress-5> { %W xview scroll 5 units } + } + win32 { + bind TtkScrollable <MouseWheel> \ + { %W yview scroll [expr {-(%D/120)}] units } + bind TtkScrollable <Shift-MouseWheel> \ + { %W xview scroll [expr {-(%D/120)}] units } + } + aqua { + bind TtkScrollable <MouseWheel> \ + { %W yview scroll [expr {-(%D)}] units } + bind TtkScrollable <Shift-MouseWheel> \ + { %W xview scroll [expr {-(%D)}] units } + bind TtkScrollable <Option-MouseWheel> \ + { %W yview scroll [expr {-10*(%D)}] units } + bind TtkScrollable <Shift-Option-MouseWheel> \ + { %W xview scroll [expr {-10*(%D)}] units } + } +} + #*EOF* diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 6e4d4ad..ea5bed6 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.1.4.5 2007/11/12 19:22:39 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.1.4.6 2008/01/23 16:39:12 dgp Exp $ */ #ifndef _TKMACPRIV @@ -36,6 +36,8 @@ #define kThemeBackgroundMetal 6 #define kThemeIncDecButtonSmall 21 #define kThemeIncDecButtonMini 22 + #define kThemeComboBox 16 + #define kThemeMiniSystemFont 109 #define kAppearancePartUpButton 20 #define kAppearancePartDownButton 21 #define kAppearancePartPageUpArea 22 diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index 2fdce0c..edff443 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -1,5 +1,5 @@ # -# $Id: treeview.test,v 1.2 2007/05/16 15:44:08 dgp Exp $ +# $Id: treeview.test,v 1.2.2.1 2008/01/23 16:39:12 dgp Exp $ # # [7Jun2005] TO CHECK: [$tv see {}] -- shouldn't work (at least, shouldn't do # what it currently does) @@ -9,8 +9,6 @@ package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands -testConstraint treeview [llength [info commands ttk::treeview]] - # consistencyCheck -- # Traverse the tree to make sure the item data structures # are properly linked. @@ -19,7 +17,6 @@ testConstraint treeview [llength [info commands ttk::treeview]] # follows ->prev links, this should cover all invariants. # proc consistencyCheck {tv {item {}}} { - if {![llength [info commands ttk::treeview]]} { return } set i 0; foreach child [$tv children $item] { assert {[$tv parent $child] == $item} "parent $child = $item" @@ -37,60 +34,60 @@ proc assert {expr {message ""}} { } } -test treeview-0 "treeview test - setup" -constraints treeview -body { +test treeview-0 "treeview test - setup" -body { ttk::treeview .tv -columns {a b c} pack .tv -expand true -fill both update } -test treeview-1.1 "columns" -constraints treeview -body { +test treeview-1.1 "columns" -body { .tv configure -columns {a b c} } -test treeview-1.2 "Bad columns" -constraints treeview -body { +test treeview-1.2 "Bad columns" -body { #.tv configure -columns {illegal "list"value} ttk::treeview .badtv -columns {illegal "list"value} } -returnCodes 1 -result "list element in quotes followed by*" -match glob -test treeview-1.3 "bad displaycolumns" -constraints treeview -body { +test treeview-1.3 "bad displaycolumns" -body { .tv configure -displaycolumns {a b d} } -returnCodes 1 -result "Invalid column index d" -test treeview-1.4 "more bad displaycolumns" -constraints treeview -body { +test treeview-1.4 "more bad displaycolumns" -body { .tv configure -displaycolumns {1 2 3} } -returnCodes 1 -result "Column index 3 out of bounds" -test treeview-1.5 "Don't forget to check negative numbers" -constraints treeview -body { +test treeview-1.5 "Don't forget to check negative numbers" -body { .tv configure -displaycolumns {1 -2 3} } -returnCodes 1 -result "Column index -2 out of bounds" # Item creation. # -test treeview-2.1 "insert -- not enough args" -constraints treeview -body { +test treeview-2.1 "insert -- not enough args" -body { .tv insert } -returnCodes 1 -result "wrong # args: *" -match glob -test treeview-2.3 "insert -- bad integer index" -constraints treeview -body { +test treeview-2.3 "insert -- bad integer index" -body { .tv insert {} badindex } -returnCodes 1 -result "expected integer *" -match glob -test treeview-2.4 "insert -- bad parent node" -constraints treeview -body { +test treeview-2.4 "insert -- bad parent node" -body { .tv insert badparent end } -returnCodes 1 -result "Item badparent not found" -match glob -test treeview-2.5 "insert -- finaly insert a node" -constraints treeview -body { +test treeview-2.5 "insert -- finaly insert a node" -body { .tv insert {} end -id newnode -text "New node" } -result newnode -test treeview-2.6 "insert -- make sure node was inserted" -constraints treeview -body { +test treeview-2.6 "insert -- make sure node was inserted" -body { .tv children {} } -result [list newnode] -test treeview-2.7 "insert -- prevent duplicate node names" -constraints treeview -body { +test treeview-2.7 "insert -- prevent duplicate node names" -body { .tv insert {} end -id newnode } -returnCodes 1 -result "Item newnode already exists" -test treeview-2.8 "insert -- new node at end" -constraints treeview -body { +test treeview-2.8 "insert -- new node at end" -body { .tv insert {} end -id lastnode consistencyCheck .tv .tv children {} @@ -98,52 +95,52 @@ test treeview-2.8 "insert -- new node at end" -constraints treeview -body { consistencyCheck .tv -test treeview-2.9 "insert -- new node at beginning" -constraints treeview -body { +test treeview-2.9 "insert -- new node at beginning" -body { .tv insert {} 0 -id firstnode consistencyCheck .tv .tv children {} } -result [list firstnode newnode lastnode] -test treeview-2.10 "insert -- one more node" -constraints treeview -body { +test treeview-2.10 "insert -- one more node" -body { .tv insert {} 2 -id onemore consistencyCheck .tv .tv children {} } -result [list firstnode newnode onemore lastnode] -test treeview-2.11 "insert -- and another one" -constraints treeview -body { +test treeview-2.11 "insert -- and another one" -body { .tv insert {} 2 -id anotherone consistencyCheck .tv .tv children {} } -result [list firstnode newnode anotherone onemore lastnode] -test treeview-2.12 "insert -- one more at end" -constraints treeview -body { +test treeview-2.12 "insert -- one more at end" -body { .tv insert {} end -id newlastone consistencyCheck .tv .tv children {} } -result [list firstnode newnode anotherone onemore lastnode newlastone] -test treeview-2.13 "insert -- one more at beginning" -constraints treeview -body { +test treeview-2.13 "insert -- one more at beginning" -body { .tv insert {} 0 -id newfirstone consistencyCheck .tv .tv children {} } -result [list newfirstone firstnode newnode anotherone onemore lastnode newlastone] -test treeview-2.14 "insert -- bad options" -constraints treeview -body { +test treeview-2.14 "insert -- bad options" -body { .tv insert {} end -badoption foo } -returnCodes 1 -result {unknown option "-badoption"} -test treeview-2.15 "insert -- at position 0 w/no children" -constraints treeview -body { +test treeview-2.15 "insert -- at position 0 w/no children" -body { .tv insert newnode 0 -id newnode.n2 -text "Foo" .tv children newnode } -result newnode.n2 ;# don't crash -test treeview-2.16 "insert -- insert way past end" -constraints treeview -body { +test treeview-2.16 "insert -- insert way past end" -body { .tv insert newnode 99 -id newnode.n3 -text "Foo" consistencyCheck .tv .tv children newnode } -result [list newnode.n2 newnode.n3] -test treeview-2.17 "insert -- insert before beginning" -constraints treeview -body { +test treeview-2.17 "insert -- insert before beginning" -body { .tv insert newnode -1 -id newnode.n1 -text "Foo" consistencyCheck .tv .tv children newnode @@ -151,19 +148,19 @@ test treeview-2.17 "insert -- insert before beginning" -constraints treeview -bo ### # -test treeview-3.1 "parent" -constraints treeview -body { +test treeview-3.1 "parent" -body { .tv parent newnode.n1 } -result newnode -test treeview-3.2 "parent - top-level node" -constraints treeview -body { +test treeview-3.2 "parent - top-level node" -body { .tv parent newnode } -result {} -test treeview-3.3 "parent - root node" -constraints treeview -body { +test treeview-3.3 "parent - root node" -body { .tv parent {} } -result {} -test treeview-3.4 "index" -constraints treeview -body { +test treeview-3.4 "index" -body { list [.tv index newnode.n3] [.tv index newnode.n2] [.tv index newnode.n1] } -result [list 2 1 0] -test treeview-3.5 "index - exhaustive test" -constraints treeview -body { +test treeview-3.5 "index - exhaustive test" -body { set result [list] foreach item [.tv children {}] { lappend result [.tv index $item] @@ -171,14 +168,14 @@ test treeview-3.5 "index - exhaustive test" -constraints treeview -body { set result } -result [list 0 1 2 3 4 5 6] -test treeview-3.6 "detach" -constraints treeview -body { +test treeview-3.6 "detach" -body { .tv detach newnode consistencyCheck .tv .tv children {} } -result [list newfirstone firstnode anotherone onemore lastnode newlastone] # XREF: treeview-2.13 -test treeview-3.7 "detach didn't screw up internal links" -constraints treeview -body { +test treeview-3.7 "detach didn't screw up internal links" -body { consistencyCheck .tv set result [list] foreach item [.tv children {}] { @@ -187,36 +184,36 @@ test treeview-3.7 "detach didn't screw up internal links" -constraints treeview set result } -result [list 0 1 2 3 4 5] -test treeview-3.8 "detached node has no parent, index 0" -constraints treeview -body { +test treeview-3.8 "detached node has no parent, index 0" -body { list [.tv parent newnode] [.tv index newnode] } -result [list {} 0] # @@@ Can't distinguish detached nodes from first root node -test treeview-3.9 "detached node's children undisturbed" -constraints treeview -body { +test treeview-3.9 "detached node's children undisturbed" -body { .tv children newnode } -result [list newnode.n1 newnode.n2 newnode.n3] -test treeview-3.10 "detach is idempotent" -constraints treeview -body { +test treeview-3.10 "detach is idempotent" -body { .tv detach newnode consistencyCheck .tv .tv children {} } -result [list newfirstone firstnode anotherone onemore lastnode newlastone] -test treeview-3.11 "Can't detach root item" -constraints treeview -body { +test treeview-3.11 "Can't detach root item" -body { .tv detach [list {}] update consistencyCheck .tv } -returnCodes 1 -result "Cannot detach root item" consistencyCheck .tv -test treeview-3.12 "Reattach" -constraints treeview -body { +test treeview-3.12 "Reattach" -body { .tv move newnode {} end consistencyCheck .tv .tv children {} } -result [list newfirstone firstnode anotherone onemore lastnode newlastone newnode] # Bug # ????? -test treeview-3.13 "Re-reattach" -constraints treeview -body { +test treeview-3.13 "Re-reattach" -body { .tv move newnode {} end consistencyCheck .tv .tv children {} @@ -228,88 +225,88 @@ catch { .tv insert newfirstone end -id x3 } -test treeview-3.14 "Duplicated entry in children list" -constraints treeview -body { +test treeview-3.14 "Duplicated entry in children list" -body { .tv children newfirstone [list x3 x1 x2 x3] # ??? Maybe this should raise an error? consistencyCheck .tv .tv children newfirstone } -result [list x3 x1 x2] -test treeview-3.14.1 "Duplicated entry in children list" -constraints treeview -body { +test treeview-3.14.1 "Duplicated entry in children list" -body { .tv children newfirstone [list x1 x2 x3 x3 x2 x1] consistencyCheck .tv .tv children newfirstone } -result [list x1 x2 x3] -test treeview-3.15 "Consecutive duplicate entries in children list" -constraints treeview -body { +test treeview-3.15 "Consecutive duplicate entries in children list" -body { .tv children newfirstone [list x1 x2 x2 x3] consistencyCheck .tv .tv children newfirstone } -result [list x1 x2 x3] -test treeview-3.16 "Insert child after self" -constraints treeview -body { +test treeview-3.16 "Insert child after self" -body { .tv move x2 newfirstone 1 consistencyCheck .tv .tv children newfirstone } -result [list x1 x2 x3] -test treeview-3.17 "Insert last child after self" -constraints treeview -body { +test treeview-3.17 "Insert last child after self" -body { .tv move x3 newfirstone 2 consistencyCheck .tv .tv children newfirstone } -result [list x1 x2 x3] -test treeview-3.18 "Insert last child after end" -constraints treeview -body { +test treeview-3.18 "Insert last child after end" -body { .tv move x3 newfirstone 3 consistencyCheck .tv .tv children newfirstone } -result [list x1 x2 x3] -test treeview-4.1 "opened - initial state" -constraints treeview -body { +test treeview-4.1 "opened - initial state" -body { .tv item newnode -open } -result 0 -test treeview-4.2 "opened - open node" -constraints treeview -body { +test treeview-4.2 "opened - open node" -body { .tv item newnode -open 1 .tv item newnode -open } -result 1 -test treeview-4.3 "opened - closed node" -constraints treeview -body { +test treeview-4.3 "opened - closed node" -body { .tv item newnode -open 0 .tv item newnode -open } -result 0 -test treeview-5.1 "item -- error checks" -constraints treeview -body { +test treeview-5.1 "item -- error checks" -body { .tv item newnode -text "Bad values" -values "{bad}list" } -returnCodes 1 -result "list element in braces followed by*" -match glob -test treeview-5.2 "item -- error leaves options unchanged " -constraints treeview -body { +test treeview-5.2 "item -- error leaves options unchanged " -body { .tv item newnode -text } -result "New node" -test treeview-5.3 "Heading" -constraints treeview -body { +test treeview-5.3 "Heading" -body { .tv heading #0 -text "Heading" } -test treeview-5.4 "get cell" -constraints treeview -body { +test treeview-5.4 "get cell" -body { set l [list a b c] .tv item newnode -values $l .tv set newnode 1 } -result b -test treeview-5.5 "set cell" -constraints treeview -body { +test treeview-5.5 "set cell" -body { .tv set newnode 1 XXX .tv item newnode -values } -result [list a XXX c] -test treeview-5.6 "set illegal cell" -constraints treeview -body { +test treeview-5.6 "set illegal cell" -body { .tv set newnode #0 YYY } -returnCodes 1 -result "Display column #0 cannot be set" -test treeview-5.7 "set illegal cell" -constraints treeview -body { +test treeview-5.7 "set illegal cell" -body { .tv set newnode 3 YY ;# 3 == current #columns } -returnCodes 1 -result "Column index 3 out of bounds" -test treeview-5.8 "set display columns" -constraints treeview -body { +test treeview-5.8 "set display columns" -body { .tv configure -displaycolumns [list 2 1 0] .tv set newnode #1 X .tv set newnode #2 Y @@ -317,23 +314,23 @@ test treeview-5.8 "set display columns" -constraints treeview -body { .tv item newnode -values } -result [list Z Y X] -test treeview-5.9 "display columns part 2" -constraints treeview -body { +test treeview-5.9 "display columns part 2" -body { list [.tv column #1 -id] [.tv column #2 -id] [.tv column #3 -id] } -result [list c b a] -test treeview-5.10 "cannot set column -id" -constraints treeview -body { +test treeview-5.10 "cannot set column -id" -body { .tv column #1 -id X } -returnCodes 1 -result "Attempt to change read-only option" -test treeview-5.11 "get" -constraints treeview -body { +test treeview-5.11 "get" -body { .tv set newnode #1 } -result X -test treeview-5.12 "get dictionary" -constraints treeview -body { +test treeview-5.12 "get dictionary" -body { .tv set newnode } -result [list a Z b Y c X] -test treeview-5.13 "get, no value" -constraints treeview -body { +test treeview-5.13 "get, no value" -body { set newitem [.tv insert {} end] set result [.tv set $newitem #1] .tv delete $newitem @@ -341,7 +338,7 @@ test treeview-5.13 "get, no value" -constraints treeview -body { } -result {} -test treeview-6.1 "deletion - setup" -constraints treeview -body { +test treeview-6.1 "deletion - setup" -body { .tv insert {} end -id dtest foreach id [list a b c d e] { .tv insert dtest end -id $id @@ -349,7 +346,7 @@ test treeview-6.1 "deletion - setup" -constraints treeview -body { .tv children dtest } -result [list a b c d e] -test treeview-6.1.1 "delete" -constraints treeview -body { +test treeview-6.1.1 "delete" -body { .tv delete b consistencyCheck .tv list [.tv exists b] [.tv children dtest] @@ -357,13 +354,13 @@ test treeview-6.1.1 "delete" -constraints treeview -body { consistencyCheck .tv -test treeview-6.2 "delete - duplicate items in list" -constraints treeview -body { +test treeview-6.2 "delete - duplicate items in list" -body { .tv delete [list a e a e] consistencyCheck .tv .tv children dtest } -result [list c d] -test treeview-6.3 "delete - descendants removed" -constraints treeview -body { +test treeview-6.3 "delete - descendants removed" -body { .tv insert c end -id c1 .tv insert c end -id c2 .tv insert c1 end -id c11 @@ -373,7 +370,7 @@ test treeview-6.3 "delete - descendants removed" -constraints treeview -body { list [.tv exists c] [.tv exists c1] [.tv exists c2] [.tv exists c11] } -result [list 0 0 0 0] -test treeview-6.4 "delete - delete parent and descendants" -constraints treeview -body { +test treeview-6.4 "delete - delete parent and descendants" -body { .tv insert dtest end -id c .tv insert c end -id c1 .tv insert c end -id c2 @@ -384,7 +381,7 @@ test treeview-6.4 "delete - delete parent and descendants" -constraints treeview list [.tv exists c] [.tv exists c1] [.tv exists c2] [.tv exists c11] } -result [list 0 0 0 0] -test treeview-6.5 "delete - delete descendants and parent" -constraints treeview -body { +test treeview-6.5 "delete - delete descendants and parent" -body { .tv insert dtest end -id c .tv insert c end -id c1 .tv insert c end -id c2 @@ -395,12 +392,12 @@ test treeview-6.5 "delete - delete descendants and parent" -constraints treeview list [.tv exists c] [.tv exists c1] [.tv exists c2] [.tv exists c11] } -result [list 0 0 0 0] -test treeview-6.6 "delete - end" -constraints treeview -body { +test treeview-6.6 "delete - end" -body { consistencyCheck .tv .tv children dtest } -result [list d] -test treeview-7.1 "move" -constraints treeview -body { +test treeview-7.1 "move" -body { .tv insert d end -id d1 .tv insert d end -id d2 .tv insert d end -id d3 @@ -409,59 +406,59 @@ test treeview-7.1 "move" -constraints treeview -body { .tv children d } -result [list d3 d1 d2] -test treeview-7.2 "illegal move" -constraints treeview -body { +test treeview-7.2 "illegal move" -body { .tv move d d2 end } -returnCodes 1 -result "Cannot insert d as a descendant of d2" -test treeview-7.3 "illegal move has no effect" -constraints treeview -body { +test treeview-7.3 "illegal move has no effect" -body { consistencyCheck .tv .tv children d } -result [list d3 d1 d2] -test treeview-7.4 "Replace children" -constraints treeview -body { +test treeview-7.4 "Replace children" -body { .tv children d [list d3 d2 d1] consistencyCheck .tv .tv children d } -result [list d3 d2 d1] -test treeview-7.5 "replace children - precondition" -constraints treeview -body { +test treeview-7.5 "replace children - precondition" -body { # Just check to make sure the test suite so far has left # us in the state we expect to be in: list [.tv parent newnode] [.tv children newnode] } -result [list {} [list newnode.n1 newnode.n2 newnode.n3]] -test treeview-7.6 "Replace children - illegal move" -constraints treeview -body { +test treeview-7.6 "Replace children - illegal move" -body { .tv children newnode.n1 [list newnode.n1 newnode.n2 newnode.n3] } -returnCodes 1 -result "Cannot insert newnode.n1 as a descendant of newnode.n1" consistencyCheck .tv -test treeview-8.0 "Selection set" -constraints treeview -body { +test treeview-8.0 "Selection set" -body { .tv selection set [list newnode.n1 newnode.n3 newnode.n2] .tv selection } -result [list newnode.n1 newnode.n2 newnode.n3] -test treeview-8.1 "Selection add" -constraints treeview -body { +test treeview-8.1 "Selection add" -body { .tv selection add [list newnode] .tv selection } -result [list newnode newnode.n1 newnode.n2 newnode.n3] -test treeview-8.2 "Selection toggle" -constraints treeview -body { +test treeview-8.2 "Selection toggle" -body { .tv selection toggle [list newnode.n2 d3] .tv selection } -result [list newnode newnode.n1 newnode.n3 d3] -test treeview-8.3 "Selection remove" -constraints treeview -body { +test treeview-8.3 "Selection remove" -body { .tv selection remove [list newnode.n2 d3] .tv selection } -result [list newnode newnode.n1 newnode.n3] -test treeview-8.4 "Selection - clear" -constraints treeview -body { +test treeview-8.4 "Selection - clear" -body { .tv selection set {} .tv selection } -result {} -test treeview-8.5 "Selection - bad operation" -constraints treeview -body { +test treeview-8.5 "Selection - bad operation" -body { .tv selection badop foo } -returnCodes 1 -match glob -result {bad selection operation "badop": must be *} @@ -470,7 +467,7 @@ test treeview-8.5 "Selection - bad operation" -constraints treeview -body { proc scrollcallback {args} { set ::scrolldata $args } -test treeview-9.0 "scroll callback - empty tree" -constraints treeview -body { +test treeview-9.0 "scroll callback - empty tree" -body { .tv configure -yscrollcommand scrollcallback .tv delete [.tv children {}] update @@ -489,6 +486,6 @@ test treeview-10.1 "Root node properly initialized (#1541739)" -setup { .tv see a } -cleanup { destroy .tv -} -constraints treeview +} tcltest::cleanupTests diff --git a/unix/configure b/unix/configure index bbe6c9e..f5fcfd3 100755 --- a/unix/configure +++ b/unix/configure @@ -1337,9 +1337,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".0" +TK_PATCH_LEVEL=".1b1" VERSION=${TK_VERSION} -LOCALES="cs de el en en_gb eo es fr hu it nl pl pt ru sv" +LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" #-------------------------------------------------------------------- # Find and load the tclConfig.sh file diff --git a/unix/configure.in b/unix/configure.in index c517c81..4277e8d 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.134.2.10 2007/12/05 18:11:41 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.134.2.11 2008/01/23 16:39:13 dgp Exp $ AC_INIT([tk],[8.5]) AC_PREREQ(2.59) @@ -27,7 +27,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".0" +TK_PATCH_LEVEL=".1b1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/tk.spec b/unix/tk.spec index a393410..da8e153 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -1,11 +1,11 @@ -# $Id: tk.spec,v 1.25.2.4 2007/11/21 16:46:30 dgp Exp $ +# $Id: tk.spec,v 1.25.2.5 2008/01/23 16:39:13 dgp Exp $ # This file is the basis for a binary Tk Linux RPM. %{!?directory:%define directory /usr/local} Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.5.0 +Version: 8.5.1b1 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index c742249..65cc5bf 100755 --- a/win/configure +++ b/win/configure @@ -1309,7 +1309,7 @@ SHELL=/bin/sh TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".0" +TK_PATCH_LEVEL=".1b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/configure.in b/win/configure.in index 260f4ba..a4efd5b 100644 --- a/win/configure.in +++ b/win/configure.in @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.66.2.6 2007/12/10 18:39:32 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.66.2.7 2008/01/23 16:39:14 dgp Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.59) @@ -16,7 +16,7 @@ SHELL=/bin/sh TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".0" +TK_PATCH_LEVEL=".1b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/makefile.vc b/win/makefile.vc index 3b7e2a2..644295b 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -12,7 +12,7 @@ # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.103.2.7 2007/11/28 20:33:16 dgp Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.103.2.8 2008/01/23 16:39:14 dgp Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -505,8 +505,10 @@ baselibs = kernel32.lib user32.lib # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +!if $(VCVERSION) > 1399 && $(VCVERSION) < 1500 baselibs = $(baselibs) bufferoverflowU.lib !endif +!endif guilibs = $(baselibs) gdi32.lib diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 20e10a4..8c1e135 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -11,7 +11,7 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * ---------------------------------------------------------------------------- - * RCS: @(#) $Id: nmakehlp.c,v 1.8.2.1 2007/10/15 18:38:41 dgp Exp $ + * RCS: @(#) $Id: nmakehlp.c,v 1.8.2.2 2008/01/23 16:39:14 dgp Exp $ * ---------------------------------------------------------------------------- */ @@ -21,9 +21,15 @@ #pragma comment (lib, "kernel32.lib") #include <stdio.h> #include <math.h> + +/* + * This library is required for x64 builds with _some_ versions + */ #if defined(_M_IA64) || defined(_M_AMD64) +#if _MSC_FULL_VER > 140000000 && _MSC_FULL_VER <= 140040310 #pragma comment(lib, "bufferoverflowU") #endif +#endif /* ISO hack for dumb VC++ */ #ifdef _MSC_VER diff --git a/win/tkWinButton.c b/win/tkWinButton.c index b10d31c..669b3d4 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinButton.c,v 1.31.2.1 2007/12/05 20:26:46 dgp Exp $ + * RCS: @(#) $Id: tkWinButton.c,v 1.31.2.2 2008/01/23 16:39:14 dgp Exp $ */ #define OEMRESOURCE @@ -275,7 +275,7 @@ CreateProc( SetWindowPos(butPtr->hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); butPtr->oldProc = (WNDPROC)SetWindowLongPtr(butPtr->hwnd, GWLP_WNDPROC, - (LONG_PTR) ButtonProc); + (INT_PTR) ButtonProc); window = Tk_AttachHWND(tkwin, butPtr->hwnd); return window; @@ -305,7 +305,7 @@ TkpDestroyButton( HWND hwnd = winButPtr->hwnd; if (hwnd) { - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winButPtr->oldProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) winButPtr->oldProc); } } diff --git a/win/tkWinInt.h b/win/tkWinInt.h index d890cd5..4a455ac 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinInt.h,v 1.28.2.1 2007/12/05 20:26:47 dgp Exp $ + * RCS: @(#) $Id: tkWinInt.h,v 1.28.2.2 2008/01/23 16:39:14 dgp Exp $ */ #ifndef _TKWININT @@ -248,4 +248,51 @@ long TkpWinToplevelOverrideRedirect(TkWindow *winPtr, void TkpWinToplevelDetachWindow(TkWindow *winPtr); int TkpWmGetState(TkWindow *winPtr); +/* + * The following functions are not present in old versions of Windows + * API headers but are used in the Tk source to ensure 64bit + * compatability. + */ + +#ifndef GetClassLongPtr +# define GetClassLongPtrA GetClassLongA +# define GetClassLongPtrW GetClassLongW +# define SetClassLongPtrA SetClassLongA +# define SetClassLongPtrW SetClassLongW +# ifdef UNICODE +# define GetClassLongPtr GetClassLongPtrW +# define SetClassLongPtr SetClassLongPtrW +# else +# define GetClassLongPtr GetClassLongPtrA +# define SetClassLongPtr SetClassLongPtrA +# endif /* !UNICODE */ +#endif /* !GetClassLongPtr */ +#ifndef GCLP_HICON +# define GCLP_HICON GCL_HICON +#endif /* !GCLP_HICON */ +#ifndef GCLP_HICONSM +# define GCLP_HICONSM (-34) +#endif /* !GCLP_HICONSM */ + +#ifndef GetWindowLongPtr +# define GetWindowLongPtrA GetWindowLongA +# define GetWindowLongPtrW GetWindowLongW +# define SetWindowLongPtrA SetWindowLongA +# define SetWindowLongPtrW SetWindowLongW +# ifdef UNICODE +# define GetWindowLongPtr GetWindowLongPtrW +# define SetWindowLongPtr SetWindowLongPtrW +# else +# define GetWindowLongPtr GetWindowLongPtrW +# define SetWindowLongPtr SetWindowLongPtrW +# endif /* !UNICODE */ +#endif /* !GetWindowLongPtr */ +#ifndef GWLP_WNDPROC +#define GWLP_WNDPROC GWL_WNDPROC +#define GWLP_HINSTANCE GWL_HINSTANCE +#define GWLP_HWNDPARENT GWL_HWNDPARENT +#define GWLP_USERDATA GWL_USERDATA +#define GWLP_ID GWL_ID +#endif /* !GWLP_WNDPROC */ + #endif /* _TKWININT */ diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 6278ebc..a0bac41 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinScrlbr.c,v 1.12.2.1 2007/12/05 20:26:47 dgp Exp $ + * RCS: @(#) $Id: tkWinScrlbr.c,v 1.12.2.2 2008/01/23 16:39:14 dgp Exp $ */ #include "tkWinInt.h" @@ -256,7 +256,7 @@ CreateProc( scrollPtr->lastVertical = scrollPtr->info.vertical; scrollPtr->oldProc = (WNDPROC)SetWindowLongPtr(scrollPtr->hwnd, - GWLP_WNDPROC, (LONG_PTR) ScrollbarProc); + GWLP_WNDPROC, (INT_PTR) ScrollbarProc); window = Tk_AttachHWND(tkwin, scrollPtr->hwnd); UpdateScrollbar(scrollPtr); @@ -301,7 +301,7 @@ TkpDisplayScrollbar( if (scrollPtr->lastVertical != scrollPtr->info.vertical) { HWND hwnd = Tk_GetHWND(Tk_WindowId(tkwin)); - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) scrollPtr->oldProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) scrollPtr->oldProc); DestroyWindow(hwnd); CreateProc(tkwin, Tk_WindowId(Tk_Parent(tkwin)), @@ -335,7 +335,7 @@ TkpDestroyScrollbar( HWND hwnd = winScrollPtr->hwnd; if (hwnd) { - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winScrollPtr->oldProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) winScrollPtr->oldProc); if (winScrollPtr->winFlags & IN_MODAL_LOOP) { ((TkWindow *)scrollPtr->tkwin)->flags |= TK_DONT_DESTROY_WINDOW; SetParent(hwnd, NULL); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index aaf6b8a..e243928 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.116.2.5 2007/12/10 18:39:32 dgp Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.116.2.6 2008/01/23 16:39:14 dgp Exp $ */ #include "tkWinInt.h" @@ -563,30 +563,6 @@ static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr); */ #define WIDTHBYTES(bits) ((((bits) + 31)>>5)<<2) - -/* - * Hacks to make this file build with older versions of the SDK. - */ - -#ifndef GetClassLongPtr -# define GetClassLongPtrA GetClassLongA -# define GetClassLongPtrW GetClassLongW -# define SetClassLongPtrA SetClassLongA -# define SetClassLongPtrW SetClassLongW -# ifdef UNICODE -# define GetClassLongPtr GetClassLongPtrW -# define SetClassLongPtr SetClassLongPtrW -# else -# define GetClassLongPtr GetClassLongPtrA -# define SetClassLongPtr SetClassLongPtrA -# endif /* !UNICODE */ -#endif /* !GetClassLongPtr */ -#ifndef GCLP_HICON -# define GCLP_HICON GCL_HICON -#endif /* !GCLP_HICON */ -#ifndef GCLP_HICONSM -# define GCLP_HICONSM (-34) -#endif /* !GCLP_HICONSM */ /* *---------------------------------------------------------------------- @@ -2220,7 +2196,7 @@ UpdateWrapper( parentHWND, NULL, Tk_GetHINSTANCE(), NULL); Tcl_DStringFree(&classString); Tcl_DStringFree(&titleString); - SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (LONG_PTR) winPtr); + SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (INT_PTR) winPtr); tsdPtr->createWindow = NULL; if ((wmPtr->exStyleConfig & WS_EX_LAYERED) @@ -2274,7 +2250,7 @@ UpdateWrapper( WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); if (winPtr->flags & TK_EMBEDDED) { - SetWindowLongPtr(child, GWLP_WNDPROC, (LONG_PTR) TopLevelProc); + SetWindowLongPtr(child, GWLP_WNDPROC, (INT_PTR) TopLevelProc); } SetParent(child, wmPtr->wrapper); diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 5fec125..9ec221b 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -1,6 +1,6 @@ /* winTheme.c - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net> * - * $Id: ttkWinTheme.c,v 1.5.2.6 2007/12/10 18:39:33 dgp Exp $ + * $Id: ttkWinTheme.c,v 1.5.2.7 2008/01/23 16:39:14 dgp Exp $ */ #ifdef _MSC_VER @@ -52,28 +52,39 @@ static unsigned int ReliefToEdge(int relief) } } -/* ---------------------------------------------------------------------- */ +/*------------------------------------------------------------------------ + * +++ State tables for FrameControlElements. + */ + +static Ttk_StateTable checkbutton_statemap[] = { /* see also SF#1865898 */ + { DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_INACTIVE, + TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0 }, + { DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_PUSHED, + TTK_STATE_ALTERNATE|TTK_STATE_PRESSED, 0 }, + { DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_HOT, + TTK_STATE_ALTERNATE|TTK_STATE_ACTIVE, 0 }, + { DFCS_BUTTON3STATE|DFCS_CHECKED, + TTK_STATE_ALTERNATE, 0 }, -static Ttk_StateTable checkbutton_statemap[] = -{ { DFCS_CHECKED|DFCS_INACTIVE, TTK_STATE_SELECTED|TTK_STATE_DISABLED, 0 }, { DFCS_CHECKED|DFCS_PUSHED, TTK_STATE_SELECTED|TTK_STATE_PRESSED, 0 }, + { DFCS_CHECKED|DFCS_HOT, TTK_STATE_SELECTED|TTK_STATE_ACTIVE, 0 }, { DFCS_CHECKED, TTK_STATE_SELECTED, 0 }, - { DFCS_INACTIVE, TTK_STATE_DISABLED, TTK_STATE_SELECTED }, - { DFCS_PUSHED, TTK_STATE_PRESSED, TTK_STATE_SELECTED}, - { 0, 0, 0 } + + { DFCS_INACTIVE, TTK_STATE_DISABLED, 0 }, + { DFCS_PUSHED, TTK_STATE_PRESSED, 0 }, + { DFCS_HOT, TTK_STATE_ACTIVE, 0 }, + { 0, 0, 0 }, }; -static Ttk_StateTable pushbutton_statemap[] = -{ +static Ttk_StateTable pushbutton_statemap[] = { { DFCS_INACTIVE, TTK_STATE_DISABLED, 0 }, { DFCS_PUSHED, TTK_STATE_PRESSED, 0 }, { DFCS_HOT, TTK_STATE_ACTIVE, 0 }, { 0, 0, 0 } }; -static Ttk_StateTable arrow_statemap[] = -{ +static Ttk_StateTable arrow_statemap[] = { { DFCS_INACTIVE, TTK_STATE_DISABLED, 0 }, { DFCS_PUSHED | DFCS_FLAT, TTK_STATE_PRESSED, 0 }, { 0, 0, 0 } @@ -83,24 +94,27 @@ static Ttk_StateTable arrow_statemap[] = * +++ FrameControlElement -- * General-purpose element for things drawn with DrawFrameControl */ -typedef struct -{ +typedef struct { const char *name; /* element name */ int classId; /* class id for DrawFrameControl */ int partId; /* part id for DrawFrameControl */ - int cxId; /* system metric id for size in x */ - int cyId; /* system metric id for size in y */ + int cxId; /* system metric ids for width/height... */ + int cyId; /* ... or size if FIXEDSIZE bit set */ Ttk_StateTable *stateMap; /* map Tk states to Win32 flags */ Ttk_Padding margins; /* additional placement padding */ } FrameControlElementData; -static FrameControlElementData FrameControlElements[] = -{ +#define _FIXEDSIZE 0x8000 +#define FIXEDSIZE(id) (id|_FIXEDSIZE) +#define GETMETRIC(m) \ + ((m) & _FIXEDSIZE ? (m) & ~_FIXEDSIZE : GetSystemMetrics(m)) + +static FrameControlElementData FrameControlElements[] = { { "Checkbutton.indicator", - DFC_BUTTON, DFCS_BUTTONCHECK, SM_CYMENUCHECK, SM_CYMENUCHECK, + DFC_BUTTON, DFCS_BUTTONCHECK, FIXEDSIZE(13), FIXEDSIZE(13), checkbutton_statemap, {0,0,4,0} }, { "Radiobutton.indicator", - DFC_BUTTON, DFCS_BUTTONRADIO, SM_CYMENUCHECK, SM_CYMENUCHECK, + DFC_BUTTON, DFCS_BUTTONRADIO, FIXEDSIZE(13), FIXEDSIZE(13), checkbutton_statemap, {0,0,4,0} }, { "uparrow", DFC_SCROLL, DFCS_SCROLLUP, SM_CXVSCROLL, SM_CYVSCROLL, @@ -128,8 +142,8 @@ static void FrameControlElementSize( int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { FrameControlElementData *p = clientData; - *widthPtr = GetSystemMetrics(p->cxId) + Ttk_PaddingWidth(p->margins); - *heightPtr = GetSystemMetrics(p->cyId) + Ttk_PaddingHeight(p->margins); + *widthPtr = GETMETRIC(p->cxId) + Ttk_PaddingWidth(p->margins); + *heightPtr = GETMETRIC(p->cyId) + Ttk_PaddingHeight(p->margins); } static void FrameControlElementDraw( @@ -137,7 +151,7 @@ static void FrameControlElementDraw( Drawable d, Ttk_Box b, unsigned int state) { FrameControlElementData *elementData = clientData; - RECT rc = BoxToRect(b); + RECT rc = BoxToRect(Ttk_PadBox(b, elementData->margins)); TkWinDCState dcState; HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState); @@ -147,8 +161,7 @@ static void FrameControlElementDraw( TkWinReleaseDrawableDC(d, hdc, &dcState); } -static Ttk_ElementSpec FrameControlElementSpec = -{ +static Ttk_ElementSpec FrameControlElementSpec = { TK_STYLE_VERSION_2, sizeof(NullElement), TtkNullElementOptions, @@ -197,8 +210,7 @@ static void BorderElementDraw( } } -static Ttk_ElementSpec BorderElementSpec = -{ +static Ttk_ElementSpec BorderElementSpec = { TK_STYLE_VERSION_2, sizeof(BorderElement), BorderElementOptions, @@ -211,13 +223,11 @@ static Ttk_ElementSpec BorderElementSpec = * Sunken border; also fill with window color. */ -typedef struct -{ +typedef struct { Tcl_Obj *backgroundObj; } FieldElement; -static Ttk_ElementOptionSpec FieldElementOptions[] = -{ +static Ttk_ElementOptionSpec FieldElementOptions[] = { { "-fieldbackground", TK_OPTION_BORDER, Tk_Offset(FieldElement,backgroundObj), "white" }, {NULL} @@ -249,8 +259,7 @@ static void FieldElementDraw( TkWinReleaseDrawableDC(d, hdc, &dcState); } -static Ttk_ElementSpec FieldElementSpec = -{ +static Ttk_ElementSpec FieldElementSpec = { TK_STYLE_VERSION_2, sizeof(FieldElement), FieldElementOptions, @@ -348,8 +357,7 @@ static void ButtonBorderElementDraw( TkWinReleaseDrawableDC(d, hdc, &dcState); } -static Ttk_ElementSpec ButtonBorderElementSpec = -{ +static Ttk_ElementSpec ButtonBorderElementSpec = { TK_STYLE_VERSION_2, sizeof(ButtonBorderElement), ButtonBorderElementOptions, @@ -382,8 +390,7 @@ static void FocusElementDraw( } } -static Ttk_ElementSpec FocusElementSpec = -{ +static Ttk_ElementSpec FocusElementSpec = { TK_STYLE_VERSION_2, sizeof(NullElement), TtkNullElementOptions, @@ -438,8 +445,7 @@ static void ComboboxFocusElementDraw( } } -static Ttk_ElementSpec ComboboxFocusElementSpec = -{ +static Ttk_ElementSpec ComboboxFocusElementSpec = { TK_STYLE_VERSION_2, sizeof(FillFocusElement), FillFocusElementOptions, @@ -509,8 +515,7 @@ static void TroughElementDraw( TkWinReleaseDrawableDC(d, hdc, &dcState); } -static Ttk_ElementSpec TroughElementSpec = -{ +static Ttk_ElementSpec TroughElementSpec = { TK_STYLE_VERSION_2, sizeof(NullElement), TtkNullElementOptions, @@ -522,13 +527,11 @@ static Ttk_ElementSpec TroughElementSpec = * +++ Thumb element. */ -typedef struct -{ +typedef struct { Tcl_Obj *orientObj; } ThumbElement; -static Ttk_ElementOptionSpec ThumbElementOptions[] = -{ +static Ttk_ElementOptionSpec ThumbElementOptions[] = { { "-orient", TK_OPTION_ANY,Tk_Offset(ThumbElement,orientObj),"horizontal"}, { NULL } }; @@ -567,8 +570,7 @@ static void ThumbElementDraw( TkWinReleaseDrawableDC(d, hdc, &dcState); } -static Ttk_ElementSpec ThumbElementSpec = -{ +static Ttk_ElementSpec ThumbElementSpec = { TK_STYLE_VERSION_2, sizeof(ThumbElement), ThumbElementOptions, @@ -581,13 +583,11 @@ static Ttk_ElementSpec ThumbElementSpec = * Windows likes to call this a trackbar. */ -typedef struct -{ +typedef struct { Tcl_Obj *orientObj; /* orientation of the slider widget */ } SliderElement; -static Ttk_ElementOptionSpec SliderElementOptions[] = -{ +static Ttk_ElementOptionSpec SliderElementOptions[] = { { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), "horizontal" }, { NULL } @@ -623,8 +623,7 @@ static void SliderElementDraw( TkWinReleaseDrawableDC(d, hdc, &dcState); } -static Ttk_ElementSpec SliderElementSpec = -{ +static Ttk_ElementSpec SliderElementSpec = { TK_STYLE_VERSION_2, sizeof(SliderElement), SliderElementOptions, @@ -655,8 +654,7 @@ static void ClientElementDraw( TkWinReleaseDrawableDC(d, hdc, &dcState); } -static Ttk_ElementSpec ClientElementSpec = -{ +static Ttk_ElementSpec ClientElementSpec = { TK_STYLE_VERSION_2, sizeof(NullElement), TtkNullElementOptions, @@ -722,3 +720,4 @@ int TtkWinTheme_Init(Tcl_Interp *interp, HWND hwnd) Tcl_PkgProvide(interp, "ttk::theme::winnative", TTK_VERSION); return TCL_OK; } + |