Commit 9fdee4f3 authored by Ivica Ico Bukvic's avatar Ivica Ico Bukvic
Browse files

Added support for moving GOP objects via tag and disabled showing of resize...

Added support for moving GOP objects via tag and disabled showing of resize handles on iemgui objects when displayed inside a gop window (this became an issue due to new way of selecting gop objects which now also includes all objects inside it).
parent 6a8a8e55
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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));
......
......@@ -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;
}