diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-09-30 09:15:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-09-30 09:15:44 (GMT) |
commit | cf0b763ae6169a3440a7be0f9aa2b756955b6eb4 (patch) | |
tree | 2af4e7f9eab89ed7a6836d20e7b0dd64b02be000 | |
parent | 310e0cb8c6d028661e1b9b3cc7644386d0f6e25d (diff) | |
download | tk-cf0b763ae6169a3440a7be0f9aa2b756955b6eb4.zip tk-cf0b763ae6169a3440a7be0f9aa2b756955b6eb4.tar.gz tk-cf0b763ae6169a3440a7be0f9aa2b756955b6eb4.tar.bz2 |
Bring panedwindow proxy behavior in line with TIP #437 description.
-rw-r--r-- | doc/panedwindow.n | 11 | ||||
-rw-r--r-- | generic/tkPanedWindow.c | 23 | ||||
-rw-r--r-- | tests/panedwindow.test | 2 | ||||
-rw-r--r-- | unix/tkUnixDefault.h | 35 | ||||
-rw-r--r-- | win/tkWinDefault.h | 35 |
5 files changed, 53 insertions, 53 deletions
diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 6263d05..9ee79ec 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -30,13 +30,16 @@ Specifies a desired height for the overall panedwindow widget. May be any value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height. .OP \-proxybackground proxyBackground ProxyBackground -Background color to use when drawing the proxy. +Background color to use when drawing the proxy. If an empty string, the +value of the \fB-background\fR option will be used. .OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth -Specifies the width of the proxy. May be any value accepted by -\fBTk_GetPixels\fR. +Specifies the borderwidth of the proxy. May be any value accepted by +\fBTk_GetPixels\fR. If an empty string, the +value of the \fB-borderwidth\fR option will be used. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk -relief values. +relief values. If an empty string, the value of the \fB-relief\fR +option will be used. .OP \-opaqueresize opaqueResize OpaqueResize Specifies whether panes should be resized as a sash is moved (true), or if resizing should be deferred until the sash is placed (false). diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 7919728..8699ac3 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -147,9 +147,10 @@ typedef struct PanedWindow { GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ int proxyx, proxyy; /* Proxy x,y coordinates. */ - Tk_3DBorder proxyBackground;/* Background color used to draw proxy. */ + Tk_3DBorder proxyBackground;/* Background color used to draw proxy. If NULL, use background. */ + Tcl_Obj *proxyBorderWidthPtr; /* Tcl_Obj rep for proxyBorderWidth, if NULL then use borderWitdh */ int proxyBorderWidth; /* Borderwidth used to draw proxy. */ - int proxyRelief; /* Relief used to draw proxy. */ + int proxyRelief; /* Relief used to draw proxy, if TK_RELIEF_NULL then use relief. */ Slave **slaves; /* Pointer to array of Slaves. */ int numSlaves; /* Number of slaves. */ int sizeofSlaves; /* Number of elements in the slaves array. */ @@ -302,14 +303,14 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), 0, (ClientData) orientStrings, GEOMETRY}, {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", - DEF_PANEDWINDOW_PROXYBACKGROUND, -1, Tk_Offset(PanedWindow, proxyBackground), 0, + 0, -1, Tk_Offset(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, (ClientData) DEF_PANEDWINDOW_BG_MONO}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", - DEF_PANEDWINDOW_PROXYBORDERWIDTH, -1, Tk_Offset(PanedWindow, proxyBorderWidth), - 0, 0, GEOMETRY}, + 0, Tk_Offset(PanedWindow, proxyBorderWidthPtr), Tk_Offset(PanedWindow, proxyBorderWidth), + TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", - DEF_PANEDWINDOW_PROXYRELIEF, -1, Tk_Offset(PanedWindow, proxyRelief), - 0, 0, 0}, + 0, -1, Tk_Offset(PanedWindow, proxyRelief), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", @@ -2781,9 +2782,11 @@ DisplayProxyWindow( * Redraw the widget's background and border. */ - Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), pwPtr->proxyBorderWidth, - pwPtr->proxyRelief); + Tk_Fill3DRectangle(tkwin, pixmap, + pwPtr->proxyBackground ? pwPtr->proxyBackground : pwPtr->background, + 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), + pwPtr->proxyBorderWidthPtr ? pwPtr->proxyBorderWidth : pwPtr->borderWidth, + (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->relief); #ifndef TK_NO_DOUBLE_BUFFERING /* diff --git a/tests/panedwindow.test b/tests/panedwindow.test index d088cfe..b075e18 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -32,7 +32,7 @@ foreach {testName testData} { panedwindow-1.9 {-proxybackground "#f0a0a0" "#f0a0a0" non-existent {unknown color name "non-existent"}} panedwindow-1.10 {-proxyborderwidth - 1.3 1 badValue {bad screen distance "badValue"}} + 1.3 1.3 badValue {bad screen distance "badValue"}} panedwindow-1.11 {-proxyrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index e5b2598..4eb8778 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -358,25 +358,22 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 8cceb2e..a1a76c7 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -361,25 +361,22 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes |