Skip to content
Snippets Groups Projects
Commit e56126db authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

improved helplink (accelerated displace, proper selection color logic)

parent 2d667c00
No related branches found
No related tags found
Loading
......@@ -79,6 +79,18 @@ static void helplink_displace(t_gobj *z, t_glist *glist, int dx, int dy)
}
}
static void helplink_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy)
{
t_text *t = (t_text *)z;
t->te_xpix += dx;
t->te_ypix += dy;
/*if (glist_isvisible(glist))
{
t_rtext *y = glist_findrtext(glist, t);
rtext_displace(y, dx, dy);
}*/
}
static void helplink_select(t_gobj *z, t_glist *glist, int state)
{
t_helplink *x = (t_helplink *)z;
......@@ -86,13 +98,18 @@ static void helplink_select(t_gobj *z, t_glist *glist, int state)
rtext_select(y, state);
if (glist_isvisible(glist) && glist->gl_havewindow)
{
if (state)
sys_vgui(".x%lx.c itemconfigure %s -fill blue\n",
glist, rtext_gettag(y));
else
sys_vgui(".x%lx.c itemconfigure %s -text {%s} -fill #0000dd -activefill #e70000\n",
glist, rtext_gettag(y), x->x_vistext);
}
if (state) {
sys_vgui(".x%lx.c itemconfigure %s -fill $select_color\n",
glist, rtext_gettag(y));
sys_vgui(".x%lx.c addtag selected withtag %s\n",
glist, rtext_gettag(y));
} else {
sys_vgui(".x%lx.c itemconfigure %s -text {%s} -fill #0000dd -activefill #e70000\n",
glist, rtext_gettag(y), x->x_vistext);
sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", (t_int)glist_getcanvas(glist));
sys_vgui(".x%lx.c dtag %s selected\n", glist, rtext_gettag(y));
}
}
}
static void helplink_activate(t_gobj *z, t_glist *glist, int state)
......@@ -197,6 +214,7 @@ static t_widgetbehavior helplink_widgetbehavior =
0,
helplink_vis,
helplink_click,
helplink_displace_withtag,
};
void helplink_setup(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment