summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkScale.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2009-02-08 19:35:35 (GMT)
committerjenglish <jenglish@flightlab.com>2009-02-08 19:35:35 (GMT)
commita7f3e6b8652f5d9ea2c4db8a47c14033cb559466 (patch)
treeb77850fad5f37f79d05730f2d09bec514b78f07c /generic/ttk/ttkScale.c
parent76e883da5646c90946512d237df48377778d63cc (diff)
downloadtk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.zip
tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.tar.gz
tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.tar.bz2
Renamed several internal data structures and functions:
ElementImpl -> ElementClass, LayoutNode -> Element. Remove more unnecessary casts. Add function Ttk_ClientRegion, common factor of entry, scale, progress, and treeview widgets.
Diffstat (limited to 'generic/ttk/ttkScale.c')
-rw-r--r--generic/ttk/ttkScale.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c
index bf1f1ea..6645dc0 100644
--- a/generic/ttk/ttkScale.c
+++ b/generic/ttk/ttkScale.c
@@ -1,4 +1,4 @@
-/* $Id: ttkScale.c,v 1.9 2008/11/09 23:53:09 jenglish Exp $
+/* $Id: ttkScale.c,v 1.10 2009/02/08 19:35:35 jenglish Exp $
* Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
*
* ttk::scale widget.
@@ -187,15 +187,7 @@ ScaleGetLayout(Tcl_Interp *interp, Ttk_Theme theme, void *recordPtr)
*/
static Ttk_Box TroughBox(Scale *scalePtr)
{
- WidgetCore *corePtr = &scalePtr->core;
- Ttk_LayoutNode *node = Ttk_LayoutFindNode(corePtr->layout, "trough");
-
- if (node) {
- return Ttk_LayoutNodeInternalParcel(corePtr->layout, node);
- } else {
- return Ttk_MakeBox(
- 0,0, Tk_Width(corePtr->tkwin), Tk_Height(corePtr->tkwin));
- }
+ return Ttk_ClientRegion(scalePtr->core.layout, "trough");
}
/*
@@ -206,13 +198,13 @@ static Ttk_Box TroughBox(Scale *scalePtr)
static Ttk_Box TroughRange(Scale *scalePtr)
{
Ttk_Box troughBox = TroughBox(scalePtr);
- Ttk_LayoutNode *slider=Ttk_LayoutFindNode(scalePtr->core.layout,"slider");
+ Ttk_Element slider = Ttk_FindElement(scalePtr->core.layout,"slider");
/*
* If this is a scale widget, adjust range for slider:
*/
if (slider) {
- Ttk_Box sliderBox = Ttk_LayoutNodeParcel(slider);
+ Ttk_Box sliderBox = Ttk_ElementParcel(slider);
if (scalePtr->scale.orient == TTK_ORIENT_HORIZONTAL) {
troughBox.x += sliderBox.width / 2;
troughBox.width -= sliderBox.width;
@@ -376,16 +368,16 @@ ScaleCoordsCommand(
static void ScaleDoLayout(void *clientData)
{
WidgetCore *corePtr = clientData;
- Ttk_LayoutNode *sliderNode = Ttk_LayoutFindNode(corePtr->layout, "slider");
+ Ttk_Element slider = Ttk_FindElement(corePtr->layout, "slider");
Ttk_PlaceLayout(corePtr->layout,corePtr->state,Ttk_WinBox(corePtr->tkwin));
/* Adjust the slider position:
*/
- if (sliderNode) {
+ if (slider) {
Scale *scalePtr = clientData;
Ttk_Box troughBox = TroughBox(scalePtr);
- Ttk_Box sliderBox = Ttk_LayoutNodeParcel(sliderNode);
+ Ttk_Box sliderBox = Ttk_ElementParcel(slider);
double value = 0.0;
double fraction;
int range;
@@ -400,7 +392,7 @@ static void ScaleDoLayout(void *clientData)
range = troughBox.height - sliderBox.height;
sliderBox.y += (int)(fraction * range);
}
- Ttk_PlaceLayoutNode(corePtr->layout, sliderNode, sliderBox);
+ Ttk_PlaceElement(corePtr->layout, slider, sliderBox);
}
}