Update of /cvsroot/pure-data/externals/tkwidgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16532
Modified Files: text-help.pd text.c Log Message:
- made selection color change restore previous background color
- moved scrollbar handling to tkwidgets.c
Index: text.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/text.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** text.c 24 Nov 2007 04:51:33 -0000 1.14 --- text.c 24 Nov 2007 05:57:15 -0000 1.15 *************** *** 28,36 **** /* TODO: window name "handle1376fc00" already exists in parent */ /* TODO: figure out window vs. text width/height */ ! /* TODO: handle bg color on select/deselect */ ! ! ! #define DEFAULT_COLOR "grey70"
#define TEXT_DEFAULT_WIDTH 200 #define TEXT_DEFAULT_HEIGHT 60 --- 28,34 ---- /* TODO: window name "handle1376fc00" already exists in parent */ /* TODO: figure out window vs. text width/height */ ! /* TODO: add x scrollbar */
+ #define TEXT_DEFAULT_COLOR "grey90" #define TEXT_DEFAULT_WIDTH 200 #define TEXT_DEFAULT_HEIGHT 60 *************** *** 160,176 **** }
- static void draw_scrollbar(t_textwidget *x) - { - sys_vgui("pack %s -side right -fill y -before %s \n", - x->scrollbar_id->s_name, x->widget_id->s_name); - x->have_scrollbars = 1; - } - - static void erase_scrollbar(t_textwidget *x) - { - sys_vgui("pack forget %s \n", x->scrollbar_id->s_name); - x->have_scrollbars = 0; - } - static void create_widget(t_textwidget *x) { --- 158,161 ---- *************** *** 182,190 **** sys_vgui("destroy %s\n", x->frame_id->s_name); sys_vgui("frame %s \n", x->frame_id->s_name); ! sys_vgui("text %s -border 1 \ ! -highlightthickness 1 -relief sunken -bg "%s" -yscrollcommand {%s set} \n", ! x->widget_id->s_name, DEFAULT_COLOR, x->scrollbar_id->s_name); ! sys_vgui("scrollbar %s -command {%s yview}\n", ! x->scrollbar_id->s_name, x->widget_id->s_name); sys_vgui("pack %s -side left -fill both -expand 1 \n", x->widget_id->s_name); sys_vgui("pack %s -side bottom -fill both -expand 1 \n", x->frame_id->s_name); --- 167,172 ---- sys_vgui("destroy %s\n", x->frame_id->s_name); sys_vgui("frame %s \n", x->frame_id->s_name); ! sys_vgui("text %s -bd 1 -highlightbackground grey70 -highlightthickness 1 -bg %s\n", ! x->widget_id->s_name, TEXT_DEFAULT_COLOR); sys_vgui("pack %s -side left -fill both -expand 1 \n", x->widget_id->s_name); sys_vgui("pack %s -side bottom -fill both -expand 1 \n", x->frame_id->s_name); *************** *** 205,209 **** x->canvas_id, x->iolets_tag, x->all_tag, x->width, x->height); ! if(x->have_scrollbars) draw_scrollbar(x); sys_vgui("%s create window %d %d -anchor nw -window %s \ -tags {%s %s} -width %d -height %d \n", x->canvas_id->s_name, --- 187,192 ---- x->canvas_id, x->iolets_tag, x->all_tag, x->width, x->height); ! if(x->have_scrollbars) ! tkwidgets_draw_y_scrollbar(x->widget_id, x->scrollbar_id); sys_vgui("%s create window %d %d -anchor nw -window %s \ -tags {%s %s} -width %d -height %d \n", x->canvas_id->s_name, *************** *** 260,272 **** if( (state) && (!x->x_selected)) { ! sys_vgui("%s configure -bg #bdbddd -state disabled -cursor $cursor_editmode_nothing\n", ! x->widget_id->s_name); x->x_selected = 1; } else if (!state) { ! sys_vgui("%s configure -bg grey -state normal -cursor xterm\n", ! x->widget_id->s_name); ! /* activatefn never gets called with 0, so destroy here */ sys_vgui("destroy %s\n", x->handle_id->s_name); x->x_selected = 0; --- 243,257 ---- if( (state) && (!x->x_selected)) { ! sys_vgui("set ::%s::bg [%s cget -bg]\n", ! x->tcl_namespace->s_name, x->widget_id->s_name); ! sys_vgui("%s configure -bg %s -state disabled -cursor $cursor_editmode_nothing\n", ! x->widget_id->s_name, TKW_SELECTION_COLOR); x->x_selected = 1; } else if (!state) { ! sys_vgui("%s configure -bg $::%s::bg -state normal -cursor xterm\n", ! x->widget_id->s_name, x->tcl_namespace->s_name); ! /* activatefn never gets called with 0, so destroy handle here */ sys_vgui("destroy %s\n", x->handle_id->s_name); x->x_selected = 0; *************** *** 490,496 **** int value = (int) f; if(value > 0) ! draw_scrollbar(x); else ! erase_scrollbar(x); }
--- 475,487 ---- int value = (int) f; if(value > 0) ! { ! x->have_scrollbars = 1; ! tkwidgets_draw_y_scrollbar(x->widget_id, x->scrollbar_id); ! } else ! { ! x->have_scrollbars = 0; ! tkwidgets_erase_y_scrollbar(x->widget_id, x->scrollbar_id); ! } }
Index: text-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/text-help.pd,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** text-help.pd 14 Nov 2007 07:49:26 -0000 1.2 --- text-help.pd 24 Nov 2007 05:57:15 -0000 1.3 *************** *** 1,100 **** #N canvas 343 45 785 704 10; ! #X obj 52 -48 text 130 60 0; ! #X obj 53 -198 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; ! #X obj 12 60 print; ! #X msg 89 -183 clear; ! #X msg 107 -162 set one two three four five six; ! #X obj 36 137 text 130 60 0; ! #X obj 231 -2 select return; ! #X obj 59 61 pddp/print; ! #X obj 198 -91 trigger bang bang; ! #X msg 198 -70 clear; ! #X symbolatom 196 63 10 0 0 1 last_key_typed - -; ! #X text 235 19 ^-- hit return to output; ! #X msg 118 -139 append seven eight nine; ! #X msg 122 -119 append ten eleven.; ! #X obj 554 -176 text 130 60 0; ! #X obj 581 -218 symbol; ! #X msg 479 -245 flat; ! #X msg 514 -245 groove; ! #X msg 561 -245 raised; ! #X msg 609 -246 ridge; ! #X msg 650 -246 solid; ! #X msg 691 -246 sunken; ! #X obj 653 276 symbol; ! #X obj 557 278 symbol; ! #X msg 540 254 on; ! #X msg 574 253 off; ! #X msg 634 251 normal; ! #X msg 680 251 disabled; ! #X msg 26 105 size 100 50; ! #X text 633 231 disable editing; ! #X obj 582 -39 text 130 60 0; ! #X obj 581 -84 symbol; ! #X obj 513 147 text 130 60 0; ! #X obj 577 102 symbol; ! #X msg 539 -109 none; ! #X msg 574 -109 char; ! #X msg 611 -109 word; ! #X text 628 -85 word wrapping; ! #X msg 612 70 purple; ! #X msg 659 70 orange; ! #X msg 707 69 magenta; ! #X obj 452 40 pddp/pddplink http://en.wikipedia.org/wiki/X11_color_names ; ! #X obj 394 -39 text 130 60 0; ! #X obj 396 -89 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 -1 -1 0 1; ! #X obj 62 345 text 130 60 0; ! #X obj 61 300 symbol; ! #X obj 49 409 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm ; ! #X msg 59 265 boat; ! #X msg 19 265 clock; ! #X msg 162 265 gumby; ! #X msg 205 265 gobbler; ! #X obj 404 -217 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 ! -1 -1 0 1; ! #X obj 471 99 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 1; ! #X msg 109 -85 key a; ! #X msg 150 -85 key 32; ! #X obj 352 254 keyup; ! #X msg 352 293 key $1; ! #X floatatom 369 275 5 0 0 0 - - -; ! #X msg 249 -46 key 3322; ! #X obj 560 330 text 130 60 0; ! #X obj 352 328 text 130 60 0; ! #X text 347 232 type single chars:; ! #X msg 421 279 key a; ! #X msg 422 301 key 9; ! #X text 204 387 for more cursors:; ! #X text 337 393 for more keynums:; ! #X msg 413 260 key 65228; ! #X msg 94 265 coffee_mug; ! #X msg 62 321 cursor $1; ! #X msg 578 123 selectbackground $1; ! #X msg 401 -197 borderwidth $1; ! #X msg 582 -197 relief $1; ! #X msg 582 -63 wrap $1; ! #X msg 394 -62 insertwidth $1; ! #X msg 557 300 undo $1; ! #X msg 652 299 state $1; ! #X msg 113 105 size 200 100; ! #X msg 577 70 #00f; ! #X text 528 231 turn off undo; ! #X obj 261 152 text 130 60 0; ! #X msg 285 128 font "Lucida Sans" 18 bold; ! #X msg 261 103 font Arial 16; ! #X obj 339 407 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/keysyms.htm ; ! #X obj 140 -258 pddp/pddplink http://puredata.info/dev/TkWidget -text TkWidget library; ! #X text 22 -258 This is part of the; ! #X obj 186 -234 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/text.htm -text text; ! #X text 37 -234 This object is based on:; ! #X msg 471 119 scrollbars $1; #X connect 0 0 2 0; #X connect 0 0 7 0; --- 1,145 ---- #N canvas 343 45 785 704 10; ! #X obj 52 -43 text 130 60 0; ! #X obj 53 -193 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; ! #X obj 12 65 print; ! #X msg 89 -178 clear; ! #X msg 107 -157 set one two three four five six; ! #X obj 36 142 text 130 60 0; ! #X obj 231 3 select return; ! #X obj 59 66 pddp/print; ! #X obj 198 -86 trigger bang bang; ! #X msg 198 -65 clear; ! #X symbolatom 196 68 10 0 0 1 last_key_typed - -; ! #X text 235 24 ^-- hit return to output; ! #X msg 118 -134 append seven eight nine; ! #X msg 122 -114 append ten eleven.; ! #X obj 554 -171 text 130 60 0 -autoseparators 1 -background white -borderwidth ! 2 -cursor xterm -exportselection 1 -font {Courier 12} -foreground Black ! -height 24 -highlightbackground systemWindowBody -highlightcolor Black ! -highlightthickness 1 -insertbackground Black -insertborderwidth 0 ! -insertofftime 300 -insertontime 600 -insertwidth 1 -maxundo 0 -padx ! 1 -pady 1 -relief sunken -selectbackground systemHighlightSecondary ! -selectborderwidth 1 -selectforeground systemHighlightText -setgrid ! 0 -spacing1 0 -spacing2 0 -spacing3 0 -state normal -undo 0 -width ! 80 -wrap char; ! #X obj 581 -213 symbol; ! #X msg 479 -240 flat; ! #X msg 514 -240 groove; ! #X msg 561 -240 raised; ! #X msg 609 -241 ridge; ! #X msg 650 -241 solid; ! #X msg 691 -241 sunken; ! #X obj 653 281 symbol; ! #X obj 557 283 symbol; ! #X msg 540 259 on; ! #X msg 574 258 off; ! #X msg 634 256 normal; ! #X msg 680 256 disabled; ! #X msg 26 110 size 100 50; ! #X text 633 236 disable editing; ! #X obj 582 -34 text 130 60 0; ! #X obj 581 -79 symbol; ! #X obj 597 107 symbol; ! #X msg 539 -104 none; ! #X msg 574 -104 char; ! #X msg 611 -104 word; ! #X text 628 -80 word wrapping; ! #X msg 612 75 purple; ! #X msg 659 75 orange; ! #X msg 707 74 magenta; ! #X obj 452 45 pddp/pddplink http://en.wikipedia.org/wiki/X11_color_names ; ! #X obj 394 -34 text 130 60 0 -autoseparators 1 -background grey70 -borderwidth ! 1 -cursor xterm -exportselection 1 -font {Courier 12} -foreground Black ! -height 24 -highlightbackground systemWindowBody -highlightcolor Black ! -highlightthickness 1 -insertbackground Black -insertborderwidth 0 ! -insertofftime 300 -insertontime 600 -insertwidth 0 -maxundo 0 -padx ! 1 -pady 1 -relief sunken -selectbackground systemHighlightSecondary ! -selectborderwidth 1 -selectforeground systemHighlightText -setgrid ! 0 -spacing1 0 -spacing2 0 -spacing3 0 -state normal -undo 0 -width ! 80 -wrap char; ! #X obj 331 -90 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 -1 -1 0 1; ! #X obj 59 330 text 130 60 0 -autoseparators 1 -background grey70 -borderwidth ! 1 -cursor gobbler -exportselection 1 -font {Courier 12} -foreground ! Black -height 24 -highlightbackground systemWindowBody -highlightcolor ! Black -highlightthickness 1 -insertbackground Black -insertborderwidth ! 0 -insertofftime 300 -insertontime 600 -insertwidth 1 -maxundo 0 -padx ! 1 -pady 1 -relief sunken -selectbackground systemHighlight -selectborderwidth ! 1 -selectforeground systemHighlightText -setgrid 0 -spacing1 0 -spacing2 ! 0 -spacing3 0 -state normal -undo 0 -width 80 -wrap char; ! #X obj 58 285 symbol; ! #X obj 46 394 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm ; ! #X msg 56 250 boat; ! #X msg 16 250 clock; ! #X msg 159 250 gumby; ! #X msg 202 250 gobbler; ! #X obj 404 -212 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 ! -1 -1 200 1; ! #X obj 470 -90 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 1; ! #X msg 109 -80 key a; ! #X msg 150 -80 key 32; ! #X obj 352 259 keyup; ! #X msg 352 298 key $1; ! #X floatatom 369 280 5 0 0 0 - - -; ! #X msg 249 -41 key 3322; ! #X obj 560 335 text 130 60 0; ! #X obj 352 333 text 130 60 0; ! #X text 347 237 type single chars:; ! #X msg 421 284 key a; ! #X msg 422 306 key 9; ! #X text 201 372 for more cursors:; ! #X text 337 398 for more keynums:; ! #X msg 413 265 key 65228; ! #X msg 91 250 coffee_mug; ! #X msg 59 306 cursor $1; ! #X msg 401 -192 borderwidth $1; ! #X msg 582 -192 relief $1; ! #X msg 582 -58 wrap $1; ! #X msg 328 -70 insertwidth $1; ! #X msg 557 305 undo $1; ! #X msg 652 304 state $1; ! #X msg 113 110 size 200 100; ! #X msg 577 75 #00f; ! #X text 528 236 turn off undo; ! #X obj 261 157 text 130 60 0 -autoseparators 1 -background grey70 -borderwidth ! 1 -cursor xterm -exportselection 1 -font {"Lucida Sans" 18 bold} -foreground ! Black -height 24 -highlightbackground systemWindowBody -highlightcolor ! Black -highlightthickness 1 -insertbackground Black -insertborderwidth ! 0 -insertofftime 300 -insertontime 600 -insertwidth 1 -maxundo 0 -padx ! 1 -pady 1 -relief sunken -selectbackground systemHighlightSecondary ! -selectborderwidth 1 -selectforeground systemHighlightText -setgrid ! 0 -spacing1 0 -spacing2 0 -spacing3 0 -state normal -undo 0 -width ! 80 -wrap char; ! #X msg 285 133 font "Lucida Sans" 18 bold; ! #X msg 261 108 font Arial 16; ! #X obj 339 412 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/keysyms.htm ; ! #X obj 140 -253 pddp/pddplink http://puredata.info/dev/TkWidget -text TkWidget library; ! #X text 22 -253 This is part of the; ! #X obj 186 -229 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/text.htm -text text; ! #X text 37 -229 This object is based on:; ! #X msg 470 -70 scrollbars $1; ! #X msg 598 128 background $1; ! #X obj 469 160 text 300 60 0 -autoseparators 1 -background orange -borderwidth ! 1 -cursor xterm -exportselection 1 -font {Courier 12} -foreground magenta ! -height 24 -highlightbackground systemWindowBody -highlightcolor Black ! -highlightthickness 1 -insertbackground Black -insertborderwidth 0 ! -insertofftime 300 -insertontime 600 -insertwidth 1 -maxundo 0 -padx ! 1 -pady 1 -relief sunken -selectbackground systemHighlightSecondary ! -selectborderwidth 1 -selectforeground systemHighlightText -setgrid ! 0 -spacing1 0 -spacing2 0 -spacing3 0 -state normal -undo 0 -width ! 80 -wrap char; ! #X obj 479 107 symbol; ! #X msg 519 74 magenta; ! #X msg 480 128 foreground $1; ! #X msg 399 75 #ff0; ! #X msg 435 75 grey; ! #X msg 471 75 black; #X connect 0 0 2 0; #X connect 0 0 7 0; *************** *** 110,114 **** #X connect 12 0 0 0; #X connect 13 0 0 0; ! #X connect 15 0 71 0; #X connect 16 0 15 0; #X connect 17 0 15 0; --- 155,159 ---- #X connect 12 0 0 0; #X connect 13 0 0 0; ! #X connect 15 0 69 0; #X connect 16 0 15 0; #X connect 17 0 15 0; *************** *** 117,122 **** #X connect 20 0 15 0; #X connect 21 0 15 0; ! #X connect 22 0 75 0; ! #X connect 23 0 74 0; #X connect 24 0 23 0; #X connect 25 0 23 0; --- 162,167 ---- #X connect 20 0 15 0; #X connect 21 0 15 0; ! #X connect 22 0 73 0; ! #X connect 23 0 72 0; #X connect 24 0 23 0; #X connect 25 0 23 0; *************** *** 124,164 **** #X connect 27 0 22 0; #X connect 28 0 5 0; ! #X connect 31 0 72 0; ! #X connect 33 0 69 0; #X connect 34 0 31 0; #X connect 35 0 31 0; ! #X connect 36 0 31 0; ! #X connect 38 0 33 0; ! #X connect 39 0 33 0; ! #X connect 40 0 33 0; ! #X connect 43 0 73 0; ! #X connect 45 0 68 0; ! #X connect 47 0 45 0; ! #X connect 48 0 45 0; ! #X connect 49 0 45 0; ! #X connect 50 0 45 0; ! #X connect 51 0 70 0; ! #X connect 52 0 87 0; #X connect 53 0 0 0; ! #X connect 54 0 0 0; ! #X connect 55 0 56 0; ! #X connect 55 0 57 0; ! #X connect 56 0 60 0; ! #X connect 58 0 0 0; ! #X connect 62 0 60 0; ! #X connect 63 0 60 0; ! #X connect 66 0 60 0; ! #X connect 67 0 45 0; ! #X connect 68 0 44 0; ! #X connect 69 0 32 0; ! #X connect 70 0 14 0; ! #X connect 71 0 14 0; ! #X connect 72 0 30 0; ! #X connect 73 0 42 0; ! #X connect 74 0 59 0; ! #X connect 75 0 59 0; ! #X connect 76 0 5 0; ! #X connect 77 0 33 0; ! #X connect 80 0 79 0; ! #X connect 81 0 79 0; ! #X connect 87 0 32 0; --- 169,215 ---- #X connect 27 0 22 0; #X connect 28 0 5 0; ! #X connect 31 0 70 0; ! #X connect 32 0 86 0; ! #X connect 33 0 31 0; #X connect 34 0 31 0; #X connect 35 0 31 0; ! #X connect 37 0 32 0; ! #X connect 38 0 32 0; ! #X connect 39 0 32 0; ! #X connect 42 0 71 0; ! #X connect 44 0 67 0; ! #X connect 46 0 44 0; ! #X connect 47 0 44 0; ! #X connect 48 0 44 0; ! #X connect 49 0 44 0; ! #X connect 50 0 68 0; ! #X connect 51 0 85 0; ! #X connect 52 0 0 0; #X connect 53 0 0 0; ! #X connect 54 0 55 0; ! #X connect 54 0 56 0; ! #X connect 55 0 59 0; ! #X connect 57 0 0 0; ! #X connect 61 0 59 0; ! #X connect 62 0 59 0; ! #X connect 65 0 59 0; ! #X connect 66 0 44 0; ! #X connect 67 0 43 0; ! #X connect 68 0 14 0; ! #X connect 69 0 14 0; ! #X connect 70 0 30 0; ! #X connect 71 0 41 0; ! #X connect 72 0 58 0; ! #X connect 73 0 58 0; ! #X connect 74 0 5 0; ! #X connect 75 0 32 0; ! #X connect 78 0 77 0; ! #X connect 79 0 77 0; ! #X connect 85 0 41 0; ! #X connect 86 0 87 0; ! #X connect 88 0 90 0; ! #X connect 89 0 88 0; ! #X connect 90 0 87 0; ! #X connect 91 0 88 0; ! #X connect 92 0 88 0; ! #X connect 93 0 88 0;