Commit 7ecac259 authored by Ivica Ico Bukvic's avatar Ivica Ico Bukvic
Browse files

updated iemgui objects to support tooltips, improved text tooltip detection, minor code clean-ups.

parent c05257ed
......@@ -72,29 +72,29 @@ 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}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxBNG text}\n",
canvas, xpos, ypos,
xpos + x->x_gui.x_w, ypos + x->x_gui.x_h,
x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create oval %d %d %d %d -fill #%6.6x -tags {%lxBUT %lxBNG}\n",
sys_vgui(".x%lx.c create oval %d %d %d %d -fill #%6.6x -tags {%lxBUT %lxBNG text}\n",
canvas, xpos+1, ypos+1,
xpos + x->x_gui.x_w-1, ypos + x->x_gui.x_h-1,
x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, 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}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxBNG text}\n",
canvas, xpos+x->x_gui.x_ldx,
ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able) {
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxBNG}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxBNG outlet}\n",
canvas, xpos,
ypos + x->x_gui.x_h-1, xpos + IOWIDTH,
ypos + x->x_gui.x_h, nlet_tag, 0, x);
}
if(!x->x_gui.x_fsf.x_rcv_able) {
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxBNG}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxBNG inlet}\n",
canvas, xpos, ypos,
xpos + IOWIDTH, ypos+1, nlet_tag, 0, x);
}
......
......@@ -4808,18 +4808,17 @@ static void canvas_enterobj(t_canvas *x, t_symbol *item, t_floatarg xpos,
t_floatarg ypos, t_floatarg xletno)
{
if (x->gl_editor->e_onmotion == MA_MOVE) { return; }
//fprintf(stderr,"canvas_enterobj\n");
t_symbol *name = 0, *helpname, *dir;
int yoffset = 0, xoffset = 0;
if (item == gensym("inlet"))
{
yoffset = 1;
yoffset = 1;
xoffset = xletno==0 ? 1 : -1;
}
else if (item == gensym("outlet"))
{
yoffset = -1;
xoffset = xletno== 0 ? 1 : -1;
yoffset = -1;
xoffset = xletno== 0 ? 1 : -1;
}
int x1, y1, x2, y2;
t_gobj *g;
......@@ -4827,19 +4826,19 @@ static void canvas_enterobj(t_canvas *x, t_symbol *item, t_floatarg xpos,
&x1, &y1, &x2, &y2))
{
if (pd_class((t_pd *)g)==canvas_class ?
canvas_isabstraction((t_canvas *)g) : 0)
{
t_canvas *z = (t_canvas *)g;
name = z->gl_name;
helpname = z->gl_name;
dir = canvas_getdir(z);
}
else
{
name = g->g_pd->c_name;
helpname = g->g_pd->c_helpname;
dir = g->g_pd->c_externdir;
}
canvas_isabstraction((t_canvas *)g) : 0)
{
t_canvas *z = (t_canvas *)g;
name = z->gl_name;
helpname = z->gl_name;
dir = canvas_getdir(z);
}
else
{
name = g->g_pd->c_name;
helpname = g->g_pd->c_helpname;
dir = g->g_pd->c_externdir;
}
sys_vgui("pdtk_gettip .x%lx.c %s %d \
[list %s] [list %s] [list %s]\n",
x, item->s_name, (int)xletno,
......
......@@ -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}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxHRDO text}\n",
canvas, xx11, yy11, xx11+dx, yy12,
x->x_gui.x_bcol, x, i, x);
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxBUT%d %lxHRDO}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxBUT%d %lxHRDO 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);
......@@ -99,16 +99,16 @@ void hradio_draw_new(t_hradio *x, t_glist *glist)
x->x_drawn = x->x_on;
}
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxHRDO}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxHRDO text}\n",
canvas, xx11b+x->x_gui.x_ldx, yy11+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxHRDO}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxHRDO outlet}\n",
canvas, xx11b, yy12-1, xx11b + IOWIDTH, yy12, nlet_tag, 0, x);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxHRDO}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxHRDO inlet}\n",
canvas, xx11b, yy11, xx11b + IOWIDTH, yy11+1, nlet_tag, 0, x);
//}
}
......
......@@ -93,26 +93,26 @@ 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}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxHSLDR text}\n",
canvas, xpos-3, ypos,
xpos + x->x_gui.x_w+2, ypos + x->x_gui.x_h,
x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create line %d %d %d %d -width 3 -fill #%6.6x -tags {%lxKNOB %lxHSLDR}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width 3 -fill #%6.6x -tags {%lxKNOB %lxHSLDR text}\n",
canvas, r, ypos+1, r,
ypos + x->x_gui.x_h, x->x_gui.x_fcol, 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}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxHSLDR text}\n",
canvas, xpos+x->x_gui.x_ldx,
ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxHSLDR}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxHSLDR outlet}\n",
canvas, xpos-3, ypos + x->x_gui.x_h-1,
xpos+4, ypos + x->x_gui.x_h, nlet_tag, 0, x);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxHSLDR}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxHSLDR inlet}\n",
canvas, xpos-3, ypos,
xpos+4, ypos+1, nlet_tag, 0, x);
//}
......
......@@ -49,16 +49,16 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist)
//if (glist_isvisible(glist)) {
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxRECT %lxMYCNV}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxRECT %lxMYCNV text}\n",
canvas, xpos, ypos,
xpos + x->x_vis_w, ypos + x->x_vis_h,
x->x_gui.x_bcol, x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create rectangle %d %d %d %d -outline #%6.6x -tags {%lxBASE %lxMYCNV}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -outline #%6.6x -tags {%lxBASE %lxMYCNV text}\n",
canvas, xpos, ypos,
xpos + x->x_gui.x_w, ypos + x->x_gui.x_h,
x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxMYCNV}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxMYCNV text}\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
......
......@@ -215,7 +215,7 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist)
sys_vgui(
".x%lx.c create polygon %d %d %d %d %d %d %d %d %d %d -outline #%6.6x \
-fill #%6.6x -tags {%lxBASE1 %lxNUM}\n",
-fill #%6.6x -tags {%lxBASE1 %lxNUM text}\n",
canvas, xpos, ypos,
xpos + x->x_numwidth-4, ypos,
xpos + x->x_numwidth, ypos+4,
......@@ -223,31 +223,31 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist)
xpos, ypos + x->x_gui.x_h,
IEM_GUI_COLOR_NORMAL, x->x_gui.x_bcol, x, x);
sys_vgui(
".x%lx.c create line %d %d %d %d %d %d -fill #%6.6x -tags {%lxBASE2 %lxNUM}\n",
".x%lx.c create line %d %d %d %d %d %d -fill #%6.6x -tags {%lxBASE2 %lxNUM text}\n",
canvas, xpos, ypos,
xpos + half, ypos + half,
xpos, ypos + x->x_gui.x_h,
x->x_gui.x_fcol, x, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxNUM}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxNUM text}\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
my_numbox_ftoa(x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxNUMBER %lxNUM noscroll}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxNUMBER %lxNUM noscroll text}\n",
canvas, xpos+half+2, ypos+half+d,
x->x_buf, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxNUM}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxNUM outlet}\n",
canvas,
xpos, ypos + x->x_gui.x_h-1,
xpos+IOWIDTH, ypos + x->x_gui.x_h,
nlet_tag, 0, x);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxNUM}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxNUM inlet}\n",
canvas,
xpos, ypos,
xpos+IOWIDTH, ypos+1,
......
......@@ -79,27 +79,27 @@ void toggle_draw_new(t_toggle *x, t_glist *glist)
w = 2;
if(x->x_gui.x_w >= 60)
w = 3;
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxTGL}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxTGL text}\n",
canvas, xx, yy, xx + x->x_gui.x_w, yy + x->x_gui.x_h,
x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxX1 %lxTGL}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxX1 %lxTGL text}\n",
canvas, xx+w+1, yy+w+1, xx + x->x_gui.x_w-w, yy + x->x_gui.x_h-w, w,
(x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxX2 %lxTGL}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxX2 %lxTGL text}\n",
canvas, xx+w+1, yy + x->x_gui.x_h-w-1, xx + x->x_gui.x_w-w, yy+w, w,
(x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxTGL}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxTGL text}\n",
canvas, xx+x->x_gui.x_ldx,
yy+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxTGL}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxTGL outlet}\n",
canvas, xx, yy + x->x_gui.x_h-1, xx + IOWIDTH, yy + x->x_gui.x_h, nlet_tag, 0, x);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxTGL}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxTGL inlet}\n",
canvas, xx, yy, xx + IOWIDTH, yy+1, nlet_tag, 0, x);
//}
}
......
......@@ -84,10 +84,10 @@ void vradio_draw_new(t_vradio *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 %lxVRDO}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE%d %lxVRDO text}\n",
canvas, xx11, yy11, xx12, yy12,
x->x_gui.x_bcol, x, i, x);
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxBUT%d %lxVRDO}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxBUT%d %lxVRDO 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);
......@@ -98,16 +98,16 @@ void vradio_draw_new(t_vradio *x, t_glist *glist)
x->x_drawn = x->x_on;
}
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxVRDO}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxVRDO text}\n",
canvas, xx11+x->x_gui.x_ldx, yy11b+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVRDO}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVRDO outlet}\n",
canvas, xx11, yy11-1, xx11 + IOWIDTH, yy11, nlet_tag, 0, x);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVRDO}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVRDO inlet}\n",
canvas, xx11, yy11b, xx11 + IOWIDTH, yy11b+1, nlet_tag, 0, x);
//}
}
......
......@@ -76,27 +76,27 @@ static void vslider_draw_new(t_vslider *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 %lxVSLDR}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxVSLDR text}\n",
canvas, xpos, ypos-2,
xpos + x->x_gui.x_w, ypos + x->x_gui.x_h+3,
x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create line %d %d %d %d -width 3 -fill #%6.6x -tags {%lxKNOB %lxVSLDR}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width 3 -fill #%6.6x -tags {%lxKNOB %lxVSLDR text}\n",
canvas, xpos+1, r,
xpos + x->x_gui.x_w, r, x->x_gui.x_fcol, x, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxVSLDR}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxVSLDR text}\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVSLDR}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVSLDR outlet}\n",
canvas,
xpos, ypos + x->x_gui.x_h+2,
xpos+7, ypos + x->x_gui.x_h+3,
nlet_tag, 0, x);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVSLDR}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVSLDR inlet}\n",
canvas,
xpos, ypos-2,
xpos+7, ypos-1,
......
......@@ -131,7 +131,7 @@ static void vu_draw_new(t_vu *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 %lxVU}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -tags {%lxBASE %lxVU text}\n",
canvas, xpos-1, ypos-2,
xpos+x->x_gui.x_w+1,
ypos+x->x_gui.x_h+2, x->x_gui.x_bcol, x, x);
......@@ -139,11 +139,11 @@ static void vu_draw_new(t_vu *x, t_glist *glist)
{
led_col = iemgui_vu_col[i];
yyy = k4 + k1*(k2-i);
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxRLED%d %lxVU}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxRLED%d %lxVU text}\n",
canvas, quad1, yyy, quad3, yyy, x->x_led_size, iemgui_color_hex[led_col], x, i, x);
if(((i+2)&3) && (x->x_scale))
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU text}\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i],
x->x_gui.x_font, x->x_gui.x_fontsize,
sys_fontweight, x->x_gui.x_lcol, x, i, x);
......@@ -153,31 +153,31 @@ static void vu_draw_new(t_vu *x, t_glist *glist)
i=IEM_VU_STEPS+1;
yyy = k4 + k1*(k2-i);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxSCALE%d %lxVU text}\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i], x->x_gui.x_font,
x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, i, x);
}
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxRCOVER %lxVU}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags {%lxRCOVER %lxVU text}\n",
canvas, quad1, ypos-1, quad3-1,
ypos-1 + k1*IEM_VU_STEPS, x->x_gui.x_bcol, x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxPLED %lxVU}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill #%6.6x -tags {%lxPLED %lxVU text}\n",
canvas, mid, ypos+10,
mid, ypos+10, x->x_led_size, x->x_gui.x_bcol, x, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxVU}\n",
-font {{%s} %d %s} -fill #%6.6x -tags {%lxLABEL %lxVU text}\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, x);
if(!x->x_gui.x_fsf.x_snd_able)
{
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVU}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVU outlet}\n",
canvas,
xpos-1, ypos + x->x_gui.x_h+1,
xpos + IOWIDTH-1, ypos + x->x_gui.x_h+2,
nlet_tag, 0, x);
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVU}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%so%d %lxVU outlet}\n",
canvas,
xpos+x->x_gui.x_w+1-IOWIDTH, ypos + x->x_gui.x_h+1,
xpos+x->x_gui.x_w+1, ypos + x->x_gui.x_h+2,
......@@ -185,12 +185,12 @@ static void vu_draw_new(t_vu *x, t_glist *glist)
}
if(!x->x_gui.x_fsf.x_rcv_able)
{
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVU}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVU inlet}\n",
canvas,
xpos-1, ypos-2,
xpos + IOWIDTH-1, ypos-1,
nlet_tag, 0, x);
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVU}\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%si%d %lxVU inlet}\n",
canvas,
xpos+x->x_gui.x_w+1-IOWIDTH, ypos-2,
xpos+x->x_gui.x_w+1, ypos-1,
......
......@@ -342,6 +342,7 @@ variable duplicate_tags -1
variable current_window 0
variable nlet_color 0
variable autotips 0
variable tooltip_visible 0
# x:y location tooltip during dragging
set tooltip [toplevel .tooltip -bd 1 -bg black]
......@@ -2083,6 +2084,7 @@ proc pdtk_canvas_new {name width height geometry editable} {
-yscrollcommand "$name.scrollvert set" \
-xscrollcommand "$name.scrollhort set" \
-scrollregion [concat 0 0 $width $height]
$name.c configure -closeenough 0.0
#pdtk_standardkeybindings $name.c
......@@ -3306,7 +3308,7 @@ proc pdtk_canvas_scroll {canvas xy distance} {
}
proc pdtk_canvas_motion {name x y mods} {
global pointer_x_local pointer_y_local pointer_x_global pointer_y_global
global pointer_x_local pointer_y_local pointer_x_global pointer_y_global tooltip_visible
set pointer_x_local $x
set pointer_y_local $y
set pointer_x_global [expr $pointer_x_local + [winfo rootx $name]]
......@@ -7111,7 +7113,8 @@ if { [info tclversion] >= 8.5 && $pd_nt == 0 } {
}
proc pdtk_canvas_enteritem_gettags {tkcanvas x y item enterid} {
proc pdtk_canvas_enteritem_gettags {tkcanvas x y item} {
#puts stderr "gettags $tkcanvas $x $y $item"
variable nlet_color
variable select_color
if {[winfo exists $tkcanvas]} {
......@@ -7142,6 +7145,7 @@ proc pdtk_canvas_enteritem_gettags {tkcanvas x y item enterid} {
}
proc pdtk_canvas_enteritem {tkcanvas x y item enterid} {
#puts stderr "enteritem $tkcanvas $x $y $item $enterid"
variable afterid
variable duplicate_tags
variable current_window
......@@ -7158,8 +7162,9 @@ proc pdtk_canvas_enteritem {tkcanvas x y item enterid} {
after cancel $afterid
}
set current_window $tkcanvas
set afterid [after 250 pdtk_canvas_enteritem_gettags \
$tkcanvas $x $y $item $enterid]
$tkcanvas $x $y $item]
}
}
......@@ -7189,12 +7194,15 @@ proc pdtk_canvas_leaveitem {w item} {
proc pdtk_tip {w fromc show args} {
variable select_color
variable nlet_color
variable tooltip_visible
set exists [winfo exists $w.tiplabel]
if {$show == 0} {
catch {destroy $w.tiplabel}
catch {$w delete $w.tipwindow}
catch {$w delete tiparrow}
set tooltip_visible 0
} else {
set tooltip_visible 1
if { $nlet_color == 0 } { set nlet_color $select_color }
if { $nlet_color ne $select_color } {
set fg "#ffffff"
......@@ -7304,6 +7312,7 @@ proc pdtk_tip_mouseover {w} {
}
proc pdtk_gettip { w item xletno name helpname dir } {
#puts stderr "pdtk_gettip $w $item $xletno $name $helpname $dir"
if {$dir eq {}} {
set dir $::sys_libdir/doc/5.reference
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment