Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11561
Modified Files: Tag: desiredata desire.c desire.h Log Message: 0.40: part of the hidename code
Index: desire.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v retrieving revision 1.1.2.49.2.5 retrieving revision 1.1.2.49.2.6 diff -C2 -d -r1.1.2.49.2.5 -r1.1.2.49.2.6 *** desire.h 8 Dec 2006 04:19:52 -0000 1.1.2.49.2.5 --- desire.h 8 Dec 2006 09:17:55 -0000 1.1.2.49.2.6 *************** *** 229,233 **** #endif t_scalar *scalar; /* scalar "containing" the array */ ! t_canvas *canvas; /* containing canvas */ t_symbol *name; /* unexpanded name (possibly with leading '$') */ t_symbol *realname; /* expanded name (symbol we're bound to) */ --- 229,233 ---- #endif t_scalar *scalar; /* scalar "containing" the array */ ! t_canvas *canvas; /* containing canvas */ t_symbol *name; /* unexpanded name (possibly with leading '$') */ t_symbol *realname; /* expanded name (symbol we're bound to) */ *************** *** 235,238 **** --- 235,239 ---- char saveit; /* true if we should save this with parent */ char listviewing; /* true if list view window is open */ + char hidename; /* don't print name above graph */ };
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.43 retrieving revision 1.1.2.217.2.44 diff -C2 -d -r1.1.2.217.2.43 -r1.1.2.217.2.44 *** desire.c 8 Dec 2006 08:04:22 -0000 1.1.2.217.2.43 --- desire.c 8 Dec 2006 09:17:53 -0000 1.1.2.217.2.44 *************** *** 1598,1602 **** }
! t_symbol *garray_getname(t_garray *x) {return x->realname;}
/* if there is one garray in a graph, reset the graph's coordinates --- 1598,1608 ---- }
! /* get the array's name. Return nonzero if it should be hidden */ ! int garray_getname(t_garray *x, t_symbol **namep) { ! // *namep = x->name; ! *namep = x->realname; ! return x->hidename; ! } !
/* if there is one garray in a graph, reset the graph's coordinates *************** *** 1738,1743 **** }
! void garray_arrayviewlist_fillpage(t_garray *x, t_float page) { ! int yonset=0, elemsize=0; float yval; t_array *a = garray_getarray_floatonly(x, &yonset, &elemsize); --- 1744,1749 ---- }
! void garray_arrayviewlist_fillpage(t_garray *x, t_float page, t_float fTopItem) { ! int yonset=0, elemsize=0, topItem=(int)fTopItem; float yval; t_array *a = garray_getarray_floatonly(x, &yonset, &elemsize); *************** *** 1755,1758 **** --- 1761,1765 ---- sys_vgui(".%sArrayWindow.lb insert %d {%d) %g}\n", x->realname->s_name, i%ARRAYPAGESIZE, i, yval); } + sys_vgui(".%sArrayWindow.lb yview %d\n", x->realname->s_name, topItem); }
*************** *** 2258,2262 **** class_addmethod3(c, garray_arraydialog, "arraydialog", "sfff"); class_addmethod3(c, garray_arrayviewlist_new, "arrayviewlistnew", ""); ! class_addmethod3(c, garray_arrayviewlist_fillpage, "arrayviewlistfillpage", "f"); class_addmethod3(c, garray_arrayviewlist_close, "arrayviewclose", ""); class_setsavefn(garray_class, garray_save); --- 2265,2269 ---- class_addmethod3(c, garray_arraydialog, "arraydialog", "sfff"); class_addmethod3(c, garray_arrayviewlist_new, "arrayviewlistnew", ""); ! class_addmethod3(c, garray_arrayviewlist_fillpage, "arrayviewlistfillpage", "fF"); class_addmethod3(c, garray_arrayviewlist_close, "arrayviewclose", ""); class_setsavefn(garray_class, garray_save); *************** *** 2572,2577 **** /* --------------------------- widget behavior ------------------- */
- t_symbol *garray_getname(t_garray *x); - #define FONT "-*-courier-bold--normal--%d-*"
--- 2579,2582 ---- *************** *** 2593,2597 **** return; } - int i; float f; /* draw a rectangle around the graph */ --- 2598,2601 ---- *************** *** 2599,2609 **** (long)c, x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag); /* if there's just one "garray" in the graph, write its name along the top */ ! t_gobj *g = x->list; ! if (g && !g->g_next && g->_class == garray_class) { ! int ymin = y1<y2 ? y1 : y2; ! t_symbol *s = garray_getname((t_garray *)g); ! sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor sw -font "FONT" -tags %s\n", ! (long)c, x1, ymin, s->s_name, 42 /*sys_hostfontsize(canvas_getfont(x))*/, tag); } /* draw ticks on horizontal borders. If lperb field is zero, this is disabled. */ #define DRAWTICK(x1,y1,x2,y2) sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", \ --- 2603,2616 ---- (long)c, x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag); /* if there's just one "garray" in the graph, write its name along the top */ ! int i = min(y1,y2)-1; ! t_symbol *arrayname; ! canvas_each(g,x) if (g->g_pd == garray_class && !garray_getname((t_garray *)g, &arrayname)) { ! // i -= sys_fontheight(glist_getfont(x)); ! sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor nw\ ! -font -*-courier-bold--normal--%d-* -tags %s\n", ! (long)canvas_getcanvas(x), x1, i, arrayname->s_name, ! 42/*sys_hostfontsize(canvas_getfont(x))*/, tag); } + /* draw ticks on horizontal borders. If lperb field is zero, this is disabled. */ #define DRAWTICK(x1,y1,x2,y2) sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", \