Commit f82f3092 authored by Ivica Bukvic's avatar Ivica Bukvic Committed by Hans-Christoph Steiner
Browse files

Pd-0.42.5-extended-l2ork-dev-20110418.tar.bz2

parent d5a1d7fe
......@@ -350,6 +350,7 @@ t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templateargsym,
void canvas_menuarray(t_glist *canvas)
{
t_glist *x = (t_glist *)canvas;
pd_vmess(&x->gl_pd, gensym("editmode"), "i", 1);
char cmdbuf[200];
sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 3 1 .x%lx\n", gcount+1, (long unsigned int)canvas);
gfxstub_new(&x->gl_pd, x, cmdbuf);
......@@ -652,7 +653,6 @@ static t_float array_motion_xperpix;
static t_float array_motion_yperpix;
static int array_motion_lastx;
static int array_motion_fatten;
static t_garray* array_garray;
/* LATER protect against the template changing or the scalar disappearing
probably by attaching a gpointer here ... */
......@@ -662,7 +662,9 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy)
array_motion_xcumulative += dx * array_motion_xperpix;
array_motion_ycumulative += dy * array_motion_yperpix;
t_glist *graph = array_garray->x_glist;
// used to set up boundaries and update sends accordingly
t_glist *graph = NULL;
if (array_garray != NULL) graph = array_garray->x_glist;
if (array_motion_xfield)
{
......@@ -712,6 +714,7 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy)
(t_word *)(((char *)array_motion_wp) +
array_motion_elemsize * array_motion_lastx),
1);
if (graph) {
if (graph->gl_y1 > graph->gl_y2) {
if (newy > graph->gl_y1) newy = graph->gl_y1;
if (newy < graph->gl_y2) newy = graph->gl_y2;
......@@ -720,6 +723,7 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy)
if (newy < graph->gl_y1) newy = graph->gl_y1;
if (newy > graph->gl_y2) newy = graph->gl_y2;
}
}
//fprintf(stderr, "y = %f\n", newy);
t_float ydiff = newy - oldy;
if (thisx < 0) thisx = 0;
......@@ -747,7 +751,7 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy)
array_redraw(array_motion_array, array_motion_glist);
/* send a bang to the associated send to reflect the change via mouse click/drag */
if (array_garray->x_send->s_thing) pd_bang(array_garray->x_send->s_thing);
if (graph && array_garray->x_send->s_thing) pd_bang(array_garray->x_send->s_thing);
}
int scalar_doclick(t_word *data, t_template *template, t_scalar *sc,
......
......@@ -593,6 +593,7 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym,
/* call glist_addglist from a Pd message */
void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
{
pd_vmess(&g->gl_pd, gensym("editmode"), "i", 1);
t_symbol *sym = atom_getsymbolarg(0, argc, argv);
/* if we wish to put a graph where the mouse is we need to replace bogus name */
if (!strcmp(sym->s_name, "NULL")) sym = &s_;
......
......@@ -150,6 +150,9 @@ typedef struct _arrayvis
t_garray *av_garray; /* owning structure */
} t_arrayvis;
t_garray* array_garray; /* used for sending bangs when
array is changed via gui */
/* the t_tick structure describes where to draw x and y "ticks" for a glist */
typedef struct _tick /* where to put ticks on x or y axes */
......
......@@ -1776,6 +1776,12 @@ static int canvas_upx, canvas_upy;
void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
int mod, int doit)
{
/* here we make global array_garray pointer defined in g_canvas.h
point back to nothing--we use this pointer to pass information
to array_motion so that we can update corresponding send when
the array has been changed */
array_garray = NULL;
t_gobj *y;
int shiftmod, runmode, altmod, doublemod = 0, rightclick;
int x1=0, y1=0, x2=0, y2=0, clickreturned = 0;
......
......@@ -11,7 +11,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 42
#define PD_BUGFIX_VERSION 5
#define PD_TEST_VERSION "extended-l2ork-20110416"
#define PD_TEST_VERSION "extended-l2ork-20110418"
/* old name for "MSW" flag -- we have to take it for the sake of many old
"nmakefiles" for externs, which will define NT and not MSW */
......
Supports Markdown
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