summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkScrollbar.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2010-08-26 02:06:08 (GMT)
committerhobbs <hobbs>2010-08-26 02:06:08 (GMT)
commitb29adcfbfc2e03e058536524f1aa3378b948e7ed (patch)
treefa90e1e6d32590addfbb0a1599a40b1f7f99ea3b /generic/ttk/ttkScrollbar.c
parent7dec1714e5d5efd6b7d095657c1434fa68af0f87 (diff)
downloadtk-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/ttkScrollbar.c')
-rw-r--r--generic/ttk/ttkScrollbar.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c
index 82bb880..d0f91de 100644
--- a/generic/ttk/ttkScrollbar.c
+++ b/generic/ttk/ttkScrollbar.c
@@ -1,4 +1,4 @@
-/* $Id: ttkScrollbar.c,v 1.7 2007/12/13 15:26:26 dgp Exp $
+/* $Id: ttkScrollbar.c,v 1.7.2.1 2010/08/26 02:06:09 hobbs Exp $
* Copyright (c) 2003, Joe English
*
* ttk::scrollbar widget.
@@ -49,7 +49,7 @@ static Tk_OptionSpec ScrollbarOptionSpecs[] =
* +++ Widget hooks.
*/
-static int
+static void
ScrollbarInitialize(Tcl_Interp *interp, void *recordPtr)
{
Scrollbar *sb = recordPtr;
@@ -57,8 +57,6 @@ ScrollbarInitialize(Tcl_Interp *interp, void *recordPtr)
sb->scrollbar.last = 1.0;
TtkTrackElementState(&sb->core);
-
- return TCL_OK;
}
static Ttk_Layout ScrollbarGetLayout(
@@ -80,7 +78,7 @@ static void ScrollbarDoLayout(void *recordPtr)
{
Scrollbar *sb = recordPtr;
WidgetCore *corePtr = &sb->core;
- Ttk_LayoutNode *thumb;
+ Ttk_Element thumb;
Ttk_Box thumbBox;
int thumbWidth, thumbHeight;
double first, last, size;
@@ -94,11 +92,11 @@ static void ScrollbarDoLayout(void *recordPtr)
/*
* Locate thumb element, extract parcel and requested minimum size:
*/
- thumb = Ttk_LayoutFindNode(corePtr->layout, "thumb");
+ thumb = Ttk_FindElement(corePtr->layout, "thumb");
if (!thumb) /* Something has gone wrong -- bail */
return;
- sb->scrollbar.troughBox = thumbBox = Ttk_LayoutNodeParcel(thumb);
+ sb->scrollbar.troughBox = thumbBox = Ttk_ElementParcel(thumb);
Ttk_LayoutNodeReqSize(
corePtr->layout, thumb, &thumbWidth,&thumbHeight);
@@ -120,7 +118,7 @@ static void ScrollbarDoLayout(void *recordPtr)
thumbBox.width = (int)(size * last) + minSize - (int)(size * first);
}
sb->scrollbar.minSize = minSize;
- Ttk_PlaceLayoutNode(corePtr->layout, thumb, thumbBox);
+ Ttk_PlaceElement(corePtr->layout, thumb, thumbBox);
}
/*------------------------------------------------------------------------
@@ -132,7 +130,7 @@ static void ScrollbarDoLayout(void *recordPtr)
*/
static int
ScrollbarSetCommand(
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
Scrollbar *scrollbar = recordPtr;
Tcl_Obj *firstObj, *lastObj;
@@ -183,7 +181,7 @@ ScrollbarSetCommand(
*/
static int
ScrollbarGetCommand(
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
Scrollbar *scrollbar = recordPtr;
Tcl_Obj *result[2];
@@ -206,7 +204,7 @@ ScrollbarGetCommand(
*/
static int
ScrollbarDeltaCommand(
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
Scrollbar *sb = recordPtr;
double dx, dy;
@@ -246,7 +244,7 @@ ScrollbarDeltaCommand(
*/
static int
ScrollbarFractionCommand(
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
Scrollbar *sb = recordPtr;
Ttk_Box b = sb->scrollbar.troughBox;
@@ -280,18 +278,17 @@ ScrollbarFractionCommand(
return TCL_OK;
}
-static WidgetCommandSpec ScrollbarCommands[] =
-{
- { "configure", TtkWidgetConfigureCommand },
- { "cget", TtkWidgetCgetCommand },
- { "delta", ScrollbarDeltaCommand },
- { "fraction", ScrollbarFractionCommand },
- { "get", ScrollbarGetCommand },
- { "identify", TtkWidgetIdentifyCommand },
- { "instate", TtkWidgetInstateCommand },
- { "set", ScrollbarSetCommand },
- { "state", TtkWidgetStateCommand },
- { 0,0 }
+static const Ttk_Ensemble ScrollbarCommands[] = {
+ { "configure", TtkWidgetConfigureCommand,0 },
+ { "cget", TtkWidgetCgetCommand,0 },
+ { "delta", ScrollbarDeltaCommand,0 },
+ { "fraction", ScrollbarFractionCommand,0 },
+ { "get", ScrollbarGetCommand,0 },
+ { "identify", TtkWidgetIdentifyCommand,0 },
+ { "instate", TtkWidgetInstateCommand,0 },
+ { "set", ScrollbarSetCommand,0 },
+ { "state", TtkWidgetStateCommand,0 },
+ { 0,0,0 }
};
/*------------------------------------------------------------------------