Update of /cvsroot/pure-data/externals/bbogart/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20646
Modified Files: entry-help.pd entry.c Log Message: made [option( message for passing Tcl/Tk options directly to the text widget; fixed minor bug in the output caused by adding the scrollbar
Index: entry.c =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** entry.c 28 Oct 2007 03:54:54 -0000 1.17 --- entry.c 28 Oct 2007 05:20:34 -0000 1.18 *************** *** 28,32 **** /* TODO: set message doesnt work with a loadbang */ /* TODO: make message to add a single character to the existing text */ ! /* TODO: complete inlet draw/erase logic */
#ifdef _MSC_VER --- 28,32 ---- /* TODO: set message doesnt work with a loadbang */ /* TODO: make message to add a single character to the existing text */ ! /* TODO: complete inlet draw/erase logic */
#ifdef _MSC_VER *************** *** 63,72 **** t_symbol *x_font_weight;
- /* TODO: these all should be settable by messages t_float x_border; t_float x_highlightthickness; t_symbol *x_relief; - */ - t_symbol* x_contents;
t_outlet* x_data_outlet; --- 63,69 ---- *************** *** 438,441 **** --- 435,440 ---- sys_vgui(".x%x.c.s%x.text insert end $::entry%lx::list ; unset ::entry%lx::list \n", x->x_glist, x, x, x ); + DEBUG(post(".x%x.c.s%x.text yview end-2char \n", x->x_glist, x );); + sys_vgui(".x%x.c.s%x.text yview end-2char \n", x->x_glist, x ); }
*************** *** 468,474 **** { /* With "," and ";" escaping thanks to JMZ */ ! DEBUG(post("pd [concat %s output [string map {"," "\\," ";" "\\;"} [.x%x.c.s%x get 0.0 end]] \;]\n", x->x_receive_name->s_name, x->x_glist, x);); ! sys_vgui("pd [concat %s output [string map {"," "\\," ";" "\\;"} [.x%x.c.s%x get 0.0 end]] \;]\n", x->x_receive_name->s_name, x->x_glist, x);
--- 467,475 ---- { /* With "," and ";" escaping thanks to JMZ */ ! DEBUG(post("pd [concat %s output [string map {"," "\\," ";" "\\;"} \ ! [.x%x.c.s%x.text get 0.0 end]] \;]\n", x->x_receive_name->s_name, x->x_glist, x);); ! sys_vgui("pd [concat %s output [string map {"," "\\," ";" "\\;"} \ ! [.x%x.c.s%x.text get 0.0 end]] \;]\n", x->x_receive_name->s_name, x->x_glist, x);
*************** *** 538,541 **** --- 539,577 ---- }
+ + static void entry_option_float(t_entry* x, t_symbol *option, t_float value) + { + DEBUG(post(".x%x.c.s%x.text configure -%s %f \n", + x->x_glist, x, option->s_name, value);); + sys_vgui(".x%x.c.s%x.text configure -%s %f \n", + x->x_glist, x, option->s_name, value); + } + + static void entry_option_symbol(t_entry* x, t_symbol *option, t_symbol *value) + { + DEBUG(post(".x%x.c.s%x.text configure -%s {%s} \n", + x->x_glist, x, option->s_name, value->s_name);); + sys_vgui(".x%x.c.s%x.text configure -%s {%s} \n", + x->x_glist, x, option->s_name, value->s_name); + } + + static void entry_option(t_entry *x, t_symbol *s, int argc, t_atom *argv) + { + t_symbol *tmp_symbol = s; /* <-- this gets rid of the unused variable warning */ + t_float tmp_float; + + tmp_symbol = atom_getsymbolarg(1, argc, argv); + if(tmp_symbol == &s_) + { + entry_option_float(x,atom_getsymbolarg(0, argc, argv), + atom_getfloatarg(1, argc, argv)); + } + else + { + entry_option_symbol(x,atom_getsymbolarg(0, argc, argv),tmp_symbol); + } + } + + /* function to change colour of text background */ void entry_bgcolour(t_entry* x, t_symbol* bgcol) *************** *** 637,640 **** --- 673,681 ---- 0);
+ class_addmethod(entry_class, (t_method)entry_option, + gensym("option"), + A_GIMME, + 0); + class_addmethod(entry_class, (t_method)entry_size, gensym("size"),
Index: entry-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry-help.pd,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** entry-help.pd 28 Oct 2007 03:54:54 -0000 1.6 --- entry-help.pd 28 Oct 2007 05:20:34 -0000 1.7 *************** *** 1,3 **** ! #N canvas 200 48 484 603 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 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 *************** *** 8,32 **** #X msg 72 50 fgcolour yellow; #X msg 50 23 bgcolour purple; ! #X obj 128 473 entry 100 100 grey70 purple; #X text 8 365 Creation arguments are: width height bgcolor fgcolor. The width and height are in pixels.; ! #X obj 261 234 select return; #X obj 79 347 pddp/print; #X obj 176 173 trigger bang bang; #X msg 176 194 clear; #X symbolatom 216 319 10 0 0 1 last_key_typed - -; ! #X text 266 262 ^-- hit return to output; ! #X msg 132 430 size 100 100; #X msg 219 430 size 400 200; #X msg 29 4 bgcolour grey; #X msg 84 71 fgcolour black; ! #X text 13 404 The size message currently only takes affect after a save and reopen.; #X msg 169 127 add seven eight nine; #X msg 196 149 add ten eleven.; ! #X msg 26 469 fontsize $1; ! #X msg 48 442 12; ! #X msg 16 441 9; ! #X msg 81 439 98; #X connect 0 0 2 0; #X connect 0 0 10 0; --- 8,98 ---- #X msg 72 50 fgcolour yellow; #X msg 50 23 bgcolour purple; ! #X obj 142 462 entry 100 50 grey70 purple; #X text 8 365 Creation arguments are: width height bgcolor fgcolor. The width and height are in pixels.; ! #X obj 251 254 select return; #X obj 79 347 pddp/print; #X obj 176 173 trigger bang bang; #X msg 176 194 clear; #X symbolatom 216 319 10 0 0 1 last_key_typed - -; ! #X text 255 275 ^-- hit return to output; #X msg 219 430 size 400 200; #X msg 29 4 bgcolour grey; #X msg 84 71 fgcolour black; ! #X text 12 394 The size message currently only takes affect after a save and reopen.; #X msg 169 127 add seven eight nine; #X msg 196 149 add ten eleven.; ! #X msg 30 459 fontsize $1; ! #X msg 52 432 12; ! #X msg 20 431 9; ! #X msg 85 429 98; ! #X obj 166 18 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/text.htm ! ; ! #X obj 572 91 entry 300 50 grey70 black; ! #X msg 572 67 option relief $1; ! #X obj 571 46 symbol; ! #X msg 469 11 flat; ! #X msg 504 11 groove; ! #X msg 551 11 raised; ! #X msg 599 10 ridge; ! #X msg 640 10 solid; ! #X msg 681 10 sunken; ! #X obj 366 524 entry 124 100 grey70 black; ! #X obj 368 468 symbol; ! #X obj 558 526 entry 124 100 grey70 black; ! #X obj 558 478 symbol; ! #X msg 541 454 on; ! #X msg 575 453 off; ! #X msg 349 443 normal; ! #X msg 395 443 disabled; ! #X msg 367 491 option state $1; ! #X msg 558 500 option undo $1; ! #X msg 132 430 size 100 50; ! #X text 421 470 disable editing; ! #X text 608 469 turn on undo; ! #X obj 572 217 entry 100 50 grey70 black; ! #X obj 571 172 symbol; ! #X obj 502 394 entry 100 50 grey70 black; ! #X obj 501 349 symbol; ! #X msg 572 193 option wrap $1; ! #X msg 529 147 none; ! #X msg 564 147 char; ! #X msg 601 147 word; ! #X text 618 171 word wrapping; ! #X msg 502 370 option selectbackground $1; ! #X msg 419 304 blue; ! #X msg 454 304 purple; ! #X msg 501 304 orange; ! #X msg 549 303 magenta; ! #X obj 425 281 pddp/pddplink http://en.wikipedia.org/wiki/X11_color_names ! ; ! #X msg 603 303 DarkSlateBlue; ! #X msg 603 342 limegreen; ! #X msg 603 323 lightyellow; ! #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; ! #X obj 161 636 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm ! ; ! #X msg 49 521 boat; ! #X msg 84 521 bogosity; ! #X msg 52 577 option cursor $1; ! #X msg 9 521 clock; ! #X msg 145 521 dot; ! #X msg 175 521 dotbox; ! #X msg 222 521 gumby; ! #X msg 265 521 gobbler; ! #X msg 266 590 pirate; ! #X msg 266 547 mouse; ! #X msg 266 569 target; ! #X text 174 615 for more:; ! #X msg 266 611 trek; ! #X msg 384 194 option insertwidth $1; ! #X obj 386 48 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 ! -1 -1 0 1; ! #X msg 383 68 option borderwidth $1; #X connect 0 0 2 0; #X connect 0 0 10 0; *************** *** 43,53 **** #X connect 12 0 0 0; #X connect 15 0 7 0; ! #X connect 16 0 7 0; #X connect 17 0 0 0; ! #X connect 18 0 0 0; #X connect 20 0 0 0; ! #X connect 21 0 0 0; ! #X connect 22 0 7 0; ! #X connect 23 0 22 0; ! #X connect 24 0 22 0; ! #X connect 25 0 22 0; --- 109,165 ---- #X connect 12 0 0 0; #X connect 15 0 7 0; ! #X connect 16 0 0 0; #X connect 17 0 0 0; ! #X connect 19 0 0 0; #X connect 20 0 0 0; ! #X connect 21 0 7 0; ! #X connect 22 0 21 0; ! #X connect 23 0 21 0; ! #X connect 24 0 21 0; ! #X connect 27 0 26 0; ! #X connect 28 0 27 0; ! #X connect 29 0 28 0; ! #X connect 30 0 28 0; ! #X connect 31 0 28 0; ! #X connect 32 0 28 0; ! #X connect 33 0 28 0; ! #X connect 34 0 28 0; ! #X connect 36 0 43 0; ! #X connect 38 0 44 0; ! #X connect 39 0 38 0; ! #X connect 40 0 38 0; ! #X connect 41 0 36 0; ! #X connect 42 0 36 0; ! #X connect 43 0 35 0; ! #X connect 44 0 37 0; ! #X connect 45 0 7 0; ! #X connect 49 0 52 0; ! #X connect 51 0 57 0; ! #X connect 52 0 48 0; ! #X connect 53 0 49 0; ! #X connect 54 0 49 0; ! #X connect 55 0 49 0; ! #X connect 57 0 50 0; ! #X connect 58 0 51 0; ! #X connect 59 0 51 0; ! #X connect 60 0 51 0; ! #X connect 61 0 51 0; ! #X connect 63 0 51 0; ! #X connect 64 0 51 0; ! #X connect 65 0 51 0; ! #X connect 67 0 84 0; ! #X connect 69 0 73 0; ! #X connect 71 0 69 0; ! #X connect 72 0 69 0; ! #X connect 73 0 68 0; ! #X connect 75 0 69 0; ! #X connect 76 0 69 0; ! #X connect 77 0 69 0; ! #X connect 78 0 69 0; ! #X connect 79 0 69 0; ! #X connect 80 0 69 0; ! #X connect 81 0 69 0; ! #X connect 83 0 69 0; ! #X connect 84 0 66 0; ! #X connect 85 0 86 0; ! #X connect 86 0 26 0;