Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10855
Modified Files:
Tag: impd_0_37
g_bang.c g_canvas.c g_editor.c g_graph.c g_hdial.c g_hslider.c
g_mycanvas.c g_numbox.c g_rtext.c g_text.c g_toggle.c
g_vumeter.c u_object.tk
Log Message:
introducing sys_mgui() and more bugs
Index: g_toggle.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v
retrieving revision 1.1.1.3.2.2.2.5
retrieving revision 1.1.1.3.2.2.2.6
diff -C2 -d -r1.1.1.3.2.2.2.5 -r1.1.1.3.2.2.2.6
*** g_toggle.c 10 Mar 2004 06:00:11 -0000 1.1.1.3.2.2.2.5
--- g_toggle.c 28 Mar 2004 07:21:18 -0000 1.1.1.3.2.2.2.6
***************
*** 27,46 ****
void toggle_draw(t_toggle *x, t_glist *glist, int mode) {
- t_canvas *canvas=glist_getcanvas(glist);
switch(mode) {
! default:{
pd_upload((t_gobj *)x);
! sys_vgui("toggle_draw %x .x%x.c\n", x, canvas);
/* fallthru */
- }
case IEM_GUI_DRAW_MODE_UPDATE:
! if(glist_isvisible(glist))
! sys_vgui("toggle_set %x .x%x.c %d\n", x, canvas, x->x_on!=0.0);
break;
case IEM_GUI_DRAW_MODE_ERASE:
! sys_vgui("toggle_erase .x%x.c %x\n", canvas, x);
break;
case IEM_GUI_DRAW_MODE_SELECT:
! sys_vgui("toggle_select .x%x.c %x %d\n", canvas, x, x->x_gui.x_fsf.x_selected);
break;
}}
--- 27,43 ----
void toggle_draw(t_toggle *x, t_glist *glist, int mode) {
switch(mode) {
! default:
pd_upload((t_gobj *)x);
! sys_mgui((t_iemgui *)x,"toggle","draw","");
/* fallthru */
case IEM_GUI_DRAW_MODE_UPDATE:
! if(glist_isvisible(glist)) sys_mgui((t_iemgui *)x,"toggle","set","i",x->x_on!=0.0);
break;
case IEM_GUI_DRAW_MODE_ERASE:
! sys_mgui((t_iemgui *)x,"toggle","erase","");
break;
case IEM_GUI_DRAW_MODE_SELECT:
! sys_mgui((t_iemgui *)x,"toggle","erase","i",x->x_gui.x_fsf.x_selected);
break;
}}
***************
*** 183,205 ****
static void toggle_delta(t_toggle *x, t_symbol *s, int ac, t_atom *av)
{iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
-
static void toggle_pos(t_toggle *x, t_symbol *s, int ac, t_atom *av)
{iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
-
static void toggle_color(t_toggle *x, t_symbol *s, int ac, t_atom *av)
{iemgui_color((void *)x, &x->x_gui, s, ac, av);}
-
static void toggle_send(t_toggle *x, t_symbol *s)
{iemgui_send(x, &x->x_gui, s);}
-
static void toggle_receive(t_toggle *x, t_symbol *s)
{iemgui_receive(x, &x->x_gui, s);}
-
static void toggle_label(t_toggle *x, t_symbol *s)
{iemgui_label((void *)x, &x->x_gui, s);}
-
static void toggle_label_font(t_toggle *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
-
static void toggle_label_pos(t_toggle *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
--- 180,195 ----
***************
*** 215,223 ****
t_toggle *x = (t_toggle *)pd_new(toggle_class);
int bflcol[]={-262144, -1, -1};
! int a=IEM_GUI_DEFAULTSIZE, f=0;
int ldx=0, ldy=-6;
int fs=8;
float on=0.0, nonzero=1.0;
- char str[144];
int fstyle=0, isa=0;
t_symbol *srl[3]={0,0,0};
--- 205,212 ----
t_toggle *x = (t_toggle *)pd_new(toggle_class);
int bflcol[]={-262144, -1, -1};
! int a=IEM_GUI_DEFAULTSIZE;
int ldx=0, ldy=-6;
int fs=8;
float on=0.0, nonzero=1.0;
int fstyle=0, isa=0;
t_symbol *srl[3]={0,0,0};
***************
*** 231,239 ****
nonzero = (float)atom_getfloatarg(13, argc, argv);
x->x_gui.x_draw = (t_iemfunptr)toggle_draw;
- x->x_gui.x_fsf.x_snd_able = 1;
- x->x_gui.x_fsf.x_rcv_able = 1;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0;
! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
--- 220,226 ----
nonzero = (float)atom_getfloatarg(13, argc, argv);
x->x_gui.x_draw = (t_iemfunptr)toggle_draw;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.1.1.4.2.2.2.4
retrieving revision 1.1.1.4.2.2.2.5
diff -C2 -d -r1.1.1.4.2.2.2.4 -r1.1.1.4.2.2.2.5
*** g_text.c 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.2.2.4
--- g_text.c 28 Mar 2004 07:21:17 -0000 1.1.1.4.2.2.2.5
***************
*** 663,667 ****
{
*xp = x1 - 1;
! *yp = y1 - 1 - sys_fontheight(glist_getfont(glist));;
}
else
--- 663,667 ----
{
*xp = x1 - 1;
! *yp = y1 - 1 - sys_fontheight(glist_getfont(glist));
}
else
***************
*** 887,891 ****
rtext_select(y, state);
if (glist_isvisible(glist) && text_shouldvis(x, glist)) {
! sys_vgui("%s_select .x%x.c %s %d\n", text_classname(x), glist, rtext_gettag(y), state);
}
}
--- 887,891 ----
rtext_select(y, state);
if (glist_isvisible(glist) && text_shouldvis(x, glist)) {
! sys_vgui("%s_select %s .x%x.c %d\n", text_classname(x), rtext_gettag(y),glist, state);
}
}
***************
*** 1064,1069 ****
char *tag, int x1, int y1, int x2, int y2)
{
! sys_vgui("io_draw .x%x.c %s %d %d %d %d %d %d\n",
! glist_getcanvas(glist), tag, x1, y1, x2-x1, y2-x1,
obj_ninlets(ob), obj_noutlets(ob));
}
--- 1064,1069 ----
char *tag, int x1, int y1, int x2, int y2)
{
! sys_vgui("io_draw %s .x%x.c %d %d %d %d %d %d\n",
! tag, glist_getcanvas(glist), x1, y1, x2-x1, y2-x1,
obj_ninlets(ob), obj_noutlets(ob));
}
***************
*** 1076,1081 ****
text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
ob = pd_checkobject(&x->te_pd);
! sys_vgui("%s_draw .x%x.c %s %d %d %d %d %d %d\n",
! text_classname(x),glist,tag,x1,y1,x2-x1,y2-y1,
ob?obj_ninlets(ob):0, ob?obj_noutlets(ob):0);
}
--- 1076,1081 ----
text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
ob = pd_checkobject(&x->te_pd);
! sys_vgui("%s_draw %s .x%x.c %d %d %d %d %d %d\n",
! text_classname(x),tag,glist,x1,y1,x2-x1,y2-y1,
ob?obj_ninlets(ob):0, ob?obj_noutlets(ob):0);
}
***************
*** 1083,1093 ****
void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag)
{
! sys_vgui("io_erase .x%x.c %s\n",glist_getcanvas(glist),tag);
}
void text_eraseborder(t_text *x, t_glist *glist, char *tag)
{
! sys_vgui("%s_erase .x%x.c %s\n", text_classname(x), glist_getcanvas(glist), tag);
! sys_vgui("io_erase .x%x.c %s\n",glist_getcanvas(glist),tag);
}
--- 1083,1093 ----
void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag)
{
! sys_vgui("io_erase %s .x%x.c\n",tag,glist_getcanvas(glist));
}
void text_eraseborder(t_text *x, t_glist *glist, char *tag)
{
! sys_vgui("%s_erase %s .x%x.c\n", text_classname(x), tag,glist_getcanvas(glist));
! sys_vgui("io_erase %s .x%x.c\n",tag,glist_getcanvas(glist));
}
Index: g_hdial.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v
retrieving revision 1.1.1.4.2.2.2.6
retrieving revision 1.1.1.4.2.2.2.7
diff -C2 -d -r1.1.1.4.2.2.2.6 -r1.1.1.4.2.2.2.7
*** g_hdial.c 10 Mar 2004 06:00:11 -0000 1.1.1.4.2.2.2.6
--- g_hdial.c 28 Mar 2004 07:21:17 -0000 1.1.1.4.2.2.2.7
***************
*** 39,47 ****
if(glist_isvisible(glist)) {
t_canvas *canvas=glist_getcanvas(glist);
! sys_vgui("radio_set .x%x.c %x %d\n",canvas,x,x->x_on);
}
break;
case IEM_GUI_DRAW_MODE_SELECT:
! sys_vgui("bluebox_select .x%x.c %xBASE %d\n", canvas, x, x->x_gui.x_fsf.x_selected);
break;
case IEM_GUI_DRAW_MODE_ERASE:
--- 39,47 ----
if(glist_isvisible(glist)) {
t_canvas *canvas=glist_getcanvas(glist);
! sys_vgui("radio_set %x .x%x.c %d\n",x,canvas,x->x_on);
}
break;
case IEM_GUI_DRAW_MODE_SELECT:
! sys_vgui("radio_select %x .x%x.c %d\n", x, canvas, x->x_gui.x_fsf.x_selected);
break;
case IEM_GUI_DRAW_MODE_ERASE:
***************
*** 51,55 ****
pd_upload((t_gobj *)x);
sys_vgui("radio_draw %x .x%x.c\n", x, canvas);
! sys_vgui("radio_set .x%x.c %x %d\n",canvas,x,x->x_on);
break;
}}
--- 51,55 ----
pd_upload((t_gobj *)x);
sys_vgui("radio_draw %x .x%x.c\n", x, canvas);
! sys_vgui("radio_set %x .x%x.c %d\n",x,canvas,x->x_on);
break;
}}
***************
*** 102,111 ****
empty 0.0 empty 0.0 empty %d \
%d new-only new&old %d %d number: %d \
! %s %s \
! %s %d %d \
! %d %d \
! %d %d %d\n",
! x->x_gui.x_w, IEM_GUI_MINSIZE,
! 0,/*no_schedule*/
x->x_change, x->x_gui.x_isa.x_loadinit, -1, x->x_number,
srl[0]->s_name, srl[1]->s_name,
--- 102,107 ----
empty 0.0 empty 0.0 empty %d \
%d new-only new&old %d %d number: %d \
! %s %s %s %d %d %d %d %d %d %d\n",
! x->x_gui.x_w, IEM_GUI_MINSIZE, 0,
x->x_change, x->x_gui.x_isa.x_loadinit, -1, x->x_number,
srl[0]->s_name, srl[1]->s_name,
***************
*** 347,382 ****
static void hradio_delta(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
-
static void hradio_pos(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
-
static void hradio_color(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_color((void *)x, &x->x_gui, s, ac, av);}
-
static void hradio_send(t_hradio *x, t_symbol *s)
{iemgui_send(x, &x->x_gui, s);}
-
static void hradio_receive(t_hradio *x, t_symbol *s)
{iemgui_receive(x, &x->x_gui, s);}
-
static void hradio_label(t_hradio *x, t_symbol *s)
{iemgui_label((void *)x, &x->x_gui, s);}
-
static void hradio_label_pos(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
-
static void hradio_label_font(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
static void hradio_init(t_hradio *x, t_floatarg f)
! {
! x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;
! }
!
! static void hradio_double_change(t_hradio *x)
! {x->x_change = 1;}
! static void hradio_single_change(t_hradio *x)
! {x->x_change = 0;}
static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, t_hradio *x)
--- 343,366 ----
static void hradio_delta(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
static void hradio_pos(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
static void hradio_color(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_color((void *)x, &x->x_gui, s, ac, av);}
static void hradio_send(t_hradio *x, t_symbol *s)
{iemgui_send(x, &x->x_gui, s);}
static void hradio_receive(t_hradio *x, t_symbol *s)
{iemgui_receive(x, &x->x_gui, s);}
static void hradio_label(t_hradio *x, t_symbol *s)
{iemgui_label((void *)x, &x->x_gui, s);}
static void hradio_label_pos(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
static void hradio_label_font(t_hradio *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
static void hradio_init(t_hradio *x, t_floatarg f)
! {x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;}
! static void hradio_double_change(t_hradio *x) {x->x_change = 1;}
! static void hradio_single_change(t_hradio *x) {x->x_change = 0;}
static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, t_hradio *x)
***************
*** 403,411 ****
else iemgui_new_getnames(&x->x_gui, 4, 0);
x->x_gui.x_draw = (t_iemfunptr)hradio_draw;
- x->x_gui.x_fsf.x_snd_able = 1;
- x->x_gui.x_fsf.x_rcv_able = 1;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0;
! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
--- 387,393 ----
else iemgui_new_getnames(&x->x_gui, 4, 0);
x->x_gui.x_draw = (t_iemfunptr)hradio_draw;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
Index: g_mycanvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v
retrieving revision 1.1.1.3.2.2.2.1
retrieving revision 1.1.1.3.2.2.2.2
diff -C2 -d -r1.1.1.3.2.2.2.1 -r1.1.1.3.2.2.2.2
*** g_mycanvas.c 7 Mar 2004 19:38:13 -0000 1.1.1.3.2.2.2.1
--- g_mycanvas.c 28 Mar 2004 07:21:17 -0000 1.1.1.3.2.2.2.2
***************
*** 307,317 ****
}
x->x_gui.x_draw = (t_iemfunptr)my_canvas_draw;
- x->x_gui.x_fsf.x_snd_able = 1;
- x->x_gui.x_fsf.x_rcv_able = 1;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! if (!strcmp(x->x_gui.x_snd->s_name, "empty"))
! x->x_gui.x_fsf.x_snd_able = 0;
! if (!strcmp(x->x_gui.x_rcv->s_name, "empty"))
! x->x_gui.x_fsf.x_rcv_able = 0;
if(a < 1)
a = 1;
--- 307,313 ----
}
x->x_gui.x_draw = (t_iemfunptr)my_canvas_draw;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
if(a < 1)
a = 1;
Index: u_object.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -C2 -d -r1.1.2.11 -r1.1.2.12
*** u_object.tk 23 Mar 2004 02:17:42 -0000 1.1.2.11
--- u_object.tk 28 Mar 2004 07:21:18 -0000 1.1.2.12
***************
*** 69,74 ****
# 0: creation
# 1: resize (or move)
!
! proc wire_draw {canvas tag thick x1 y1 x2 y2} {
global look
set xys [list $x1 $y1 $x2 $y2]
--- 69,73 ----
# 0: creation
# 1: resize (or move)
! proc wire_draw {self canvas thick x1 y1 x2 y2} {
[...966 lines suppressed...]
! proc vu_draw {self canvas} {
! global _
! set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! set x1 $_($self:x1)
! set y1 $_($self:y1)
! set xs $_($self:w)
! set ys $_($self:w)
set x2 [expr $x1+$xs]
set y2 [expr $y1+$ys]
! set ins [expr 2*([string compare $_($self:rcv) empty]==0)]
! set outs 2
! #[expr [string compare $_($self:snd) empty]==0]
! set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! set colour [parse_color $_($self:bcol)]
! bluebox_draw $self $canvas $x1 $y1 $xs $ys $ins $outs $colour
! }
!
! proc vu_erase {self canvas} {
! bluebox_erase $self $canvas
}
Index: g_rtext.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_rtext.c,v
retrieving revision 1.1.1.2.2.6.2.3
retrieving revision 1.1.1.2.2.6.2.4
diff -C2 -d -r1.1.1.2.2.6.2.3 -r1.1.1.2.2.6.2.4
*** g_rtext.c 16 Mar 2004 21:55:55 -0000 1.1.1.2.2.6.2.3
--- g_rtext.c 28 Mar 2004 07:21:17 -0000 1.1.1.2.2.6.2.4
***************
*** 338,342 ****
void rtext_erase(t_rtext *x)
{
! sys_vgui(".x%x.c delete %s\n", glist_getcanvas(x->x_glist), x->x_tag);
}
--- 338,342 ----
void rtext_erase(t_rtext *x)
{
! sys_vgui("pdtk_text_delete .x%x.c %s\n", glist_getcanvas(x->x_glist), x->x_tag);
}
Index: g_graph.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_graph.c,v
retrieving revision 1.1.1.3.2.3.2.2
retrieving revision 1.1.1.3.2.3.2.3
diff -C2 -d -r1.1.1.3.2.3.2.2 -r1.1.1.3.2.3.2.3
*** g_graph.c 8 Mar 2004 12:32:38 -0000 1.1.1.3.2.3.2.2
--- g_graph.c 28 Mar 2004 07:21:17 -0000 1.1.1.3.2.3.2.3
***************
*** 113,117 ****
void glist_clear(t_glist *x)
{
! t_gobj *y, *y2;
int dspstate = canvas_suspend_dsp();
while (y = x->gl_list)
--- 113,117 ----
void glist_clear(t_glist *x)
{
! t_gobj *y;
int dspstate = canvas_suspend_dsp();
while (y = x->gl_list)
***************
*** 122,126 ****
void glist_retext(t_glist *glist, t_text *y)
{
- t_canvas *c = glist_getcanvas(glist);
/* check that we have built rtexts yet. LATER need a better test. */
if (glist->gl_editor && glist->gl_editor->e_rtext)
--- 122,125 ----
Index: g_vumeter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v
retrieving revision 1.1.1.3.2.2.2.5
retrieving revision 1.1.1.3.2.2.2.6
diff -C2 -d -r1.1.1.3.2.2.2.5 -r1.1.1.3.2.2.2.6
*** g_vumeter.c 28 Mar 2004 04:18:18 -0000 1.1.1.3.2.2.2.5
--- g_vumeter.c 28 Mar 2004 07:21:18 -0000 1.1.1.3.2.2.2.6
***************
*** 157,163 ****
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, x->x_gui.x_lcol, x);
! sys_vgui("io_draw .x%x.c %x %d %d %d %d %d %d\n",
! canvas, x, xpos-1, ypos-2, x->x_gui.x_w+1, x->x_gui.x_h+2,
2*!x->x_gui.x_fsf.x_rcv_able, 2*!x->x_gui.x_fsf.x_snd_able);
}
--- 157,165 ----
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, x->x_gui.x_lcol, x);
! pd_upload((t_gobj *)x);
! sys_mgui((t_iemgui *)x,"vu","draw","");
! /* canvas, x, xpos-1, ypos-2, x->x_gui.x_w+1, x->x_gui.x_h+2,
2*!x->x_gui.x_fsf.x_rcv_able, 2*!x->x_gui.x_fsf.x_snd_able);
+ */
}
***************
*** 597,604 ****
x->x_gui.x_fsf.x_snd_able = 0;
! x->x_gui.x_fsf.x_rcv_able = 1;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
- if (!strcmp(x->x_gui.x_rcv->s_name, "empty"))
- x->x_gui.x_fsf.x_rcv_able = 0;
if (x->x_gui.x_fsf.x_font_style == 1)
strcpy(x->x_gui.x_font, "helvetica");
--- 599,604 ----
x->x_gui.x_fsf.x_snd_able = 0;
! x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
if (x->x_gui.x_fsf.x_font_style == 1)
strcpy(x->x_gui.x_font, "helvetica");
Index: g_canvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v
retrieving revision 1.1.1.4.2.7.2.5
retrieving revision 1.1.1.4.2.7.2.6
diff -C2 -d -r1.1.1.4.2.7.2.5 -r1.1.1.4.2.7.2.6
*** g_canvas.c 16 Mar 2004 21:54:02 -0000 1.1.1.4.2.7.2.5
--- g_canvas.c 28 Mar 2004 07:21:16 -0000 1.1.1.4.2.7.2.6
***************
*** 274,283 ****
while (outno == t->tr_nout)
{
! t_gobj *y;
t_object *ob = 0;
! if (!t->tr_ob) y = t->tr_x->gl_list;
! else y = t->tr_ob->ob_g.g_next;
! for (; y; y = y->g_next)
! if (ob = pd_checkobject(&y->g_pd)) break;
if (!ob) return (0);
t->tr_ob = ob;
--- 274,280 ----
while (outno == t->tr_nout)
{
! t_gobj *y = t->tr_ob ? y = t->tr_ob->ob_g.g_next : t->tr_x->gl_list;
t_object *ob = 0;
! for (; y; y=y->g_next) {ob=pd_checkobject(&y->g_pd); if (ob) break;}
if (!ob) return (0);
t->tr_ob = ob;
***************
*** 358,379 ****
if (argc == 5) /* toplevel: x, y, w, h, font */
! {
! xloc = atom_getintarg(0, argc, argv);
! yloc = atom_getintarg(1, argc, argv);
! width = atom_getintarg(2, argc, argv);
! height = atom_getintarg(3, argc, argv);
! font = atom_getintarg(4, argc, argv);
! }
else if (argc == 6) /* subwindow: x, y, w, h, name, vis */
! {
! xloc = atom_getintarg(0, argc, argv);
! yloc = atom_getintarg(1, argc, argv);
! width = atom_getintarg(2, argc, argv);
! height = atom_getintarg(3, argc, argv);
! s = atom_getsymbolarg(4, argc, argv);
! vis = atom_getintarg(5, argc, argv);
! }
/* (otherwise assume we're being created from the menu.) */
-
if (canvas_newdirectory->s_name[0])
{
--- 355,362 ----
if (argc == 5) /* toplevel: x, y, w, h, font */
! pd_scanargs(argc,argv,"iiiii",&xloc,&yloc,&width,&height,&font);
else if (argc == 6) /* subwindow: x, y, w, h, name, vis */
! pd_scanargs(argc,argv,"iiiisi",&xloc,&yloc,&width,&height,&s,&vis);
/* (otherwise assume we're being created from the menu.) */
if (canvas_newdirectory->s_name[0])
{
***************
*** 417,427 ****
static void canvas_coords(t_glist *x, t_symbol *s, int argc, t_atom *argv)
{
! x->gl_x1 = atom_getfloatarg(0, argc, argv);
! x->gl_y1 = atom_getfloatarg(1, argc, argv);
! x->gl_x2 = atom_getfloatarg(2, argc, argv);
! x->gl_y2 = atom_getfloatarg(3, argc, argv);
! x->gl_pixwidth = atom_getintarg(4, argc, argv);
! x->gl_pixheight = atom_getintarg(5, argc, argv);
! canvas_setgraph(x, atom_getintarg(6, argc, argv));
}
--- 400,407 ----
static void canvas_coords(t_glist *x, t_symbol *s, int argc, t_atom *argv)
{
! int graph;
! pd_scanargs(argc,argv,"ffffiii",
! &x->gl_x1,&x->gl_y1,&x->gl_x2,&x->gl_y2,&x->gl_pixwidth,&x->gl_pixheight,&graph);
! canvas_setgraph(x,graph);
}
***************
*** 495,507 ****
void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
{
! t_symbol *sym = atom_getsymbolarg(0, argc, argv);
! float x1 = atom_getfloatarg(1, argc, argv);
! float y1 = atom_getfloatarg(2, argc, argv);
! float x2 = atom_getfloatarg(3, argc, argv);
! float y2 = atom_getfloatarg(4, argc, argv);
! float px1 = atom_getfloatarg(5, argc, argv);
! float py1 = atom_getfloatarg(6, argc, argv);
! float px2 = atom_getfloatarg(7, argc, argv);
! float py2 = atom_getfloatarg(8, argc, argv);
glist_addglist(g, sym, x1, y1, x2, y2, px1, py1, px2, py2);
}
--- 475,481 ----
void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
{
! t_symbol *sym;
! float x1,y1,x2,y2,px1,py1,px2,py2;
! pd_scanargs(argc,argv,"sffffffff",&x1,&y1,&x2,&y2,&px1,&py1,&px2,&py2);
glist_addglist(g, sym, x1, y1, x2, y2, px1, py1, px2, py2);
}
***************
*** 634,638 ****
t_canvas *x = canvas_list;
while (x) {
- fprintf(stderr,"canvas=%08x\n",x);
canvas_redraw(x);
x->gl_mapped=0; canvas_map(x,1);
--- 608,611 ----
***************
*** 715,719 ****
void canvas_vis(t_canvas *x, t_floatarg f)
{
- char buf[30];
int flag = (f != 0);
if (flag)
--- 688,691 ----
***************
*** 861,866 ****
int x1=t.tr_lx1, y1=t.tr_ly1;
int x2=t.tr_lx2, y2=t.tr_ly2;
! sys_vgui("wire_draw .x%x.c l%x %d %d %d %d %d\n",
! glist_getcanvas(x), oc, (outlet_getsymbol(t.tr_outlet) == &s_signal ? 2:1), x1, y1, x2, y2);
}
}
--- 833,838 ----
int x1=t.tr_lx1, y1=t.tr_ly1;
int x2=t.tr_lx2, y2=t.tr_ly2;
! sys_vgui("wire_draw l%x .x%x.c %d %d %d %d %d\n",
! oc, glist_getcanvas(x), (outlet_getsymbol(t.tr_outlet) == &s_signal ? 2:1), x1, y1, x2, y2);
}
}
***************
*** 875,880 ****
int x1=t.tr_lx1, y1=t.tr_ly1;
int x2=t.tr_lx2, y2=t.tr_ly2;
! sys_vgui("wire_draw .x%x.c l%x %d %d %d %d %d\n",
! glist_getcanvas(x), oc, (outlet_getsymbol(t.tr_outlet) == &s_signal ? 2:1), x1, y1, x2, y2);
}
}
--- 847,852 ----
int x1=t.tr_lx1, y1=t.tr_ly1;
int x2=t.tr_lx2, y2=t.tr_ly2;
! sys_vgui("wire_draw l%x .x%x.c %d %d %d %d %d\n",
! oc, glist_getcanvas(x), (outlet_getsymbol(t.tr_outlet) == &s_signal ? 2:1), x1, y1, x2, y2);
}
}
***************
*** 1375,1424 ****
class_addmethod(pd_canvasmaker, (t_method)canvas_new, gensym("canvas"),
A_GIMME, 0);
! class_addmethod(canvas_class, (t_method)canvas_restore,
! gensym("restore"), A_GIMME, 0);
! class_addmethod(canvas_class, (t_method)canvas_coords,
! gensym("coords"), A_GIMME, 0);
!
/* -------------------------- objects ----------------------------- */
! class_addmethod(canvas_class, (t_method)canvas_obj,
! gensym("obj"), A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_msg,
! gensym("msg"), A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_floatatom,
! gensym("floatatom"), A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_symbolatom,
! gensym("symbolatom"), A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)glist_text,
! gensym("text"), A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)glist_glist, gensym("graph"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)glist_scalar,
! gensym("scalar"), A_GIMME, A_NULL);
!
! /* -------------- Thomas Musil's GUI objects ------------ */
! class_addmethod(canvas_class, (t_method)canvas_bng, gensym("bng"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_toggle, gensym("toggle"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_vslider, gensym("vslider"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_hslider, gensym("hslider"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_hdial, gensym("hdial"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_vdial, gensym("vdial"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_hradio, gensym("hradio"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_vradio, gensym("vradio"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_vumeter, gensym("vumeter"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_mycnv, gensym("mycnv"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_numbox, gensym("numbox"),
! A_GIMME, A_NULL);
! class_addmethod(canvas_class, (t_method)canvas_guiext, gensym("guiext"),
! A_GIMME, A_NULL);
/* ------------------------ gui stuff --------------------------- */
--- 1347,1373 ----
class_addmethod(pd_canvasmaker, (t_method)canvas_new, gensym("canvas"),
A_GIMME, 0);
! #define DEF(_f_,_s_) class_addmethod(canvas_class, (t_method)_f_, gensym(_s_), A_GIMME, 0);
! DEF(canvas_restore,"restore");
! DEF(canvas_coords,"coords");
/* -------------------------- objects ----------------------------- */
! DEF(canvas_obj,"obj");
! DEF(canvas_msg,"msg");
! DEF(canvas_floatatom,"floatatom");
! DEF(canvas_symbolatom,"symbolatom");
! DEF(glist_text,"text");
! DEF(glist_glist,"graph");
! DEF(glist_scalar,"scalar");
! DEF(canvas_bng,"bng");
! DEF(canvas_toggle,"toggle");
! DEF(canvas_vslider,"vslider");
! DEF(canvas_hslider,"hslider");
! DEF(canvas_hdial,"hdial");
! DEF(canvas_vdial,"vdial");
! DEF(canvas_hradio,"hradio");
! DEF(canvas_vradio,"vradio");
! DEF(canvas_vumeter,"vumeter");
! DEF(canvas_mycnv,"mycnv");
! DEF(canvas_numbox,"numbox");
! DEF(canvas_guiext,"guiext");
/* ------------------------ gui stuff --------------------------- */
***************
*** 1435,1440 ****
class_addmethod(canvas_class, (t_method)canvas_map,
gensym("map"), A_FLOAT, A_NULL);
! // class_addmethod(canvas_class, (t_method)canvas_redraw,
! // gensym("redraw"), A_NULL);
class_setpropertiesfn(canvas_class, graph_properties);
--- 1384,1389 ----
class_addmethod(canvas_class, (t_method)canvas_map,
gensym("map"), A_FLOAT, A_NULL);
! /* class_addmethod(canvas_class, (t_method)canvas_redraw,
! gensym("redraw"), A_NULL);*/
class_setpropertiesfn(canvas_class, graph_properties);
Index: g_editor.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v
retrieving revision 1.1.1.4.2.3.2.3
retrieving revision 1.1.1.4.2.3.2.4
diff -C2 -d -r1.1.1.4.2.3.2.3 -r1.1.1.4.2.3.2.4
*** g_editor.c 8 Mar 2004 12:32:38 -0000 1.1.1.4.2.3.2.3
--- g_editor.c 28 Mar 2004 07:21:17 -0000 1.1.1.4.2.3.2.4
***************
*** 30,35 ****
/* ---------------- generic widget behavior ------------------------- */
! void gobj_getrect(t_gobj *x, t_glist *glist, int *x1, int *y1,
! int *x2, int *y2)
{
if (x->g_pd->c_wb && x->g_pd->c_wb->w_getrectfn)
--- 30,34 ----
/* ---------------- generic widget behavior ------------------------- */
! void gobj_getrect(t_gobj *x, t_glist *glist, int *x1, int *y1, int *x2, int *y2)
{
if (x->g_pd->c_wb && x->g_pd->c_wb->w_getrectfn)
***************
*** 433,437 ****
{
t_undo_cut *buf;
- t_gobj *y;
t_linetraverser t;
t_outconnect *oc;
--- 432,435 ----
***************
*** 736,751 ****
void canvas_inlettip(t_canvas* x,t_object* ob,int closest,int xpos,int ypos)
{
if (!sys_tooltips) return;
if (ob->ob_pd->c_firstin) closest--;
if (closest < 0)
! sys_vgui(".x%x.c create text %d %d -anchor sw -text \"%s\" -tags y\n",
! x, xpos, ypos,ob->ob_pd->c_firsttip->s_name);
else
! sys_vgui(".x%x.c create text %d %d -anchor sw -text \"%s\" -tags y\n",
! x, xpos, ypos-4,inlet_tip(ob->te_inlet,closest));
}
-
-
/* check if a point lies in a gobj. */
int canvas_hitbox(t_canvas *x, t_gobj *y, int xpos, int ypos,
--- 734,748 ----
void canvas_inlettip(t_canvas* x,t_object* ob,int closest,int xpos,int ypos)
{
+ int inlet=closest;
if (!sys_tooltips) return;
if (ob->ob_pd->c_firstin) closest--;
if (closest < 0)
! sys_vgui(".x%x.c create text %d %d -anchor sw -text \"%d: %s\" -tags y\n",
! x, xpos, ypos-4,inlet,ob->ob_pd->c_firsttip->s_name);
else
! sys_vgui(".x%x.c create text %d %d -anchor sw -text \"%d: %s\" -tags y\n",
! x, xpos, ypos-4,inlet,inlet_tip(ob->te_inlet,closest));
}
/* check if a point lies in a gobj. */
int canvas_hitbox(t_canvas *x, t_gobj *y, int xpos, int ypos,
***************
*** 1080,1084 ****
x->gl_editor->e_ywas = ypos;
sys_vgui(
! "wire_draw .x%x.c x %d %d %d %d %d\n",
x, (issignal ? 2 : 1), xpos, ypos, xpos, ypos);
}
--- 1077,1081 ----
x->gl_editor->e_ywas = ypos;
sys_vgui(
! "wire_draw x .x%x.c %d %d %d %d %d\n",
x, (issignal ? 2 : 1), xpos, ypos, xpos, ypos);
}
***************
*** 1213,1217 ****
ywas = x->gl_editor->e_ywas;
if (doit) sys_vgui(".x%x.c delete x\n", x);
! else sys_vgui("wire_draw .x%x.c x 1 %d %d %d %d\n",
x, x->gl_editor->e_xwas, x->gl_editor->e_ywas, xpos, ypos);
--- 1210,1214 ----
ywas = x->gl_editor->e_ywas;
if (doit) sys_vgui(".x%x.c delete x\n", x);
! else sys_vgui("wire_draw x .x%x.c 1 %d %d %d %d\n",
x, x->gl_editor->e_xwas, x->gl_editor->e_ywas, xpos, ypos);
***************
*** 1274,1279 ****
+ IOMIDDLE;
ly2 = y21;
! sys_vgui("wire_draw .x%x.c l%x %d %d %d %d %d\n",
! glist_getcanvas(x), oc, (obj_issignaloutlet(ob1, closest1) ? 2 : 1),
lx1, ly1, lx2, ly2);
canvas_setundo(x, canvas_undo_connect,
--- 1271,1276 ----
+ IOMIDDLE;
ly2 = y21;
! sys_vgui("wire_draw l%x .x%x.c %d %d %d %d %d\n",
! oc, glist_getcanvas(x), (obj_issignaloutlet(ob1, closest1) ? 2 : 1),
lx1, ly1, lx2, ly2);
canvas_setundo(x, canvas_undo_connect,
***************
*** 1481,1492 ****
}
/* check for arrow keys */
! else if (!strcmp(gotkeysym->s_name, "Up"))
! canvas_displaceselection(x, 0, shift ? -10 : -1);
! else if (!strcmp(gotkeysym->s_name, "Down"))
! canvas_displaceselection(x, 0, shift ? 10 : 1);
! else if (!strcmp(gotkeysym->s_name, "Left"))
! canvas_displaceselection(x, shift ? -10 : -1, 0);
! else if (!strcmp(gotkeysym->s_name, "Right"))
! canvas_displaceselection(x, shift ? 10 : 1, 0);
}
}
--- 1478,1485 ----
}
/* check for arrow keys */
! else if (!strcmp(gotkeysym->s_name, "Up")) canvas_displaceselection(x, 0, shift ? -10 : -1);
! else if (!strcmp(gotkeysym->s_name, "Down")) canvas_displaceselection(x, 0, shift ? 10 : 1);
! else if (!strcmp(gotkeysym->s_name, "Left")) canvas_displaceselection(x, shift ? -10 : -1, 0);
! else if (!strcmp(gotkeysym->s_name, "Right")) canvas_displaceselection(x, shift ? 10 : 1, 0);
}
}
***************
*** 1887,1891 ****
static void canvas_dopaste(t_canvas *x, t_binbuf *b)
{
! t_gobj *newgobj, *last, *g2;
int dspstate = canvas_suspend_dsp(), nbox, count;
--- 1880,1884 ----
static void canvas_dopaste(t_canvas *x, t_binbuf *b)
{
! t_gobj *g2;
int dspstate = canvas_suspend_dsp(), nbox, count;
***************
*** 1983,1987 ****
static void canvas_tidy(t_canvas *x)
{
! t_gobj *y, *y2, *y3;
int ax1, ay1, ax2, ay2, bx1, by1, bx2, by2;
int histogram[NHIST], *ip, i, besthist, bestdist;
--- 1976,1980 ----
static void canvas_tidy(t_canvas *x)
{
! t_gobj *y, *y2;
int ax1, ay1, ax2, ay2, bx1, by1, bx2, by2;
int histogram[NHIST], *ip, i, besthist, bestdist;
Index: g_hslider.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v
retrieving revision 1.1.1.3.2.2.2.7
retrieving revision 1.1.1.3.2.2.2.8
diff -C2 -d -r1.1.1.3.2.2.2.7 -r1.1.1.3.2.2.2.8
*** g_hslider.c 14 Mar 2004 22:33:54 -0000 1.1.1.3.2.2.2.7
--- g_hslider.c 28 Mar 2004 07:21:17 -0000 1.1.1.3.2.2.2.8
***************
*** 36,101 ****
}
- static void hslider_draw_update(t_hslider *x, t_glist *glist)
- {
- t_canvas *canvas=glist_getcanvas(glist);
- if (glist_isvisible(glist))
- {sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val,
- isvert(x),x->x_gui.x_fcol);}
- }
-
- static void hslider_draw_new(t_hslider *x, t_glist *glist)
- {
- int xpos=text_xpix(&x->x_gui.x_obj, glist);
- int ypos=text_ypix(&x->x_gui.x_obj, glist);
- t_canvas *canvas=glist_getcanvas(glist);
- pd_upload(x);
- sys_vgui("slider_draw %x .x%x.c\n", x, canvas);
- sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val, isvert(x),x->x_gui.x_fcol);
- }
-
- static void hslider_draw_move(t_hslider *x, t_glist *glist)
- {
- int xpos=text_xpix(&x->x_gui.x_obj, glist);
- int ypos=text_ypix(&x->x_gui.x_obj, glist);
- t_canvas *canvas=glist_getcanvas(glist);
- pd_upload((t_gobj *)x);
- sys_vgui("slider_draw %x .x%x.c\n", x, canvas);
- sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val,isvert(x), x->x_gui.x_fcol);
- }
-
- static void hslider_draw_erase(t_hslider* x,t_glist* glist)
- {
- t_canvas *canvas=glist_getcanvas(glist);
- sys_vgui("slider_erase .x%x.c %x\n", canvas, x);
- }
-
- static void hslider_draw_config(t_hslider* x,t_glist* glist)
- {
- t_canvas *canvas=glist_getcanvas(glist);
- sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
- canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
- x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
- strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
- sys_vgui("slider_set .x%x.c %x %d %d #%6.6x\n", canvas, x, x->x_val, isvert(x), x->x_gui.x_fcol);
- sys_vgui("slider_select .x%x.c %x %d\n", canvas, x, x->x_gui.x_fsf.x_selected);
- }
-
- static void hslider_draw_select(t_hslider *x, t_glist *glist)
- {
- t_canvas *canvas=glist_getcanvas(glist);
- sys_vgui("slider_select .x%x.c %x %d\n", canvas, x, x->x_gui.x_fsf.x_selected);
- sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x,
- x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol);
- }
-
static void hslider_draw(t_hslider *x, t_glist *glist, int mode)
{
! if (mode == IEM_GUI_DRAW_MODE_UPDATE) hslider_draw_update(x, glist);
! else if(mode == IEM_GUI_DRAW_MODE_MOVE) hslider_draw_move(x, glist);
! else if(mode == IEM_GUI_DRAW_MODE_NEW) hslider_draw_new(x, glist);
! else if(mode == IEM_GUI_DRAW_MODE_SELECT) hslider_draw_select(x, glist);
! else if(mode == IEM_GUI_DRAW_MODE_ERASE) hslider_draw_erase(x, glist);
! else if(mode == IEM_GUI_DRAW_MODE_CONFIG) hslider_draw_config(x, glist);
! else if(mode >= IEM_GUI_DRAW_MODE_IO) hslider_draw_move(x, glist);
}
--- 36,50 ----
}
static void hslider_draw(t_hslider *x, t_glist *glist, int mode)
{
! if (mode==IEM_GUI_DRAW_MODE_ERASE) {
! sys_mgui((t_iemgui *)x,"slider","erase","");
! } else if (mode==IEM_GUI_DRAW_MODE_SELECT) {
! sys_mgui((t_iemgui *)x,"slider","select","i",x->x_gui.x_fsf.x_selected);
! } else {
! pd_upload((t_gobj *)x);
! sys_mgui((t_iemgui *)x,"slider","draw","");
! sys_mgui((t_iemgui *)x,"slider","set","i",x->x_val);
! }
}
***************
*** 218,226 ****
}
! static void hslider_set(t_hslider *x, t_floatarg f) /* bugfix */
{
double g;
!
! if(x->x_gui.x_isa.x_reverse) /* bugfix */
{
if(f > x->x_min) f = x->x_min;
--- 167,174 ----
}
! static void hslider_set(t_hslider *x, t_floatarg f)
{
double g;
! if(x->x_gui.x_isa.x_reverse)
{
if(f > x->x_min) f = x->x_min;
***************
*** 232,239 ****
if(f < x->x_min) f = x->x_min;
}
! if(x->x_lin0_log1)
! g = log(f/x->x_min)/x->x_k;
! else
! g = (f - x->x_min) / x->x_k;
x->x_val = (int)(100.0*g + 0.49999);
x->x_pos = x->x_val;
--- 180,184 ----
if(f < x->x_min) f = x->x_min;
}
! g = (x->x_lin0_log1 ? log(f/x->x_min) : (f-x->x_min)) / x->x_k;
x->x_val = (int)(100.0*g + 0.49999);
x->x_pos = x->x_val;
***************
*** 243,254 ****
static void hslider_bang(t_hslider *x)
{
! double out;
!
! if(x->x_lin0_log1)
! out = x->x_min*exp(x->x_k*(double)(x->x_val)*0.01);
! else
! out = (double)(x->x_val)*0.01*x->x_k + x->x_min;
! if((out < 1.0e-10)&&(out > -1.0e-10))
! out = 0.0;
outlet_float(x->x_gui.x_obj.ob_outlet, out);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
--- 188,195 ----
static void hslider_bang(t_hslider *x)
{
! double out = x->x_lin0_log1 ?
! x->x_min*exp(x->x_k*(double)(x->x_val)*0.01) :
! (double)(x->x_val)*0.01*x->x_k + x->x_min;
! if((out < 1.0e-10)&&(out > -1.0e-10)) out = 0.0;
outlet_float(x->x_gui.x_obj.ob_outlet, out);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
***************
*** 356,360 ****
{
t_hslider* x = (t_hslider *)z;
-
if(doit)
{
--- 297,300 ----
***************
*** 378,387 ****
}}
- static void hslider_delta(t_hslider *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
-
- static void hslider_pos(t_hslider *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
-
static void hslider_range(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{
--- 318,321 ----
***************
*** 390,408 ****
}
static void hslider_color(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{iemgui_color((void *)x, &x->x_gui, s, ac, av);}
-
static void hslider_send(t_hslider *x, t_symbol *s)
{iemgui_send(x, &x->x_gui, s);}
-
static void hslider_receive(t_hslider *x, t_symbol *s)
{iemgui_receive(x, &x->x_gui, s);}
-
static void hslider_label(t_hslider *x, t_symbol *s)
{iemgui_label((void *)x, &x->x_gui, s);}
-
static void hslider_label_pos(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
-
static void hslider_label_font(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
--- 324,341 ----
}
+ static void hslider_delta(t_hslider *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
+ static void hslider_pos(t_hslider *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
static void hslider_color(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{iemgui_color((void *)x, &x->x_gui, s, ac, av);}
static void hslider_send(t_hslider *x, t_symbol *s)
{iemgui_send(x, &x->x_gui, s);}
static void hslider_receive(t_hslider *x, t_symbol *s)
{iemgui_receive(x, &x->x_gui, s);}
static void hslider_label(t_hslider *x, t_symbol *s)
{iemgui_label((void *)x, &x->x_gui, s);}
static void hslider_label_pos(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_pos((void *)x, &x->x_gui, s, ac, av);}
static void hslider_label_font(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{iemgui_label_font((void *)x, &x->x_gui, s, ac, av);}
***************
*** 421,432 ****
static void hslider_init(t_hslider *x, t_floatarg f)
! {
! x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;
! }
static void hslider_steady(t_hslider *x, t_floatarg f)
! {
! x->x_steady = (f==0.0)?0:1;
! }
static void hslider_float(t_hslider *x, t_floatarg f)
--- 354,361 ----
static void hslider_init(t_hslider *x, t_floatarg f)
! {x->x_gui.x_isa.x_loadinit = (f==0.0)?0:1;}
static void hslider_steady(t_hslider *x, t_floatarg f)
! {x->x_steady = (f==0.0)?0:1;}
static void hslider_float(t_hslider *x, t_floatarg f)
***************
*** 471,475 ****
int bflcol[]={-262144, -1, -1};
int w=IEM_SL_DEFAULTSIZE, h=IEM_GUI_DEFAULTSIZE;
! int lilo=0, ldx=-2, ldy=-6, f=0, v=0, steady=1, fs=8;
double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1);
int isa,fstyle;
--- 400,404 ----
int bflcol[]={-262144, -1, -1};
int w=IEM_SL_DEFAULTSIZE, h=IEM_GUI_DEFAULTSIZE;
! int lilo=0, ldx=-2, ldy=-6, v=0, steady=1, fs=8;
double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1);
int isa,fstyle;
***************
*** 501,506 ****
if((argc == 18)&&IS_A_FLOAT(argv,17)) steady=!!(int)atom_getintarg(17,argc,argv);
x->x_gui.x_draw = (t_iemfunptr)hslider_draw;
- x->x_gui.x_fsf.x_snd_able = 1;
- x->x_gui.x_fsf.x_rcv_able = 1;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
x->x_val = x->x_gui.x_isa.x_loadinit ? v : 0;
--- 430,433 ----
***************
*** 509,514 ****
x->x_lin0_log1 = lilo;
x->x_steady = steady;
! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0;
! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
--- 436,441 ----
x->x_lin0_log1 = lilo;
x->x_steady = steady;
! x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
Index: g_bang.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v
retrieving revision 1.1.1.3.2.2.2.7
retrieving revision 1.1.1.3.2.2.2.8
diff -C2 -d -r1.1.1.3.2.2.2.7 -r1.1.1.3.2.2.2.8
*** g_bang.c 14 Mar 2004 22:33:54 -0000 1.1.1.3.2.2.2.7
--- g_bang.c 28 Mar 2004 07:21:15 -0000 1.1.1.3.2.2.2.8
***************
*** 28,48 ****
void bng_draw(t_bng *x, t_glist *glist, int mode) {
t_canvas *canvas=glist_getcanvas(glist);
! switch(mode) {
! default:{
! pd_upload((t_gobj *)x);
! sys_vgui("bang_draw %x .x%x.c\n", x, canvas);
}
- case IEM_GUI_DRAW_MODE_UPDATE:
- if(glist_isvisible(glist))
- sys_vgui(".x%x.c itemconfigure %xBUT -fill #%6.6x\n", glist_getcanvas(glist), x,
- pd_bluify(x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol));
- break;
- case IEM_GUI_DRAW_MODE_ERASE:
- sys_vgui("bang_erase .x%x.c %x\n", canvas, x);
- break;
- case IEM_GUI_DRAW_MODE_SELECT:
- sys_vgui("bang_select .x%x.c %x %d\n", canvas, x, x->x_gui.x_fsf.x_selected);
- break;
- }}
/* ------------------------ bng widgetbehaviour----------------------------- */
--- 28,37 ----
void bng_draw(t_bng *x, t_glist *glist, int mode) {
t_canvas *canvas=glist_getcanvas(glist);
! if (mode==IEM_GUI_DRAW_MODE_ERASE)
! sys_mgui((t_iemgui *)x,"bang","erase","");
! else if (mode==IEM_GUI_DRAW_MODE_SELECT)
! sys_mgui((t_iemgui *)x,"bang","select","i",x->x_gui.x_fsf.x_selected);
! else {pd_upload((t_gobj *)x); sys_mgui((t_iemgui *)x,"bang","draw","");}
}
/* ------------------------ bng widgetbehaviour----------------------------- */
***************
*** 51,55 ****
{
t_bng *x = (t_bng *)z;
-
*xp1 = text_xpix(&x->x_gui.x_obj, glist);
*yp1 = text_ypix(&x->x_gui.x_obj, glist);
--- 40,43 ----
***************
*** 66,77 ****
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiiisssiiiiiii", gensym("#X"),gensym("obj"),
! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
! gensym("bng"), x->x_gui.x_w,
! x->x_flashtime_hold, x->x_flashtime_break,
! iem_symargstoint(&x->x_gui.x_isa),
! srl[0], srl[1], srl[2],
! x->x_gui.x_ldx, x->x_gui.x_ldy,
! iem_fstyletoint(&x->x_gui.x_fsf), x->x_gui.x_fontsize,
! bflcol[0], bflcol[1], bflcol[2]);
binbuf_addv(b, ";");
}
--- 54,65 ----
iemgui_save(&x->x_gui, srl, bflcol);
binbuf_addv(b, "ssiisiiiisssiiiiiii", gensym("#X"),gensym("obj"),
! (t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
! gensym("bng"), x->x_gui.x_w,
! x->x_flashtime_hold, x->x_flashtime_break,
! iem_symargstoint(&x->x_gui.x_isa),
! srl[0], srl[1], srl[2],
! x->x_gui.x_ldx, x->x_gui.x_ldy,
! iem_fstyletoint(&x->x_gui.x_fsf), x->x_gui.x_fontsize,
! bflcol[0], bflcol[1], bflcol[2]);
binbuf_addv(b, ";");
}
***************
*** 98,116 ****
iemgui_properties(&x->x_gui, srl);
! sprintf(buf, "pdtk_iemgui_dialog %%s BANG \
! ----------dimensions(pix):----------- %d %d size: 0 0 empty \
! --------flash-time(ms)(ms):--------- %d intrrpt: %d hold: %d \
! %d empty empty %d %d empty %d \
! %s %s \
! %s %d %d \
! %d %d \
! %d %d %d\n",
! x->x_gui.x_w, IEM_GUI_MINSIZE,
! x->x_flashtime_break, x->x_flashtime_hold, 2,/*min_max_schedule+clip*/
! -1, x->x_gui.x_isa.x_loadinit, -1, -1,/*no linlog, no multi*/
! srl[0]->s_name, srl[1]->s_name,
! srl[2]->s_name, x->x_gui.x_ldx, x->x_gui.x_ldy,
! x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize,
! 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol);
gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf);
}
--- 86,101 ----
iemgui_properties(&x->x_gui, srl);
! sprintf(buf, "pdtk_iemgui_dialog %%s BANG "
! "----------dimensions(pix):----------- %d %d size: 0 0 empty "
! "--------flash-time(ms)(ms):--------- %d intrrpt: %d hold: %d "
! "%d empty empty %d %d empty %d "
! "%s %s %s %d %d %d %d %d %d %d\n",
! x->x_gui.x_w, IEM_GUI_MINSIZE,
! x->x_flashtime_break, x->x_flashtime_hold, 2,
! -1, x->x_gui.x_isa.x_loadinit, -1, -1,
! srl[0]->s_name, srl[1]->s_name,
! srl[2]->s_name, x->x_gui.x_ldx, x->x_gui.x_ldy,
! x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize,
! 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol);
gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf);
}
***************
*** 133,137 ****
}
! static void bng_bout1(t_bng *x)/*wird nur mehr gesendet, wenn snd != rcv*/
{
if(!x->x_gui.x_fsf.x_put_in2out)
--- 118,122 ----
}
! static void bng_bout2(t_bng *x)
{
if(!x->x_gui.x_fsf.x_put_in2out)
***************
*** 141,150 ****
}
outlet_bang(x->x_gui.x_obj.ob_outlet);
! if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing && x->x_gui.x_fsf.x_put_in2out)
pd_bang(x->x_gui.x_snd->s_thing);
}
! static void bng_bout2(t_bng *x)/*wird immer gesendet, wenn moeglich*/
{
if(!x->x_gui.x_fsf.x_put_in2out)
{
--- 126,137 ----
}
outlet_bang(x->x_gui.x_obj.ob_outlet);
! if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
pd_bang(x->x_gui.x_snd->s_thing);
}
! static void bng_bang(t_bng *x)
{
+ if(x->x_gui.x_isa.x_locked) return;
+ bng_set(x);
if(!x->x_gui.x_fsf.x_put_in2out)
{
***************
*** 153,168 ****
}
outlet_bang(x->x_gui.x_obj.ob_outlet);
! if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
pd_bang(x->x_gui.x_snd->s_thing);
}
!
! static void bng_bang(t_bng *x)/*wird nur mehr gesendet, wenn snd != rcv*/
! {
! if(!x->x_gui.x_isa.x_locked) {bng_set(x); bng_bout1(x);}
! }
!
! static void bng_bang2(t_bng *x)/*wird immer gesendet, wenn moeglich*/
! {
! if(!x->x_gui.x_isa.x_locked) {bng_set(x); bng_bout2(x);}
}
--- 140,150 ----
}
outlet_bang(x->x_gui.x_obj.ob_outlet);
! if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing && x->x_gui.x_fsf.x_put_in2out)
pd_bang(x->x_gui.x_snd->s_thing);
}
! static void bng_bang2(t_bng *x) {
! if(x->x_gui.x_isa.x_locked) return;
! bng_set(x);
! bng_bout2(x);
}
***************
*** 174,191 ****
int ftbreak = (int)atom_getintarg(3, argc, argv);
int sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv);
-
x->x_gui.x_w = iemgui_clip_size(a);
x->x_gui.x_h = x->x_gui.x_w;
bng_check_minmax(x, ftbreak, fthold);
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_CONFIG);
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_IO + sr_flags);
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_MOVE);
canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
}
static void bng_click(t_bng *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
! {
! bng_set(x); bng_bout2(x);
! }
static int bng_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit)
--- 156,168 ----
int ftbreak = (int)atom_getintarg(3, argc, argv);
int sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv);
x->x_gui.x_w = iemgui_clip_size(a);
x->x_gui.x_h = x->x_gui.x_w;
bng_check_minmax(x, ftbreak, fthold);
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, 0);
canvas_fixlinesfor(glist_getcanvas(x->x_gui.x_glist), (t_text*)x);
}
static void bng_click(t_bng *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
! {bng_set(x); bng_bout2(x);}
static int bng_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit)
***************
*** 193,197 ****
if(doit)
bng_click((t_bng *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt);
! return (1);
}
--- 170,174 ----
if(doit)
bng_click((t_bng *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt);
! return 1;
}
***************
*** 203,209 ****
static void bng_loadbang(t_bng *x)
! {
! if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit) {bng_set(x); bng_bout2(x);}
! }
static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av)
--- 180,184 ----
static void bng_loadbang(t_bng *x)
! {if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit) {bng_set(x); bng_bout2(x);}}
static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av)
***************
*** 214,223 ****
}
- static void bng_delta(t_bng *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
-
- static void bng_pos(t_bng *x, t_symbol *s, int ac, t_atom *av)
- {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
-
static void bng_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av)
{
--- 189,192 ----
***************
*** 226,229 ****
--- 195,202 ----
}
+ static void bng_delta(t_bng *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_delta((void *)x, &x->x_gui, s, ac, av);}
+ static void bng_pos(t_bng *x, t_symbol *s, int ac, t_atom *av)
+ {iemgui_pos((void *)x, &x->x_gui, s, ac, av);}
static void bng_color(t_bng *x, t_symbol *s, int ac, t_atom *av)
{iemgui_color((void *)x, &x->x_gui, s, ac, av);}
***************
*** 244,262 ****
}
! static void bng_tick_hld(t_bng *x)
! {
! x->x_flashed = 0;
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
! }
!
! static void bng_tick_brk(t_bng *x)
! {
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
! }
!
! static void bng_tick_lck(t_bng *x)
! {
! x->x_gui.x_isa.x_locked = 0;
! }
static void *bng_new(t_symbol *s, int argc, t_atom *argv)
--- 217,226 ----
}
! static void bng_tick_hld(t_bng *x) {x->x_flashed = 0;
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, 0);}
! static void bng_tick_brk(t_bng *x) {
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, 0);}
! static void bng_tick_lck(t_bng *x) {
! x->x_gui.x_isa.x_locked = 0;}
static void *bng_new(t_symbol *s, int argc, t_atom *argv)
***************
*** 280,289 ****
iemgui_new_getnames2(&x->x_gui, 4, srl[0], srl[1], srl[2]);
x->x_gui.x_draw = (t_iemfunptr)bng_draw;
- x->x_gui.x_fsf.x_snd_able = 1;
- x->x_gui.x_fsf.x_rcv_able = 1;
- x->x_flashed = 0;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0;
! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
--- 244,251 ----
iemgui_new_getnames2(&x->x_gui, 4, srl[0], srl[1], srl[2]);
x->x_gui.x_draw = (t_iemfunptr)bng_draw;
x->x_gui.x_glist = (t_glist *)canvas_getcurrent();
! x->x_flashed = 0;
! x->x_gui.x_fsf.x_snd_able = strcmp(x->x_gui.x_snd->s_name, "empty")!=0;
! x->x_gui.x_fsf.x_rcv_able = strcmp(x->x_gui.x_rcv->s_name, "empty")!=0;
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
***************
*** 291,295 ****
strcpy(x->x_gui.x_font, "courier"); }
if (x->x_gui.x_fsf.x_rcv_able)
! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
if(fs < 4) fs = 4;
x->x_gui.x_fontsize = fs;
--- 253,257 ----
strcpy(x->x_gui.x_font, "courier"); }
if (x->x_gui.x_fsf.x_rcv_able)
! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
if(fs < 4) fs = 4;
x->x_gui.x_fontsize = fs;
***************
*** 329,334 ****
class_addmethod(bng_class, (t_method)bng_click, gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(bng_class, (t_method)bng_dialog, gensym("dialog"),
! A_GIMME, 0);
class_addmethod(bng_class, (t_method)bng_loadbang, gensym("loadbang"), 0);
class_addmethod(bng_class, (t_method)bng_size, gensym("size"), A_GIMME, 0);
--- 291,295 ----
class_addmethod(bng_class, (t_method)bng_click, gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(bng_class, (t_method)bng_dialog, gensym("dialog"), A_GIMME, 0);
class_addmethod(bng_class, (t_method)bng_loadbang, gensym("loadbang"), 0);
class_addmethod(bng_class, (t_method)bng_size, gensym("size"), A_GIMME, 0);
Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.1.1.4.2.2.2.5
retrieving revision 1.1.1.4.2.2.2.6
diff -C2 -d -r1.1.1.4.2.2.2.5 -r1.1.1.4.2.2.2.6
*** g_numbox.c 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.2.2.5
--- g_numbox.c 28 Mar 2004 07:21:17 -0000 1.1.1.4.2.2.2.6
***************
*** 21,24 ****
--- 21,26 ----
#endif
+ #define CH post("%d: change=%d", __LINE__, (int)x->x_gui.x_fsf.x_change);
+
static void my_numbox_key(void *z, t_floatarg fkey);
t_widgetbehavior my_numbox_widgetbehavior;
***************
*** 31,35 ****
if(x->x_gui.x_fsf.x_change)
{
! x->x_gui.x_fsf.x_change = 0;
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
--- 33,37 ----
if(x->x_gui.x_fsf.x_change)
{
! x->x_gui.x_fsf.x_change = 0; CH
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
***************
*** 92,101 ****
{
int new_exp_index=x->x_gui.x_w-4, old_exp_index=bufsize-4;
-
for(i=0; i < 4; i++, new_exp_index++, old_exp_index++)
x->x_buf[new_exp_index] = x->x_buf[old_exp_index];
x->x_buf[x->x_gui.x_w] = 0;
}
-
}
else
--- 94,101 ----
***************
*** 113,262 ****
}
! static void my_numbox_draw_update(t_my_numbox *x, t_glist *glist)
! {
! if (glist_isvisible(glist))
! {
! if(x->x_gui.x_fsf.x_change)
! {
! if(x->x_buf[0])
! {
! char *cp=x->x_buf;
! int sl = strlen(x->x_buf);
!
! x->x_buf[sl] = '>';
! x->x_buf[sl+1] = 0;
! if(sl >= x->x_gui.x_w)
! cp += sl - x->x_gui.x_w + 1;
! sys_vgui(".x%x.c itemconfigure %xNUMBER -fill #%6.6x -text {%s} \n",
! glist_getcanvas(glist), x, IEM_GUI_COLOR_EDITED, cp);
! x->x_buf[sl] = 0;
! }
! else
! {
! my_numbox_ftoa(x);
! sys_vgui(".x%x.c itemconfigure %xNUMBER -fill #%6.6x -text {%s} \n",
! glist_getcanvas(glist), x, IEM_GUI_COLOR_EDITED, x->x_buf);
! x->x_buf[0] = 0;
! }
! }
! else
! {
! my_numbox_ftoa(x);
! sys_vgui(
! ".x%x.c itemconfigure %xNUMBER -fill #%6.6x -text {%s} \n",
! glist_getcanvas(glist), x,
! x->x_gui.x_fsf.x_selected?
! IEM_GUI_COLOR_SELECTED:x->x_gui.x_fcol,
! x->x_buf);
! x->x_buf[0] = 0;
! }
! }
! }
!
! static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist)
! {
! int half=x->x_gui.x_h/2, d=1+x->x_gui.x_h/34;
! int xpos=text_xpix(&x->x_gui.x_obj, glist);
! int ypos=text_ypix(&x->x_gui.x_obj, glist);
! t_canvas *canvas=glist_getcanvas(glist);
!
! pd_upload(x);
! sys_vgui("numbox_draw %x .x%x.c\n", x, canvas);
! sys_vgui(
! ".x%x.c create line %d %d %d %d %d %d -fill #%6.6x -tags %xBASE2\n",
! canvas, xpos, ypos,
! xpos + half, ypos + half,
! xpos, ypos + x->x_gui.x_h,
! x->x_gui.x_fcol, x);
! my_numbox_ftoa(x);
! sys_vgui(".x%x.c create text %d %d -text {%s} -anchor w \
! -font {%s %d bold} -fill #%6.6x -tags %xNUMBER\n",
! canvas, xpos+half+2, ypos+half+d,
! x->x_buf, x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_fcol, x);
! }
!
! static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist)
! {
! int half = x->x_gui.x_h/2, d=1+x->x_gui.x_h/34;
! int xpos=text_xpix(&x->x_gui.x_obj, glist);
! int ypos=text_ypix(&x->x_gui.x_obj, glist);
! t_canvas *canvas=glist_getcanvas(glist);
! pd_upload(x);
! sys_vgui("numbox_draw %x .x%x.c\n", x, canvas);
! sys_vgui(".x%x.c coords %xBASE2 %d %d %d %d %d %d\n",
! canvas, x, xpos, ypos,
! xpos + half, ypos + half,
! xpos, ypos + x->x_gui.x_h);
! sys_vgui(".x%x.c coords %xNUMBER %d %d\n",
! canvas, x, xpos+half+2, ypos+half+d);
! }
!
! static void my_numbox_draw_erase(t_my_numbox* x,t_glist* glist)
! {
! t_canvas *canvas=glist_getcanvas(glist);
!
! sys_vgui("numbox_erase .x%x.c %xBASE\n", canvas, x);
! sys_vgui(".x%x.c delete %xBASE2\n", canvas, x);
! sys_vgui(".x%x.c delete %xNUMBER\n", canvas, x);
! }
!
! static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist)
! {
! t_canvas *canvas=glist_getcanvas(glist);
! sys_vgui(".x%x.c itemconfigure %xNUMBER -font {%s %d bold} -fill #%6.6x \n",
! canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
! x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_fcol);
! sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas,
! x, x->x_gui.x_bcol);
! sys_vgui(".x%x.c itemconfigure %xBASE2 -fill #%6.6x\n", canvas,
! x, x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_fcol);
! }
!
! static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
!
! if(x->x_gui.x_fsf.x_selected)
! {
! if(x->x_gui.x_fsf.x_change)
! {
! x->x_gui.x_fsf.x_change = 0;
! clock_unset(x->x_clock_reset);
! x->x_buf[0] = 0;
! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
! }
! sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n",
! canvas, x, IEM_GUI_COLOR_SELECTED);
! sys_vgui(".x%x.c itemconfigure %xBASE2 -fill #%6.6x\n",
! canvas, x, IEM_GUI_COLOR_SELECTED);
! sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n",
! canvas, x, IEM_GUI_COLOR_SELECTED);
! sys_vgui(".x%x.c itemconfigure %xNUMBER -fill #%6.6x\n",
! canvas, x, IEM_GUI_COLOR_SELECTED);
! }
! else
! {
! sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n",
! canvas, x, IEM_GUI_COLOR_NORMAL);
! sys_vgui(".x%x.c itemconfigure %xBASE2 -fill #%6.6x\n",
! canvas, x, x->x_gui.x_fcol);
! sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n",
! canvas, x, x->x_gui.x_lcol);
! sys_vgui(".x%x.c itemconfigure %xNUMBER -fill #%6.6x\n",
! canvas, x, x->x_gui.x_fcol);
}
}
- void my_numbox_draw(t_my_numbox *x, t_glist *glist, int mode)
- {
- if(mode == IEM_GUI_DRAW_MODE_UPDATE) my_numbox_draw_update(x, glist);
- else if(mode == IEM_GUI_DRAW_MODE_MOVE) my_numbox_draw_move(x, glist);
- else if(mode == IEM_GUI_DRAW_MODE_NEW) my_numbox_draw_new(x, glist);
- else if(mode == IEM_GUI_DRAW_MODE_SELECT) my_numbox_draw_select(x, glist);
- else if(mode == IEM_GUI_DRAW_MODE_ERASE) my_numbox_draw_erase(x, glist);
- else if(mode == IEM_GUI_DRAW_MODE_CONFIG) my_numbox_draw_config(x, glist);
- else if(mode >= IEM_GUI_DRAW_MODE_IO) my_numbox_draw_move(x, glist);
- }
-
/* ------------------------ nbx widgetbehaviour----------------------------- */
--- 113,138 ----
}
! void my_numbox_draw(t_my_numbox *x, t_glist *glist, int mode)
{
t_canvas *canvas=glist_getcanvas(glist);
! switch (mode) {
! case IEM_GUI_DRAW_MODE_ERASE:
! sys_vgui("numbox_erase .x%x.c %x\n",canvas,x); break;
! case IEM_GUI_DRAW_MODE_SELECT:
! /* if(x->x_gui.x_fsf.x_selected && x->x_gui.x_fsf.x_change) {
! x->x_gui.x_fsf.x_change = 0; CH
! clock_unset(x->x_clock_reset);
! }*/
! /* fallthru */
! default:
! pd_upload((t_gobj *)x);
! my_numbox_ftoa(x);
! sys_vgui("numbox_draw %x .x%x.c\n", x, canvas);
! post("numberbox: %d %d",(int)x->x_gui.x_fsf.x_selected,(int)x->x_gui.x_fsf.x_change);
! sys_vgui("numbox_select %x .x%x.c %d\n", x, canvas,
! (int)x->x_gui.x_fsf.x_selected + 2*(int)x->x_gui.x_fsf.x_change); break;
}
}
/* ------------------------ nbx widgetbehaviour----------------------------- */
***************
*** 278,286 ****
int bflcol[3];
t_symbol *srl[3];
-
iemgui_save(&x->x_gui, srl, bflcol);
! if(x->x_gui.x_fsf.x_change)
! {
! x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
--- 154,161 ----
int bflcol[3];
t_symbol *srl[3];
iemgui_save(&x->x_gui, srl, bflcol);
! /*
! if(x->x_gui.x_fsf.x_change) {
! x->x_gui.x_fsf.x_change = 0; CH
clock_unset(x->x_clock_reset);
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
***************
*** 288,292 ****
}
! binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"),
(t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
gensym("nbx"), x->x_gui.x_w, x->x_gui.x_h,
--- 163,168 ----
}
! */
! binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"),
(t_int)x->x_gui.x_obj.te_xpix, (t_int)x->x_gui.x_obj.te_ypix,
gensym("nbx"), x->x_gui.x_w, x->x_gui.x_h,
***************
*** 334,338 ****
if(x->x_gui.x_fsf.x_change)
{
! x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
--- 210,214 ----
if(x->x_gui.x_fsf.x_change)
{
! x->x_gui.x_fsf.x_change = 0; CH
clock_unset(x->x_clock_reset);
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
***************
*** 392,397 ****
x->x_log_height = log_height;
my_numbox_calc_fontwidth(x);
- /*if(my_numbox_check_minmax(x, min, max))
- my_numbox_bang(x);*/
my_numbox_check_minmax(x, min, max);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
--- 268,271 ----
***************
*** 404,411 ****
static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy)
{
! double k2=1.0;
!
! if(x->x_gui.x_fsf.x_finemoved)
! k2 = 0.01;
if(x->x_lin0_log1)
x->x_val *= pow(x->x_k, -k2*dy);
--- 278,282 ----
static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy)
{
! double k2= x->x_gui.x_fsf.x_finemoved ? 0.01 : 1.0;
if(x->x_lin0_log1)
x->x_val *= pow(x->x_k, -k2*dy);
***************
*** 429,454 ****
{
t_my_numbox* x = (t_my_numbox *)z;
-
if(doit)
{
my_numbox_click( x, (t_floatarg)xpix, (t_floatarg)ypix,
(t_floatarg)shift, 0, (t_floatarg)alt);
! if(shift)
! x->x_gui.x_fsf.x_finemoved = 1;
! else
! x->x_gui.x_fsf.x_finemoved = 0;
if(!x->x_gui.x_fsf.x_change)
{
clock_delay(x->x_clock_wait, 50);
! x->x_gui.x_fsf.x_change = 1;
clock_delay(x->x_clock_reset, 3000);
- /* glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.ob_g,
- 0, my_numbox_key, 0, 0); */
-
x->x_buf[0] = 0;
}
else
{
! x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
--- 300,318 ----
{
t_my_numbox* x = (t_my_numbox *)z;
if(doit)
{
my_numbox_click( x, (t_floatarg)xpix, (t_floatarg)ypix,
(t_floatarg)shift, 0, (t_floatarg)alt);
! x->x_gui.x_fsf.x_finemoved = !! shift;
if(!x->x_gui.x_fsf.x_change)
{
clock_delay(x->x_clock_wait, 50);
! x->x_gui.x_fsf.x_change = 1; CH
clock_delay(x->x_clock_reset, 3000);
x->x_buf[0] = 0;
}
else
{
! x->x_gui.x_fsf.x_change = 0; CH
clock_unset(x->x_clock_reset);
glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
***************
*** 517,521 ****
{
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
- /*my_numbox_bang(x);*/
}
}
--- 381,384 ----
***************
*** 558,562 ****
{
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
- /*my_numbox_bang(x);*/
}
}
--- 421,424 ----
***************
*** 590,594 ****
if (c == 0)
{
! x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
--- 452,456 ----
if (c == 0)
{
! x->x_gui.x_fsf.x_change = 0; CH
clock_unset(x->x_clock_reset);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
***************
*** 618,622 ****
x->x_val = atof(x->x_buf);
x->x_buf[0] = 0;
! x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
my_numbox_clip(x);
--- 480,484 ----
x->x_val = atof(x->x_buf);
x->x_buf[0] = 0;
! x->x_gui.x_fsf.x_change = 0; CH
clock_unset(x->x_clock_reset);
my_numbox_clip(x);
***************
*** 645,649 ****
int log_height=256;
double min=-1.0e+37, max=1.0e+37,v=0.0;
- char str[144];
int isa,fstyle;
t_symbol *srl[3]={0,0,0};
--- 507,510 ----
***************
*** 694,698 ****
x->x_clock_reset = clock_new(x, (t_method)my_numbox_tick_reset);
x->x_clock_wait = clock_new(x, (t_method)my_numbox_tick_wait);
! x->x_gui.x_fsf.x_change = 0;
outlet_new(&x->x_gui.x_obj, &s_float);
return (x);
--- 555,559 ----
x->x_clock_reset = clock_new(x, (t_method)my_numbox_tick_reset);
x->x_clock_wait = clock_new(x, (t_method)my_numbox_tick_wait);
! x->x_gui.x_fsf.x_change = 0; CH
outlet_new(&x->x_gui.x_obj, &s_float);
return (x);
***************
*** 710,768 ****
void g_numbox_setup(void)
{
! my_numbox_class = class_new(gensym("nbx"), (t_newmethod)my_numbox_new,
(t_method)my_numbox_free, sizeof(t_my_numbox), 0, A_GIMME, 0);
class_addcreator((t_newmethod)my_numbox_new, gensym("my_numbox"),
A_GIMME, 0);
! class_addbang(my_numbox_class,my_numbox_bang);
! class_addfloat(my_numbox_class,my_numbox_float);
! class_addlist(my_numbox_class, my_numbox_list);
! class_addmethod(my_numbox_class, (t_method)my_numbox_click,
gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_motion,
gensym("motion"), A_FLOAT, A_FLOAT, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_dialog,
! gensym("dialog"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_loadbang,
! gensym("loadbang"), 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_set,
! gensym("set"), A_FLOAT, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_size,
! gensym("size"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_delta,
! gensym("delta"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_pos,
! gensym("pos"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_range,
! gensym("range"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_color,
! gensym("color"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_send,
! gensym("send"), A_DEFSYM, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_receive,
! gensym("receive"), A_DEFSYM, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_label,
! gensym("label"), A_DEFSYM, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_label_pos,
! gensym("label_pos"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_label_font,
! gensym("label_font"), A_GIMME, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_log,
! gensym("log"), 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_lin,
! gensym("lin"), 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_init,
! gensym("init"), A_FLOAT, 0);
! class_addmethod(my_numbox_class, (t_method)my_numbox_log_height,
! gensym("log_height"), A_FLOAT, 0);
! my_numbox_widgetbehavior.w_getrectfn = my_numbox_getrect;
! my_numbox_widgetbehavior.w_displacefn = iemgui_displace;
! my_numbox_widgetbehavior.w_selectfn = iemgui_select;
! my_numbox_widgetbehavior.w_activatefn = NULL;
! my_numbox_widgetbehavior.w_deletefn = iemgui_delete;
! my_numbox_widgetbehavior.w_visfn = iemgui_vis;
! my_numbox_widgetbehavior.w_clickfn = my_numbox_newclick;
! class_setwidget(my_numbox_class, &my_numbox_widgetbehavior);
! class_sethelpsymbol(my_numbox_class, gensym("numbox2"));
! class_setsavefn(my_numbox_class, my_numbox_save);
! class_setpropertiesfn(my_numbox_class, my_numbox_properties);
}
--- 571,612 ----
void g_numbox_setup(void)
{
! t_class *c = my_numbox_class = class_new(gensym("nbx"), (t_newmethod)my_numbox_new,
(t_method)my_numbox_free, sizeof(t_my_numbox), 0, A_GIMME, 0);
class_addcreator((t_newmethod)my_numbox_new, gensym("my_numbox"),
A_GIMME, 0);
! class_addbang(c,my_numbox_bang);
! class_addfloat(c,my_numbox_float);
! class_addlist(c, my_numbox_list);
! class_addmethod(c, (t_method)my_numbox_click,
gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_motion,
gensym("motion"), A_FLOAT, A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_dialog, gensym("dialog"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_loadbang, gensym("loadbang"), 0);
! class_addmethod(c, (t_method)my_numbox_set, gensym("set"), A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_size, gensym("size"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_delta, gensym("delta"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_pos, gensym("pos"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_range, gensym("range"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_color, gensym("color"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_send, gensym("send"), A_DEFSYM, 0);
! class_addmethod(c, (t_method)my_numbox_receive, gensym("receive"), A_DEFSYM, 0);
! class_addmethod(c, (t_method)my_numbox_label, gensym("label"), A_DEFSYM, 0);
! class_addmethod(c, (t_method)my_numbox_label_pos, gensym("label_pos"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_label_font, gensym("label_font"), A_GIMME, 0);
! class_addmethod(c, (t_method)my_numbox_log, gensym("log"), 0);
! class_addmethod(c, (t_method)my_numbox_lin, gensym("lin"), 0);
! class_addmethod(c, (t_method)my_numbox_init, gensym("init"), A_FLOAT, 0);
! class_addmethod(c, (t_method)my_numbox_log_height, gensym("log_height"), A_FLOAT, 0);
! my_numbox_widgetbehavior.w_getrectfn = my_numbox_getrect;
! my_numbox_widgetbehavior.w_displacefn = iemgui_displace;
! my_numbox_widgetbehavior.w_selectfn = iemgui_select;
! my_numbox_widgetbehavior.w_activatefn = NULL;
! my_numbox_widgetbehavior.w_deletefn = iemgui_delete;
! my_numbox_widgetbehavior.w_visfn = iemgui_vis;
! my_numbox_widgetbehavior.w_clickfn = my_numbox_newclick;
! class_setwidget(c, &my_numbox_widgetbehavior);
! class_sethelpsymbol(c, gensym("numbox2"));
! class_setsavefn(c, my_numbox_save);
! class_setpropertiesfn(c, my_numbox_properties);
}