Commit f2742d32 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

first stab at porting core GUI to tkpath with SVG goodness. new scrollbars...

first stab at porting core GUI to tkpath with SVG goodness. new scrollbars that will hopefully put an end to the old painful scrollbar nonsense. pdtk_tip clean-up and improvements. tons of other small bug fixes. a number of issues/wishlists still exist before the next big release:
*improve g_array lower/raise to use new functionality (BUG! doesn't match any items)
*scalar is drawn behind at first
*Scope~ window name "h16ffd10" already exists in parent (likely resize hook)
	*Change appearance of the resize hook
*better getrect for scalars inside plot?
*reenable bgerror and t_tkcmd catch
*Clean-up and merge cyclone documentation
parent 8a73bc3b
......@@ -469,15 +469,12 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize,
pd_unbind(&x->x_gobj.g_pd, x->x_realname);
x->x_realname = canvas_realizedollar(x->x_glist, argname);
pd_bind(&x->x_gobj.g_pd, x->x_realname);
/* redraw the whole glist, just so the name change shows up */
if (x->x_glist->gl_havewindow)
canvas_redraw(x->x_glist);
else if (glist_isvisible(x->x_glist->gl_owner))
{
gobj_vis(&x->x_glist->gl_gobj, x->x_glist->gl_owner, 0);
gobj_vis(&x->x_glist->gl_gobj, x->x_glist->gl_owner, 1);
}
}
/* redraw the whole glist, just so the name change shows up */
if (x->x_glist->gl_havewindow) {
canvas_redraw(glist_getcanvas(x->x_glist));
//fprintf(stderr,"================REDRAW\n");
}
size = fsize;
if (size < 1)
size = 1;
......@@ -487,7 +484,7 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize,
x->x_style = style;
garray_fittograph(x, size);
}
fprintf(stderr,"style=%d %f\n", style, (t_float)x->x_style);
//fprintf(stderr,"style=%d %f\n", style, (t_float)x->x_style);
template_setfloat(scalartemplate, gensym("style"),
x->x_scalar->sc_vec, (t_float)x->x_style, 0);
template_setfloat(scalartemplate, gensym("linewidth"),
......@@ -499,6 +496,33 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize,
garray_setsaveit(x, (saveit != 0));
garray_redraw(x);
if (glist_getcanvas(x->x_glist) != x->x_glist)
{
int arrange = 0;
t_gobj *y = glist_getcanvas(x->x_glist)->gl_list;
if (y != (t_gobj *)x->x_glist) {
while (y && y->g_next != (t_gobj *)x->x_glist) {
//fprintf(stderr,"================SEARCHING %s\n", rtext_gettag(glist_findrtext(glist_getcanvas(x->x_glist), pd_checkobject(&y->g_pd))));
y = y->g_next;
}
arrange = 1;
}
//fprintf(stderr,"================FOUND %s %d\n", rtext_gettag(glist_findrtext(glist_getcanvas(x->x_glist), pd_checkobject(&y->g_pd))), arrange);
char *below = rtext_gettag(glist_findrtext(glist_getcanvas(x->x_glist), pd_checkobject(&y->g_pd)));
glist_noselect(glist_getcanvas(x->x_glist));
gobj_vis(&x->x_glist->gl_gobj, glist_getcanvas(x->x_glist), 0);
gobj_vis(&x->x_glist->gl_gobj, glist_getcanvas(x->x_glist), 1);
glist_select(glist_getcanvas(x->x_glist), (t_gobj *)x->x_glist);
if (!arrange) {
sys_vgui(".x%lx.c lower selected\n", glist_getcanvas(x->x_glist));
//fprintf(stderr,"--------------TOBOTTOM\n");
} else {
sys_vgui(".x%lx.c lower selected %s\n", glist_getcanvas(x->x_glist), below);
sys_vgui(".x%lx.c raise selected %s\n", glist_getcanvas(x->x_glist), below);
//fprintf(stderr,"++++++++++++++TOMIDDLE\n");
}
}
canvas_dirty(x->x_glist, 1);
}
}
......@@ -1136,8 +1160,8 @@ static void garray_save(t_gobj *z, t_binbuf *b)
}
/* style = template_getfloat(scalartemplate, gensym("style"),
x->x_scalar->sc_vec, 0); */
filestyle = (x->x_style == PLOTSTYLE_POINTS ? 1 :
(x->x_style == PLOTSTYLE_POLY ? 0 : x->x_style));
filestyle = (x->x_style == PLOTSTYLE_POINTS ? 0 :
(x->x_style == PLOTSTYLE_POLY ? 1 : x->x_style));
binbuf_addv(b, "sssisi;", gensym("#X"), gensym("array"),
x->x_name, array->a_n, &s_float,
x->x_saveit + 2 * filestyle + 8*x->x_hidename);
......
......@@ -72,13 +72,15 @@ void bng_draw_new(t_bng *x, t_glist *glist)
else nlet_tag = "bogus";
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxBNG %lx text}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxBNG %lx text}\n",
canvas, xpos, ypos,
xpos + x->x_gui.x_w, ypos + x->x_gui.x_h,
x->x_gui.x_bcol, x, x, x);
sys_vgui(".x%lx.c create oval %d %d %d %d -fill #%6.6x -tags {%lxBUT %lxBNG %lx text}\n",
canvas, xpos+1, ypos+1,
xpos + x->x_gui.x_w-1, ypos + x->x_gui.x_h-1,
int cr = (x->x_gui.x_w-(x->x_gui.x_w % 2 ? 0 : 1))/2;
int cx = xpos+1+cr;
int cy = ypos+1+cr;
sys_vgui(".x%lx.c create circle %d %d -r %d -fill #%6.6x -tags {%lxBUT %lxBNG %lx text}\n",
canvas, cx, cy, cr,
x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxBNG %lx text}\n",
......@@ -88,13 +90,13 @@ void bng_draw_new(t_bng *x, t_glist *glist)
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x, x);
if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist) {
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG %lx outlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG %lx outlet}\n",
canvas, xpos,
ypos + x->x_gui.x_h-1, xpos + IOWIDTH,
ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x);
}
if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist) {
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG %lx inlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG %lx inlet}\n",
canvas, xpos, ypos,
xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x);
}
......@@ -125,11 +127,15 @@ void bng_draw_move(t_bng *x, t_glist *glist)
sys_vgui(".x%lx.c coords %lxBASE %d %d %d %d\n",
canvas, x, xpos, ypos,
xpos + x->x_gui.x_w, ypos + x->x_gui.x_h);
sys_vgui(".x%lx.c coords %lxBUT %d %d %d %d\n",
canvas, x, xpos+1,ypos+1,
xpos + x->x_gui.x_w-1, ypos + x->x_gui.x_h-1);
sys_vgui(".x%lx.c itemconfigure %lxBUT -fill #%6.6x\n", canvas, x,
x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol);
int cr = (x->x_gui.x_w-(x->x_gui.x_w % 2 ? 0 : 1))/2;
int cx = xpos+1+cr;
int cy = ypos+1+cr;
/*sys_vgui(".x%lx.c create circle %d %d -r %d -stroke #%6.6x -tags {%lxBUT %lxBNG %lx text}\n",
canvas, cx, cy, cr,*/
sys_vgui(".x%lx.c coords %lxBUT %d %d\n",
canvas, x, cx, cy);
sys_vgui(".x%lx.c itemconfigure %lxBUT -fill #%6.6x -r %d\n", canvas, x,
x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, cr);
sys_vgui(".x%lx.c coords %lxLABEL %d %d\n",
canvas, x, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy);
if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist)
......@@ -221,14 +227,14 @@ void bng_draw_io(t_bng* x, t_glist* glist, int old_snd_rcv_flags)
else nlet_tag = "bogus";
if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG %lx outlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%so%d %so%d %lxBNG %lx outlet}\n",
canvas, xpos,
ypos + x->x_gui.x_h-1, xpos + IOWIDTH,
ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x);
if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c delete %lxBNG%so%d\n", canvas, x, nlet_tag, 0);
if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG %lx inlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxBNG%si%d %si%d %lxBNG %lx inlet}\n",
canvas, xpos, ypos,
xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x);
if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able)
......@@ -250,8 +256,8 @@ void bng_draw_select(t_bng* x, t_glist* glist)
// if so, disable highlighting
if (x->x_gui.x_glist == glist_getcanvas(glist)) {
sys_vgui(".x%lx.c itemconfigure %lxBASE -outline $select_color\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxBUT -outline $select_color\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxBUT -stroke $select_color\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x);
if (x->x_gui.scale_vis) {
......@@ -302,8 +308,8 @@ void bng_draw_select(t_bng* x, t_glist* glist)
}
else
{
sys_vgui(".x%lx.c itemconfigure %lxBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%lx.c itemconfigure %lxBUT -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%lx.c itemconfigure %lxBUT -stroke #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol);
sys_vgui(".x%lx.c dtag %lxBNG selected\n", canvas, x);
sys_vgui("destroy %s\n", sh->h_pathname);
......@@ -378,8 +384,8 @@ static void bng__clickhook(t_scalehandle *sh, t_floatarg f, t_floatarg xxx, t_fl
if (glist_isvisible(x->x_gui.x_glist))
{
sys_vgui("lower %s\n", sh->h_pathname);
sys_vgui(".x%x.c create rectangle %d %d %d %d\
-outline $select_color -width 1 -tags %s\n",
sys_vgui(".x%x.c create prect %d %d %d %d\
-stroke $select_color -strokewidth 1 -tags %s\n",
x->x_gui.x_glist, x->x_gui.x_obj.te_xpix, x->x_gui.x_obj.te_ypix,
x->x_gui.x_obj.te_xpix + x->x_gui.x_w,
x->x_gui.x_obj.te_ypix + x->x_gui.x_h, sh->h_outlinetag);
......
......@@ -16,6 +16,8 @@ to be different but are now unified except for some fossilized names.) */
#include <string.h>
extern int do_not_redraw;
extern void canvas_drawconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, t_int tag, int issignal);
extern void canvas_updateconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, t_int tag);
/* LATER consider adding font size to this struct (see glist_getfont()) */
struct _canvasenvironment
......@@ -811,7 +813,8 @@ void canvas_map(t_canvas *x, t_floatarg f)
{
/* just clear out the whole canvas */
sys_vgui(".x%lx.c dtag all selected\n", x);
sys_vgui(".x%lx.c delete all\n", x);
//sys_vgui(".x%lx.c delete all\n", x);
sys_vgui("foreach item [.x%lx.c find withtag {(!root)}] { .x%lx.c delete $item }\n", x, x);
x->gl_mapped = 0;
}
}
......@@ -934,11 +937,12 @@ static void canvas_drawlines(t_canvas *x)
{
issignal = (outlet_getsymbol(t.tr_outlet) == &s_signal ? 1 : 0);
if (!(pd_class(&t.tr_ob2->ob_g.g_pd) == preset_node_class && pd_class(&t.tr_ob->ob_g.g_pd) != message_class))
sys_vgui(".x%lx.c create line %d %d %d %d -width %s -fill %s \
canvas_drawconnection(glist_getcanvas(x), t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, (t_int)oc, issignal);
/*sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %s -stroke %s \
-tags {l%lx all_cords}\n",
glist_getcanvas(x), t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2,
(issignal ? "$signal_cord_width" : "$msg_cord_width"), (issignal ? "$signal_cord" : "$msg_cord"),
oc);
oc);*/
}
}
......@@ -952,9 +956,10 @@ void canvas_fixlinesfor(t_canvas *x, t_text *text)
{
if (t.tr_ob == text || t.tr_ob2 == text)
{
sys_vgui(".x%lx.c coords l%lx %d %d %d %d\n",
/*sys_vgui(".x%lx.c coords l%lx %d %d %d %d\n",
glist_getcanvas(x), oc,
t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2);
t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2);*/
canvas_updateconnection(x, t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, (t_int)oc);
}
}
}
......
This diff is collapsed.
......@@ -800,8 +800,8 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
//}
//fprintf(stderr,"tgt=.x%lx %d\n", (t_int)tgt, exception);
if (vis && canvas_showtext(x) && gobj_shouldvis(gr, parent_glist))
rtext_draw(glist_findrtext(parent_glist, &x->gl_obj));
if (vis && canvas_showtext(x) && gobj_shouldvis(gr, parent_glist))
rtext_draw(glist_findrtext(parent_glist, &x->gl_obj));
graph_getrect(gr, parent_glist, &x1, &y1, &x2, &y2);
//fprintf(stderr,"%d %d %d %d\n", x1, y1, x2, y2);
if (!vis)
......@@ -816,11 +816,11 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
{
if (vis && gobj_shouldvis(gr, parent_glist))
{
sys_vgui(".x%lx.c create polygon\
%d %d %d %d %d %d %d %d %d %d -tags {%sfill %s} -fill $graph_outline\n",
sys_vgui(".x%lx.c create ppolygon\
%d %d %d %d %d %d %d %d %d %d -tags {%sfill} -fill $graph_outline\n",
glist_getcanvas(x->gl_owner),
//parent_glist,
x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag, tag);
x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag);
}
else if (gobj_shouldvis(gr, parent_glist))
{
......@@ -839,10 +839,14 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
t_symbol *arrayname;
t_garray *ga;
/* draw a rectangle around the graph */
sys_vgui(".x%lx.c create line\
%d %d %d %d %d %d %d %d %d %d -fill $graph_outline -tags {%sR %s}\n",
/*sys_vgui(".x%lx.c create polyline\
%d %d %d %d %d %d %d %d %d %d -stroke $graph_outline -tags {%sR %s}\n",
glist_getcanvas(x->gl_owner),
x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag, tag);
x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag, tag);*/
sys_vgui(".x%lx.c create prect\
%d %d %d %d -stroke $graph_outline -tags {%sR}\n",
glist_getcanvas(x->gl_owner),
x1, y1, x2, y2, tag);
/* if there's just one "garray" in the graph, write its name
along the top */
......@@ -853,7 +857,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
//i -= sys_fontheight(glist_getfont(x));
i++;
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor nw\
-font {{%s} %d %s} -tags %s -fill %s\n",
-font {{%s} %d %s} -tags {%s} -fill %s\n",
(long)glist_getcanvas(x), x1+2, i, arrayname->s_name, sys_font,
sys_hostfontsize(glist_getfont(x)), sys_fontweight, tag,
(glist_isselected(x, gr) ? "$select_color" : "$graph_outline"));
......@@ -872,11 +876,11 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
f += x->gl_xtick.k_inc)
{
int tickpix = (i % x->gl_xtick.k_lperb ? 2 : 4);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
(int)glist_xtopixels(x, f), (int)upix,
(int)glist_xtopixels(x, f), (int)upix - tickpix, tag);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
(int)glist_xtopixels(x, f), (int)lpix,
(int)glist_xtopixels(x, f), (int)lpix + tickpix, tag);
......@@ -886,11 +890,11 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
i++, f -= x->gl_xtick.k_inc)
{
int tickpix = (i % x->gl_xtick.k_lperb ? 2 : 4);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
(int)glist_xtopixels(x, f), (int)upix,
(int)glist_xtopixels(x, f), (int)upix - tickpix, tag);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
(int)glist_xtopixels(x, f), (int)lpix,
(int)glist_xtopixels(x, f), (int)lpix + tickpix, tag);
......@@ -909,11 +913,11 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
i++, f += x->gl_ytick.k_inc)
{
int tickpix = (i % x->gl_ytick.k_lperb ? 2 : 4);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
x1, (int)glist_ytopixels(x, f),
x1 + tickpix, (int)glist_ytopixels(x, f), tag);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
x2, (int)glist_ytopixels(x, f),
x2 - tickpix, (int)glist_ytopixels(x, f), tag);
......@@ -923,11 +927,11 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
i++, f -= x->gl_ytick.k_inc)
{
int tickpix = (i % x->gl_ytick.k_lperb ? 2 : 4);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
x1, (int)glist_ytopixels(x, f),
x1 + tickpix, (int)glist_ytopixels(x, f), tag);
sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -tags %s\n",
glist_getcanvas(x->gl_owner),
x2, (int)glist_ytopixels(x, f),
x2 - tickpix, (int)glist_ytopixels(x, f), tag);
......@@ -936,7 +940,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
/* draw x labels */
for (i = 0; i < x->gl_nxlabels; i++)
sys_vgui(".x%lx.c create text\
%d %d -text {%s} -font {{%s} %d %s} -tags %s\n",
%d %d -text {%s} -font {{%s} %d %s} -tags {%s}\n",
glist_getcanvas(x),
(int)glist_xtopixels(x, atof(x->gl_xlabel[i]->s_name)),
(int)glist_ytopixels(x, x->gl_xlabely),
......@@ -946,7 +950,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
/* draw y labels */
for (i = 0; i < x->gl_nylabels; i++)
sys_vgui(".x%lx.c create text\
%d %d -text {%s} -font {{%s} %d %s} -tags %s\n",
%d %d -text {%s} -font {{%s} %d %s} -tags {%s}\n",
glist_getcanvas(x),
(int)glist_xtopixels(x, x->gl_ylabelx),
(int)glist_ytopixels(x, atof(x->gl_ylabel[i]->s_name)),
......@@ -1189,18 +1193,18 @@ static void graph_select(t_gobj *z, t_glist *glist, int state)
canvas = glist;
}
if(glist_istoplevel(glist)) {
sys_vgui(".x%lx.c itemconfigure %sR -fill %s\n", canvas,
sys_vgui(".x%lx.c itemconfigure %sR -stroke %s\n", canvas,
rtext_gettag(y), (state? "$select_color" : "$graph_outline"));
/*
sys_vgui(".x%lx.c itemconfigure graph%lx -fill %s\n",
glist_getcanvas(glist), z,
(state? "$select_color" : "$graph_outline"));
*/
sys_vgui(".x%lx.c itemconfigure %s -fill %s\n",
sys_vgui(".x%lx.c itemconfigure %sT -fill %s\n",
canvas, rtext_gettag(y),
(state? "$select_color" : "$graph_outline"));
sys_vgui(".x%lx.c itemconfigure %sfill -fill %s\n",
sys_vgui(".x%lx.c itemconfigure %sfill -stroke %s\n",
canvas, rtext_gettag(y),
(state? "$select_color" : "$graph_outline"));
}
......
......@@ -45,10 +45,10 @@ void hradio_draw_update(t_gobj *client, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n",
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -stroke #%6.6x\n",
canvas, x, x->x_drawn,
x->x_gui.x_bcol, x->x_gui.x_bcol);
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n",
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -stroke #%6.6x\n",
canvas, x, x->x_on,
x->x_gui.x_fcol, x->x_gui.x_fcol);
x->x_drawn = x->x_on;
......@@ -86,10 +86,10 @@ void hradio_draw_new(t_hradio *x, t_glist *glist)
for(i=0; i<n; i++)
{
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxHRDO %lx text}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxHRDO %lx text}\n",
canvas, xx11, yy11, xx11+dx, yy12,
x->x_gui.x_bcol, x, i, x, x);
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxBUT%d %lxHRDO %lx text}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -stroke #%6.6x -tags {%lxBUT%d %lxHRDO %lx text}\n",
canvas, xx21, yy21, xx22, yy22,
(x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol,
(x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, i, x, x);
......@@ -105,10 +105,10 @@ void hradio_draw_new(t_hradio *x, t_glist *glist)
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x, x);
if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %lx outlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %lx outlet}\n",
canvas, xx11b, yy12-1, xx11b + IOWIDTH, yy12, x, nlet_tag, 0, nlet_tag, 0, x, x);
if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %lx inlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %lx inlet}\n",
canvas, xx11b, yy11, xx11b + IOWIDTH, yy11+1, x, nlet_tag, 0, nlet_tag, 0, x, x);
//}
}
......@@ -217,7 +217,7 @@ void hradio_draw_config(t_hradio* x, t_glist* glist)
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
for(i=0; i<n; i++)
{
sys_vgui(".x%lx.c itemconfigure %lxBASE%d -fill #%6.6x\n .x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n",
sys_vgui(".x%lx.c itemconfigure %lxBASE%d -fill #%6.6x\n .x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -stroke #%6.6x\n",
canvas, x, i, x->x_gui.x_bcol, canvas, x, i,
(x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol,
(x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol);
......@@ -249,7 +249,7 @@ void hradio_draw_io(t_hradio* x, t_glist* glist, int old_snd_rcv_flags)
else nlet_tag = "bogus";
if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %lx outlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%so%d %so%d %lxHRDO %lx outlet}\n",
canvas,
xpos, ypos + x->x_gui.x_w-1,
xpos + IOWIDTH, ypos + x->x_gui.x_w,
......@@ -257,7 +257,7 @@ void hradio_draw_io(t_hradio* x, t_glist* glist, int old_snd_rcv_flags)
if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c delete %lxHRDO%so%d\n", canvas, x, nlet_tag, 0);
if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %lx inlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHRDO%si%d %si%d %lxHRDO %lx inlet}\n",
canvas,
xpos, ypos,
xpos + IOWIDTH, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x);
......@@ -283,7 +283,7 @@ void hradio_draw_select(t_hradio* x, t_glist* glist)
for(i=0; i<n; i++)
{
sys_vgui(".x%lx.c itemconfigure %lxBASE%d -outline $select_color\n", canvas, x, i);
sys_vgui(".x%lx.c itemconfigure %lxBASE%d -stroke $select_color\n", canvas, x, i);
}
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x);
......@@ -337,7 +337,7 @@ void hradio_draw_select(t_hradio* x, t_glist* glist)
sys_vgui(".x%lx.c dtag %lxHRDO selected\n", canvas, x);
for(i=0; i<n; i++)
{
sys_vgui(".x%lx.c itemconfigure %lxBASE%d -outline #%6.6x\n", canvas, x, i,
sys_vgui(".x%lx.c itemconfigure %lxBASE%d -stroke #%6.6x\n", canvas, x, i,
IEM_GUI_COLOR_NORMAL);
}
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill #%6.6x\n", canvas, x,
......@@ -412,8 +412,8 @@ static void hradio__clickhook(t_scalehandle *sh, t_floatarg f, t_floatarg xxx, t
if (glist_isvisible(x->x_gui.x_glist))
{
sys_vgui("lower %s\n", sh->h_pathname);
sys_vgui(".x%x.c create rectangle %d %d %d %d\
-outline $select_color -width 1 -tags %s\n",
sys_vgui(".x%x.c create prect %d %d %d %d\
-stroke $select_color -strokewidth 1 -tags %s\n",
x->x_gui.x_glist, x->x_gui.x_obj.te_xpix, x->x_gui.x_obj.te_ypix,
x->x_gui.x_obj.te_xpix + (x->x_gui.x_w * x->x_number),
x->x_gui.x_obj.te_ypix + x->x_gui.x_h, sh->h_outlinetag);
......
......@@ -49,12 +49,12 @@ static void hslider_draw_update(t_gobj *client, t_glist *glist)
int r = text_xpix(&x->x_gui.x_obj, glist) + 3 + (x->x_val + 50)/100;
sys_vgui(".x%lx.c coords %lxKNOB %d %d %d %d\n",
canvas, x, r, ypos+2,
r, ypos + x->x_gui.x_h-1);
r, ypos + x->x_gui.x_h-2);
if(x->x_val == x->x_center)
{
if(!x->x_thick)
{
sys_vgui(".x%lx.c itemconfigure %lxKNOB -width 7\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxKNOB -strokewidth 7\n", canvas, x);
x->x_thick = 1;
}
}
......@@ -62,7 +62,7 @@ static void hslider_draw_update(t_gobj *client, t_glist *glist)
{
if(x->x_thick)
{
sys_vgui(".x%lx.c itemconfigure %lxKNOB -width 3\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxKNOB -strokewidth 3\n", canvas, x);
x->x_thick = 0;
}
}
......@@ -96,13 +96,13 @@ static void hslider_draw_new(t_hslider *x, t_glist *glist)
if (yyyy) nlet_tag = rtext_gettag(yyyy);
else nlet_tag = "bogus";
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxHSLDR %lx text}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxHSLDR %lx text}\n",
canvas, xpos, ypos,
xpos + x->x_gui.x_w+5, ypos + x->x_gui.x_h,
x->x_gui.x_bcol, x, x, x);
sys_vgui(".x%lx.c create line %d %d %d %d -width 3 -fill #%6.6x -tags {%lxKNOB %lxHSLDR %lx text}\n",
sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth 3 -stroke #%6.6x -tags {%lxKNOB %lxHSLDR %lx text}\n",
canvas, r, ypos+2, r,
ypos + x->x_gui.x_h-1, x->x_gui.x_fcol, x, x, x);
ypos + x->x_gui.x_h-2, x->x_gui.x_fcol, x, x, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} -%d %s} -fill #%6.6x -tags {%lxLABEL %lxHSLDR %lx text}\n",
canvas, xpos+x->x_gui.x_ldx,
......@@ -111,11 +111,11 @@ static void hslider_draw_new(t_hslider *x, t_glist *glist)
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x, x);
if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %lx outlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %lx outlet}\n",
canvas, xpos, ypos + x->x_gui.x_h-1,
xpos+7, ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x);
if(!x->x_gui.x_fsf.x_rcv_able && canvas == x->x_gui.x_glist)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %lx inlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %lx inlet}\n",
canvas, xpos, ypos,
xpos+7, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x);
//}
......@@ -149,7 +149,7 @@ static void hslider_draw_move(t_hslider *x, t_glist *glist)
xpos + x->x_gui.x_w+5, ypos + x->x_gui.x_h);
sys_vgui(".x%lx.c coords %lxKNOB %d %d %d %d\n",
canvas, x, r, ypos+2,
r, ypos + x->x_gui.x_h-1);
r, ypos + x->x_gui.x_h-2);
sys_vgui(".x%lx.c coords %lxLABEL %d %d\n",
canvas, x, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy);
if(!x->x_gui.x_fsf.x_snd_able && canvas == x->x_gui.x_glist)
......@@ -215,7 +215,7 @@ static void hslider_draw_config(t_hslider* x,t_glist* glist)
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%lx.c itemconfigure %lxKNOB -fill #%6.6x\n .x%lx.c itemconfigure %lxBASE -fill #%6.6x\n",
sys_vgui(".x%lx.c itemconfigure %lxKNOB -stroke #%6.6x\n .x%lx.c itemconfigure %lxBASE -fill #%6.6x\n",
canvas, x, x->x_gui.x_fcol, canvas, x, x->x_gui.x_bcol);
//sys_vgui(".x%lx.c itemconfigure %lxBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_bcol);
}
......@@ -242,13 +242,13 @@ static void hslider_draw_io(t_hslider* x,t_glist* glist, int old_snd_rcv_flags)
else nlet_tag = "bogus";
if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %lx outlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%so%d %so%d %lxHSLDR %lx outlet}\n",
canvas, xpos, ypos + x->x_gui.x_h-1,
xpos+7, ypos + x->x_gui.x_h, x, nlet_tag, 0, nlet_tag, 0, x, x);
if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c delete %lxHSLDR%so%d\n", canvas, x, nlet_tag, 0);
if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %lx inlet}\n",
sys_vgui(".x%lx.c create prect %d %d %d %d -tags {%lxHSLDR%si%d %si%d %lxHSLDR %lx inlet}\n",
canvas, xpos, ypos,
xpos+7, ypos+1, x, nlet_tag, 0, nlet_tag, 0, x, x);
if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able)
......@@ -270,7 +270,7 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist)
// if so, disable highlighting
if (x->x_gui.x_glist == glist_getcanvas(glist)) {
sys_vgui(".x%lx.c itemconfigure %lxBASE -outline $select_color\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke $select_color\n", canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n", canvas, x);
if (x->x_gui.scale_vis) {
......@@ -321,7 +321,7 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist)
}
else
{
sys_vgui(".x%lx.c itemconfigure %lxBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%lx.c itemconfigure %lxBASE -stroke #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol);
sys_vgui(".x%lx.c dtag %lxHSLDR selected\n", canvas, x);
sys_vgui("destroy %s\n", sh->h_pathname);
......@@ -401,8 +401,8 @@ static void hslider__clickhook(t_scalehandle *sh, t_floatarg f, t_floatarg xxx,
if (glist_isvisible(x->x_gui.x_glist))
{
sys_vgui("lower %s\n", sh->h_pathname);
sys_vgui(".x%x.c create rectangle %d %d %d %d\
-outline $select_color -width 1 -tags %s\n",
sys_vgui(".x%x.c create prect %d %d %d %d\
-stroke $select_color -strokewidth 1 -tags %s\n",
x->x_gui.x_glist, x->x_gui.x_obj.te_xpix, x->x_gui.x_obj.te_ypix,
x->x_gui.x_obj.te_xpix + 5 + x->x_gui.x_w,
x->x_gui.x_obj.te_ypix + x->x_gui.x_h, sh->h_outlinetag);
......
......@@ -112,9 +112,9 @@ void magicGlass_updateText(t_magicGlass *x, int moved)
void magicGlass_drawNew(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_drawNew\n");
sys_vgui(".x%x.c create rectangle 0 0 0 0 -outline #000000 -fill #000000 -tags magicGlassBg\n",
sys_vgui(".x%x.c create prect 0 0 0 0 -stroke #000000 -fill #000000 -tags magicGlassBg\n",
x->x_c);
sys_vgui(".x%x.c create polygon 0 0 0 0 0 0 -fill #000000 -width 4 -tags magicGlassLine\n",
sys_vgui(".x%x.c create ppolygon 0 0 0 0 0 0 -fill #000000 -strokewidth 4 -tags magicGlassLine\n",
x->x_c);
sys_vgui(".x%x.c create text 0 0 -text {} -anchor w -fill #e87216 -font {{%s} -%d %s} -tags magicGlassText\n",
x->x_c,