Update of /cvsroot/pure-data/externals/bbogart/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32419
Modified Files: entry-help.pd entry.c Log Message: added [scrollbar( message so that you can disable/enable the scrollbar
Index: entry.c =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** entry.c 28 Oct 2007 05:20:34 -0000 1.18 --- entry.c 28 Oct 2007 05:53:09 -0000 1.19 *************** *** 66,70 **** t_float x_highlightthickness; t_symbol *x_relief; ! t_outlet* x_data_outlet; t_outlet* x_status_outlet; --- 66,71 ---- t_float x_highlightthickness; t_symbol *x_relief; ! t_int x_have_scrollbar; ! t_outlet* x_data_outlet; t_outlet* x_status_outlet; *************** *** 206,209 **** --- 207,225 ---- } */ + static void draw_scrollbar(t_entry *x) + { + DEBUG(post("pack .x%x.c.s%x.scrollbar -side right -fill y -before .x%x.c.s%x.text \n", + x->x_glist, x, x->x_glist, x);); + sys_vgui("pack .x%x.c.s%x.scrollbar -side right -fill y -before .x%x.c.s%x.text \n", + x->x_glist, x, x->x_glist, x); + x->x_have_scrollbar = 1; + } + + static void erase_scrollbar(t_entry *x) + { + DEBUG(post("pack forget .x%x.c.s%x.scrollbar \n", x->x_glist, x);); + sys_vgui("pack forget .x%x.c.s%x.scrollbar \n", x->x_glist, x); + x->x_have_scrollbar = 0; + }
static void create_widget(t_entry *x, t_glist *glist) *************** *** 559,563 **** { t_symbol *tmp_symbol = s; /* <-- this gets rid of the unused variable warning */ - t_float tmp_float;
tmp_symbol = atom_getsymbolarg(1, argc, argv); --- 575,578 ---- *************** *** 573,576 **** --- 588,599 ---- }
+ static void entry_scrollbar(t_entry *x, t_float f) + { + if(f > 0) + draw_scrollbar(x); + else + erase_scrollbar(x); + } +
/* function to change colour of text background */ *************** *** 635,638 **** --- 658,662 ---- x->x_font_size = 10; x->x_font_weight = gensym("normal"); + x->x_have_scrollbar = 1; if (argc < 4) *************** *** 673,676 **** --- 697,705 ---- 0);
+ class_addmethod(entry_class, (t_method)entry_scrollbar, + gensym("scrollbar"), + A_DEFFLOAT, + 0); + class_addmethod(entry_class, (t_method)entry_option, gensym("option"),
Index: entry-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry-help.pd,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** entry-help.pd 28 Oct 2007 05:20:34 -0000 1.7 --- entry-help.pd 28 Oct 2007 05:53:08 -0000 1.8 *************** *** 1,3 **** ! #N canvas 172 88 736 664 10; #X obj 73 212 entry 150 100 grey black; #X obj 11 84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --- 1,3 ---- ! #N canvas 172 88 748 676 10; #X obj 73 212 entry 150 100 grey black; #X obj 11 84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 *************** *** 73,77 **** #X obj 384 218 entry 100 50 grey70 black; #X obj 386 167 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 ! -1 -1 2000 1; #X obj 52 601 entry 100 50 grey70 black; #X obj 51 556 symbol; --- 73,77 ---- #X obj 384 218 entry 100 50 grey70 black; #X obj 386 167 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 ! -1 -1 0 1; #X obj 52 601 entry 100 50 grey70 black; #X obj 51 556 symbol; *************** *** 95,98 **** --- 95,101 ---- -1 -1 0 1; #X msg 383 68 option borderwidth $1; + #X msg 395 366 scrollbar $1; + #X obj 395 346 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 + 1; #X connect 0 0 2 0; #X connect 0 0 10 0; *************** *** 164,165 **** --- 167,170 ---- #X connect 85 0 86 0; #X connect 86 0 26 0; + #X connect 87 0 50 0; + #X connect 88 0 87 0;