diff options
author | hobbs <hobbs> | 2010-08-26 02:06:08 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2010-08-26 02:06:08 (GMT) |
commit | b29adcfbfc2e03e058536524f1aa3378b948e7ed (patch) | |
tree | fa90e1e6d32590addfbb0a1599a40b1f7f99ea3b /generic/ttk/ttkSquare.c | |
parent | 7dec1714e5d5efd6b7d095657c1434fa68af0f87 (diff) | |
download | tk-b29adcfbfc2e03e058536524f1aa3378b948e7ed.zip tk-b29adcfbfc2e03e058536524f1aa3378b948e7ed.tar.gz tk-b29adcfbfc2e03e058536524f1aa3378b948e7ed.tar.bz2 |
Major backport of 8.6 Ttk for 8.5.9. Most changes were only being
committed to head (8.6), although they could apply for 8.5 as well.
This re-sync makes future work easier to maintain and adds some
useful work for 8.5 users. Notable changes:
- Lots of code cleanup
- Some bug fixes never backported
- Addition of ttk::spinbox
- minor color changes
- Improved Vista/7 styling
- Move to tile version 0.8.6 (pseudo-package)
- ABI and API compatible (even $w identify)
- minor new features (extended $w identify)
Diffstat (limited to 'generic/ttk/ttkSquare.c')
-rw-r--r-- | generic/ttk/ttkSquare.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index b5ff73b..d2f4540 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -2,14 +2,14 @@ * * Minimal sample ttk widget. * - * $Id: ttkSquare.c,v 1.6 2007/12/13 15:26:26 dgp Exp $ + * $Id: ttkSquare.c,v 1.6.2.1 2010/08/26 02:06:09 hobbs Exp $ */ #include <tk.h> #include "ttkTheme.h" #include "ttkWidget.h" -#ifdef TTK_SQUARE_WIDGET +#if defined(TTK_SQUARE_WIDGET) || 1 #ifndef DEFAULT_BORDERWIDTH #define DEFAULT_BORDERWIDTH "2" @@ -100,9 +100,9 @@ SquareDoLayout(void *clientData) { WidgetCore *corePtr = (WidgetCore *)clientData; Ttk_Box winBox; - Ttk_LayoutNode *squareNode; + Ttk_Element squareNode; - squareNode = Ttk_LayoutFindNode(corePtr->layout, "square"); + squareNode = Ttk_FindElement(corePtr->layout, "square"); winBox = Ttk_WinBox(corePtr->tkwin); Ttk_PlaceLayout(corePtr->layout, corePtr->state, winBox); @@ -116,12 +116,12 @@ SquareDoLayout(void *clientData) Tk_Anchor anchor = TK_ANCHOR_CENTER; Ttk_Box b; - b = Ttk_LayoutNodeParcel(squareNode); + b = Ttk_ElementParcel(squareNode); if (squarePtr->square.anchorObj != NULL) Tk_GetAnchorFromObj(NULL, squarePtr->square.anchorObj, &anchor); b = Ttk_AnchorBox(winBox, b.width, b.height, anchor); - Ttk_PlaceLayoutNode(corePtr->layout, squareNode, b); + Ttk_PlaceElement(corePtr->layout, squareNode, b); } } @@ -131,14 +131,13 @@ SquareDoLayout(void *clientData) * that are sufficient for our needs. */ -static WidgetCommandSpec SquareCommands[] = -{ - { "configure", TtkWidgetConfigureCommand }, - { "cget", TtkWidgetCgetCommand }, - { "identify", TtkWidgetIdentifyCommand }, - { "instate", TtkWidgetInstateCommand }, - { "state", TtkWidgetStateCommand }, - { NULL, NULL } +static const Ttk_Ensemble SquareCommands[] = { + { "configure", TtkWidgetConfigureCommand,0 }, + { "cget", TtkWidgetCgetCommand,0 }, + { "identify", TtkWidgetIdentifyCommand,0 }, + { "instate", TtkWidgetInstateCommand,0 }, + { "state", TtkWidgetStateCommand,0 }, + { 0,0,0 } }; /* @@ -192,7 +191,7 @@ static Ttk_ElementOptionSpec SquareElementOptions[] = "raised" }, { "-width", TK_OPTION_PIXELS, Tk_Offset(SquareElement,widthObj), "20"}, { "-height", TK_OPTION_PIXELS, Tk_Offset(SquareElement,heightObj), "20"}, - { NULL } + { NULL, 0, 0, NULL } }; /* |