From 78740373985ac1d9ebbad3807a9ccc7b4db13def Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 22 Jan 2003 14:50:39 +0000 Subject: *** empty log message *** --- generic/Arc.c | 21 ++++++++++++++++++++- generic/Curve.c | 22 +++++++++++++++++++++- generic/Group.c | 22 +++++++++++++++++++++- generic/Rectangle.c | 23 ++++++++++++++++++++++- generic/tkZinc.c | 34 +++++++++++----------------------- 5 files changed, 95 insertions(+), 27 deletions(-) (limited to 'generic') diff --git a/generic/Arc.c b/generic/Arc.c index d64bb11..e50cd22 100644 --- a/generic/Arc.c +++ b/generic/Arc.c @@ -1726,6 +1726,25 @@ Coords(Item item, return ZN_OK; } +/* + ********************************************************************************** + * + * GetAnchor -- + * + ********************************************************************************** + */ +static void +GetAnchor(Item item, + ZnAnchor anchor, + ZnPoint *p) +{ + ZnBBox *bbox = &item->item_bounding_box; + + Origin2Anchor(&bbox->orig, + bbox->corner.x - bbox->orig.x, + bbox->corner.y - bbox->orig.y, + anchor, p); +} /* ********************************************************************************** @@ -1760,7 +1779,7 @@ static ItemClassStruct ARC_ITEM_CLASS = { Configure, Query, NULL, /* GetFieldSet */ - NULL, /* GetAnchor */ + GetAnchor, GetClipVertices, GetContours, Coords, diff --git a/generic/Curve.c b/generic/Curve.c index bad3de5..37567ac 100644 --- a/generic/Curve.c +++ b/generic/Curve.c @@ -2249,6 +2249,26 @@ PickVertex(Item item, } } +/* + ********************************************************************************** + * + * GetAnchor -- + * + ********************************************************************************** + */ +static void +GetAnchor(Item item, + ZnAnchor anchor, + ZnPoint *p) +{ + ZnBBox *bbox = &item->item_bounding_box; + + Origin2Anchor(&bbox->orig, + bbox->corner.x - bbox->orig.x, + bbox->corner.y - bbox->orig.y, + anchor, p); +} + /* ********************************************************************************** @@ -2269,7 +2289,7 @@ static ItemClassStruct CURVE_ITEM_CLASS = { Configure, Query, NULL, /* GetFieldSet */ - NULL, /* GetAnchor */ + GetAnchor, GetClipVertices, GetContours, Coords, diff --git a/generic/Group.c b/generic/Group.c index 4305353..d020186 100644 --- a/generic/Group.c +++ b/generic/Group.c @@ -1590,6 +1590,26 @@ ZnGroupInsertItem(Item group, ITEM.Invalidate(group, ZN_COORDS_FLAG); } +/* + ********************************************************************************** + * + * GetAnchor -- + * + ********************************************************************************** + */ +static void +GetAnchor(Item item, + ZnAnchor anchor, + ZnPoint *p) +{ + ZnBBox *bbox = &item->item_bounding_box; + + Origin2Anchor(&bbox->orig, + bbox->corner.x - bbox->orig.x, + bbox->corner.y - bbox->orig.y, + anchor, p); +} + /* ********************************************************************************** @@ -1610,7 +1630,7 @@ static ItemClassStruct GROUP_ITEM_CLASS = { Configure, Query, NULL, /* GetFieldSet */ - NULL, /* GetAnchor */ + GetAnchor, NULL, /* GetClipVertices */ NULL, /* GetContours */ Coords, diff --git a/generic/Rectangle.c b/generic/Rectangle.c index 7e18dbe..2552884 100644 --- a/generic/Rectangle.c +++ b/generic/Rectangle.c @@ -900,6 +900,27 @@ Coords(Item item, /* ********************************************************************************** * + * GetAnchor -- + * + ********************************************************************************** + */ +static void +GetAnchor(Item item, + ZnAnchor anchor, + ZnPoint *p) +{ + ZnBBox *bbox = &item->item_bounding_box; + + Origin2Anchor(&bbox->orig, + bbox->corner.x - bbox->orig.x, + bbox->corner.y - bbox->orig.y, + anchor, p); +} + + +/* + ********************************************************************************** + * * Exported functions struct -- * ********************************************************************************** @@ -916,7 +937,7 @@ static ItemClassStruct RECTANGLE_ITEM_CLASS = { Configure, Query, NULL, /* GetFieldSet */ - NULL, /* GetAnchor */ + GetAnchor, GetClipVertices, NULL, /* GetContours */ Coords, diff --git a/generic/tkZinc.c b/generic/tkZinc.c index 696cb28..bdf14d2 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -1978,8 +1978,8 @@ ZnItemWithTagOrId(WidgetInfo *wi, * * Perform layouts on items. It can position items horizontally, * vertically, along a path or with respect to a reference item. - * It can also align on a grid and resize items to a common - * reference. + * It can also align on a grid, evenly space items and resize + * items to a common reference. * *---------------------------------------------------------------------- */ @@ -1991,16 +1991,14 @@ LayoutItems(WidgetInfo *wi, int index, result; Item item; static CONST char *layout_cmd_strings[] = { - "bbalign", "valign", "halign", "align", - "position", "grid", "size", NULL + "align", "grid", "position", "scale", "space", NULL }; enum layout_cmds { - ZN_L_BBALIGN, ZN_L_VALIGN, ZN_L_HALIGN, ZN_L_ALIGN, - ZN_L_POSITION, ZN_L_GRID, ZN_L_SIZE + ZN_L_ALIGN, ZN_L_GRID, ZN_L_POSITION, ZN_L_SCALE, ZN_L_SPACE }; if (Tcl_GetIndexFromObj(wi->interp, args[0], layout_cmd_strings, - "align command", 0, &index) != ZN_OK) { + "layout command", 0, &index) != ZN_OK) { return ZN_ERROR; } switch((enum layout_cmds) index) { @@ -2010,19 +2008,9 @@ LayoutItems(WidgetInfo *wi, case ZN_L_ALIGN: break; /* - * halign - */ - case ZN_L_HALIGN: - break; - /* - * valign - */ - case ZN_L_VALIGN: - break; - /* - * bbalign + * grid */ - case ZN_L_BBALIGN: + case ZN_L_GRID: break; /* * position @@ -2030,14 +2018,14 @@ LayoutItems(WidgetInfo *wi, case ZN_L_POSITION: break; /* - * grid + * scale */ - case ZN_L_GRID: + case ZN_L_SCALE: break; /* - * size + * space */ - case ZN_L_SIZE: + case ZN_L_SPACE: break; } -- cgit v1.1