diff --git a/src/g_bang.c b/src/g_bang.c index f2fe28be2702c0f8f27fa3f22ffc2d2999bb97b2..3ef86a8b5e742f68212933fdf0eadeeaa8d612e3 100644 --- a/src/g_bang.c +++ b/src/g_bang.c @@ -248,43 +248,48 @@ void bng_draw_select(t_bng* x, t_glist* glist) sys_vgui(".x%lx.c itemconfigure %lxBUT -outline $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxBNG}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxBNG}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxBNG}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxBNG}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxBNG\n", canvas, x); diff --git a/src/g_graph.c b/src/g_graph.c index f6bbd110ad65d270b7e9eb9e655ab6b4e0204473..42bcfd9e02cfae6a836e6abaacaa46a07e9e4220 100644 --- a/src/g_graph.c +++ b/src/g_graph.c @@ -1048,6 +1048,27 @@ static void graph_getrect(t_gobj *z, t_glist *glist, *yp2 = y2; } +static void graph_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy) +{ + t_glist *x = (t_glist *)z; + if (!x->gl_isgraph) + text_widgetbehavior.w_displacefn(z, glist, dx, dy); + else + { + x->gl_obj.te_xpix += dx; + x->gl_obj.te_ypix += dy; + /*char tag[80]; + sprintf(tag, "%s", rtext_gettag(glist_findrtext((x->gl_owner ? x->gl_owner: x), &x->gl_obj))); + sys_vgui(".x%lx.c move %s %d %d\n", + glist_getcanvas(x->gl_owner), tag, dx, dy); + sys_vgui(".x%lx.c move %sR %d %d\n", + glist_getcanvas(x->gl_owner), tag, dx, dy);*/ + //glist_redraw(x); + //gobj_select(z, glist, 1); + canvas_fixlinesfor(glist_getcanvas(glist), &x->gl_obj); + } +} + static void graph_displace(t_gobj *z, t_glist *glist, int dx, int dy) { t_glist *x = (t_glist *)z; @@ -1090,6 +1111,11 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) sys_vgui(".x%lx.c itemconfigure %s -fill %s\n", glist, rtext_gettag(y), (state? "$select_color" : "black")); + t_gobj *g; + if (x->gl_list) + for (g = x->gl_list; g; g = g->g_next) + gobj_select(g, x, state); + sys_vgui("pdtk_select_all_gop_widgets .x%lx %s %d\n", glist, rtext_gettag(glist_findrtext(glist, &x->gl_obj)), state); } } @@ -1213,7 +1239,7 @@ t_widgetbehavior graph_widgetbehavior = graph_delete, graph_vis, graph_click, - NULL, + graph_displace_withtag, }; /* find the graph most recently added to this glist; diff --git a/src/g_hdial.c b/src/g_hdial.c index 98c25eaac74b2a2ac612db9cf270d1638a0cff09..bdad64b7b409f1344c230e427983bf4290e4be49 100644 --- a/src/g_hdial.c +++ b/src/g_hdial.c @@ -281,42 +281,47 @@ void hradio_draw_select(t_hradio* x, t_glist* glist) } sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHRDO}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w * x->x_number - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxHRDO}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHRDO}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w * x->x_number - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxHRDO}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxHRDO\n", canvas, x); diff --git a/src/g_hslider.c b/src/g_hslider.c index dadf974b6c0bb4e80d5937a87c7718be25c4b77e..2c8fc410882fd1e798d994ee4e329fb6ecb9f9a0 100644 --- a/src/g_hslider.c +++ b/src/g_hslider.c @@ -264,43 +264,48 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist) sys_vgui(".x%lx.c itemconfigure %lxBASE -outline $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHSLDR}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w + 2 - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxHSLDR}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxHSLDR}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w + 2 - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxHSLDR}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxHSLDR\n", canvas, x); diff --git a/src/g_mycanvas.c b/src/g_mycanvas.c index 00606659a70e118c78d3f2226cbc997c7b1f04a5..4e8833505465ee20fd688d6958c4aeba8dfdf424 100644 --- a/src/g_mycanvas.c +++ b/src/g_mycanvas.c @@ -144,43 +144,48 @@ void my_canvas_draw_select(t_my_canvas* x, t_glist* glist) { sys_vgui(".x%lx.c itemconfigure %lxBASE -outline $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxMYCNV}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_vis_w - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_vis_h - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxMYCNV}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxMYCNV}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_vis_w - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_vis_h - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxMYCNV}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxMYCNV\n", canvas, x); diff --git a/src/g_numbox.c b/src/g_numbox.c index 6d2829035f12346d643ed4f80c4322028f160b42..ab4c8b0b0d5d2a0db347e0303919ce5494f11750 100644 --- a/src/g_numbox.c +++ b/src/g_numbox.c @@ -444,42 +444,47 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) sys_vgui(".x%lx.c itemconfigure %lxNUMBER -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxNUM}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_numwidth - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxNUM}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxNUM}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_numwidth - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxNUM}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxNUM\n", canvas, x); diff --git a/src/g_text.c b/src/g_text.c index 664720d60d8fcd30a03edffd8834fedd0432231a..0d57d6302dad0c69372f6703ab1b32918e9e1187 100644 --- a/src/g_text.c +++ b/src/g_text.c @@ -1210,8 +1210,8 @@ static void gatom_displace_withtag(t_gobj *z, t_glist *glist, { t_gatom *x = (t_gatom*)z; text_displace_withtag(z, glist, dx, dy); - sys_vgui(".x%lx.c move %lx.l %d %d\n", glist_getcanvas(glist), - x, dx, dy); + //sys_vgui(".x%lx.c move %lx.l %d %d\n", glist_getcanvas(glist), + // x, dx, dy); } static void text_select(t_gobj *z, t_glist *glist, int state) @@ -1227,9 +1227,17 @@ static void text_select(t_gobj *z, t_glist *glist, int state) if (glist_isvisible(glist) && gobj_shouldvis(&x->te_g, glist)) { sys_vgui(".x%lx.c itemconfigure %sR -outline %s\n", glist_getcanvas(glist), rtext_gettag(y), (state? "$select_color" : outline)); + if (z->g_pd == gatom_class) { + sys_vgui("catch {.x%lx.c itemconfigure %lx.l -fill %s}\n", glist_getcanvas(glist), + x, (state? "$select_color" : "$text_color")); + } if (z->g_pd->c_wb && z->g_pd->c_wb->w_displacefnwtag) { int i, ni, no; if (state) { + if (z->g_pd == gatom_class) { + sys_vgui(".x%lx.c addtag selected withtag %lx.l\n", + glist_getcanvas(glist), x); + } sys_vgui(".x%lx.c addtag selected withtag %sR \n", glist_getcanvas(glist), rtext_gettag(y)); @@ -1250,6 +1258,10 @@ static void text_select(t_gobj *z, t_glist *glist, int state) glist_getcanvas(glist), rtext_gettag(y), i); } } else { + if (z->g_pd == gatom_class) { + sys_vgui(".x%lx.c dtag %lx.l selected\n", + glist_getcanvas(glist), x); + } sys_vgui(".x%lx.c dtag %sR selected\n", glist_getcanvas(glist), rtext_gettag(y)); diff --git a/src/g_toggle.c b/src/g_toggle.c index 8cd5bb475c4bf448a8a3f5b646e202baa623cff6..5b62522807d01739f521527fb0ecdcfd24df9c97 100644 --- a/src/g_toggle.c +++ b/src/g_toggle.c @@ -265,43 +265,48 @@ void toggle_draw_select(t_toggle* x, t_glist* glist) sys_vgui(".x%lx.c itemconfigure %lxBASE -outline $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxTGL}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxTGL}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxTGL}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxTGL}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxTGL\n", canvas, x); diff --git a/src/g_vdial.c b/src/g_vdial.c index f23e3db72099abe7ae34b22dafd78072d3a4cd83..de0f685450e51a955ee35c2d4169d927948ef62d 100644 --- a/src/g_vdial.c +++ b/src/g_vdial.c @@ -280,43 +280,48 @@ void vradio_draw_select(t_vradio* x, t_glist* glist) } sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVRDO}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_gui.x_h * x->x_number - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxVDRO}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVRDO}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_gui.x_h * x->x_number - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxVDRO}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxVRDO\n", canvas, x); diff --git a/src/g_vslider.c b/src/g_vslider.c index a1e263fb071da23360b2e969fe759c3b892b1095..7c127442829e6d4106eaa74ac0b9952257c327be 100644 --- a/src/g_vslider.c +++ b/src/g_vslider.c @@ -255,43 +255,48 @@ static void vslider_draw_select(t_vslider *x, t_glist *glist) sys_vgui(".x%lx.c itemconfigure %lxBASE -outline $select_color\n", canvas, x); sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVSLDR}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + 3 + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxVSLDR}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVSLDR}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + 3 + x->x_gui.x_h - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxVSLDR}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxVSLDR\n", canvas, x); diff --git a/src/g_vumeter.c b/src/g_vumeter.c index 891fb37cf05f280468714d331c5147166cc48a2c..f0a8e8f56182aa409c82909824f4bdc5e9fa5ed2 100644 --- a/src/g_vumeter.c +++ b/src/g_vumeter.c @@ -471,42 +471,47 @@ static void vu_draw_select(t_vu* x,t_glist* glist) } sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x); - if (x->x_gui.scale_vis) - sys_vgui("destroy %s\n", sh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", - sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVU}\n", - canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w + 1 - SCALEHANDLE_WIDTH - 1, - x->x_gui.x_obj.te_ypix + x->x_gui.x_h + 2 - SCALEHANDLE_HEIGHT - 1, - SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, - sh->h_pathname, x, x); - sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - sh->h_pathname, sh->h_bindsym->s_name); - x->x_gui.scale_vis = 1; - if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) - { - if (x->x_gui.label_vis) - sys_vgui("destroy %s\n", lh->h_pathname); - - sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", - lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); - sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxVU}\n", - canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, - x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, - LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, - lh->h_pathname, x, x); + // check if we are drawing inside a gop abstraction visible on parent canvas + // if so, disable drawing of the handles + if (x->x_gui.x_glist == glist_getcanvas(glist)) { + + if (x->x_gui.scale_vis) + sys_vgui("destroy %s\n", sh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor bottom_right_corner\n", + sh->h_pathname, SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxSCALE %lxVU}\n", + canvas, x->x_gui.x_obj.te_xpix + x->x_gui.x_w + 1 - SCALEHANDLE_WIDTH - 1, + x->x_gui.x_obj.te_ypix + x->x_gui.x_h + 2 - SCALEHANDLE_HEIGHT - 1, + SCALEHANDLE_WIDTH, SCALEHANDLE_HEIGHT, + sh->h_pathname, x, x); sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); + sh->h_pathname, sh->h_bindsym->s_name); sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", - lh->h_pathname, lh->h_bindsym->s_name); - x->x_gui.label_vis = 1; + sh->h_pathname, sh->h_bindsym->s_name); + x->x_gui.scale_vis = 1; + if (strcmp(x->x_gui.x_lab->s_name, "empty") != 0) + { + if (x->x_gui.label_vis) + sys_vgui("destroy %s\n", lh->h_pathname); + + sys_vgui("canvas %s -width %d -height %d -bg $select_color -bd 0 -cursor crosshair\n", + lh->h_pathname, LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT); + sys_vgui(".x%x.c create window %d %d -anchor nw -width %d -height %d -window %s -tags {%lxLABEL %lxVU}\n", + canvas, x->x_gui.x_obj.te_xpix+ x->x_gui.x_ldx - LABELHANDLE_WIDTH, + x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy - LABELHANDLE_HEIGHT, + LABELHANDLE_WIDTH, LABELHANDLE_HEIGHT, + lh->h_pathname, x, x); + sys_vgui("bind %s <Button> {pd [concat %s _click 1 %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <ButtonRelease> {pd [concat %s _click 0 0 0 \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + sys_vgui("bind %s <Motion> {pd [concat %s _motion %%x %%y \\;]}\n", + lh->h_pathname, lh->h_bindsym->s_name); + x->x_gui.label_vis = 1; + } } sys_vgui(".x%lx.c addtag selected withtag %lxVU\n", canvas, x); diff --git a/src/pd.tk b/src/pd.tk index 793d2d635a741ac355da6f817a6891a3f0926630..072fe1bbb0f3e8a0c1480d8cc9762c85af03a07d 100644 --- a/src/pd.tk +++ b/src/pd.tk @@ -2896,6 +2896,24 @@ proc pdtk_canvas_mouseup {name x y b} { # after 40 [list pdtk_canvas_getscroll_ping $name] #} +proc pdtk_select_all_gop_widgets {name gop state} { + #puts stderr "======================$name" + foreach item [$name.c find all] { + #puts stderr [$name.c gettags $item] + foreach tag [$name.c gettags $item] { + if { [string first $gop $tag] > -1 } { + #puts stderr ...match + #$name.c delete $item + if {$state} { + $name.c addtag selected withtag $tag + } else { + $name.c dtag $tag selected + } + } + } + } +} + proc pdtk_canvas_getscroll {name} { global pd_nt global pdtk_canvas_mouseup_name