aboutsummaryrefslogtreecommitdiff
path: root/generic/tkZinc.c
diff options
context:
space:
mode:
authorlecoanet2000-03-23 14:24:49 +0000
committerlecoanet2000-03-23 14:24:49 +0000
commite5c3ecc0b363ce5afd63eac6f9a0dd88b70ccdae (patch)
tree3f5a42e30a0fd449dc5546a4405d780760d58539 /generic/tkZinc.c
parente105208dba9b878cd4b18af91ae4604d2b6cd508 (diff)
downloadtkzinc-e5c3ecc0b363ce5afd63eac6f9a0dd88b70ccdae.zip
tkzinc-e5c3ecc0b363ce5afd63eac6f9a0dd88b70ccdae.tar.gz
tkzinc-e5c3ecc0b363ce5afd63eac6f9a0dd88b70ccdae.tar.bz2
tkzinc-e5c3ecc0b363ce5afd63eac6f9a0dd88b70ccdae.tar.xz
* (PickCurrentItem): Corrig� un bug tendant � oublier des
tags 'current' sur des items visit�s par le pointeur lorsqu'un bouton est enfonc� (simulation du grab implicite). * (FindItems): find et addtag utilis�s avec l'option withtag ne reportent plus d'erreur si l'item ou le tag sont inconnus. addtag ne fait rien et find retourne une chaine vide. * Adaptation suite au remanniement du traitement des piles de clip et de transfo.
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r--generic/tkZinc.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index b47abe1..0dc1f21 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -384,11 +384,10 @@ ZincCmd(ClientData client_data, /* Main window associated with
wi->work_item_list = NULL;
wi->work_pts = ZnListNew(8, sizeof(ZnPoint));
+ wi->work_xpts = ZnListNew(8, sizeof(XPoint));
- wi->clip_stack = ZnListNew(8, sizeof(ClipState));
- ITEM_P.ResetClipStack(wi);
- wi->transfo_stack = ZnListNew(8, sizeof(ZnTransfo));
- ITEM_P.ResetTransformStack(wi);
+ ITEM_P.InitClipStack(wi);
+ ITEM_P.InitTransformStack(wi);
for (num = 0; num < NUM_ALPHA_STEPS; num++) {
char name[INTEGER_SPACE+12];
@@ -1202,7 +1201,7 @@ FindItems(Tcl_Interp *interp,
}
num_items = ZnItemsWithTagOrId(wi, LangString(args[1]), &item, &items);
if (num_items == 0) {
- return ZN_ERROR;
+ Tcl_SetResult(interp, "", TCL_STATIC);
}
for (i = 0; i < num_items; i++) {
if (IsHeirOf(items[i], group)) {
@@ -1771,9 +1770,9 @@ WidgetCmd(ClientData client_data, /* Information about the widget. */
goto done;
}
if (adjust) {
- ITEM.GetTransform(grp, &t);
+ ITEM.GetItemTransform(grp, &t);
ZnTransfoInvert(&t, &inv);
- ITEM.GetTransform(item->parent, &t);
+ ITEM.GetItemTransform(item->parent, &t);
ZnTransfoCompose(&t2, &t, &inv);
this_one = &t2;
if (item->transfo) {
@@ -2439,12 +2438,12 @@ WidgetCmd(ClientData client_data, /* Information about the widget. */
inv = *((ZnTransfo *) Tcl_GetHashValue(e));
}
else {
- ITEM.GetTransform(to, &t);
+ ITEM.GetItemTransform(to, &t);
ZnTransfoInvert(&t, &inv);
}
this_one = &inv;
if (argc == 5) {
- ITEM.GetTransform(from, &t);
+ ITEM.GetItemTransform(from, &t);
ZnTransfoCompose(&t2, &t, &inv);
this_one = &t2;
}
@@ -3287,6 +3286,7 @@ PickCurrentItem(WidgetInfo *wi,
* event handler for <LeaveNotify> that deletes the current item.
*/
if ((item == wi->current_item) && !button_down) {
+ /*printf("Removing 'current' to %d\n", wi->current_item->id);*/
ITEM.RemoveTag(item, current_uid);
}
/*
@@ -3313,6 +3313,10 @@ PickCurrentItem(WidgetInfo *wi,
* LEFT_GRABBED_ITEM.
*/
if (wi->current_item != wi->new_item) {
+ if (wi->current_item != ZN_NO_ITEM) {
+ /*printf("***Removing 'current' to %d\n", wi->current_item->id);*/
+ ITEM.RemoveTag(wi->current_item, current_uid);
+ }
wi->current_item = wi->new_item;
wi->new_item = ZN_NO_ITEM;
}
@@ -3325,6 +3329,7 @@ PickCurrentItem(WidgetInfo *wi,
/*
* Add the tag 'current' to the current item under the pointer.
*/
+ /*printf("Adding 'current' to %d\n", wi->current_item->id);*/
DoItem((Tcl_Interp *) NULL, wi->current_item, ZN_NO_PART, current_uid);
/*
* Then emit a fake Enter event on it.
@@ -3585,10 +3590,11 @@ Destroy(char *mem_ptr) /* Info about the widget. */
/*
* Should be empty by now.
*/
- ZnListFree(wi->transfo_stack);
- ZnListFree(wi->clip_stack);
+ ITEM_P.FreeTransformStack(wi);
+ ITEM_P.FreeClipStack(wi);
ZnListFree(wi->work_pts);
+ ZnListFree(wi->work_xpts);
ZnFree(wi);
/*printf("Destroy ending\n");*/