Update of /cvsroot/pure-data/externals/bbogart/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23710
Modified Files: entry.c Log Message:
- remove unused vars and functions
- ironed out logic for moving handle while resizing
Index: entry.c =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** entry.c 13 Nov 2007 20:20:54 -0000 1.32 --- entry.c 13 Nov 2007 21:13:19 -0000 1.33 *************** *** 23,33 ****
/* TODO: get Ctrl-A working to select all */ - /* TODO: make Ctrl-w bind to window close on parent canvas */ - /* TODO: make [size( message redraw object */ /* TODO: set message doesnt work with a loadbang */ - /* TODO: complete inlet draw/erase logic */ - /* TODO: handle scrollbar when resizing */ - /* TODO: sort out x_height/x_width vs. x_rect_height/x_rect_width */ - /* TODO: check Scope~ to see how it loses selection on editmode 0 */
--- 23,27 ---- *************** *** 41,45 **** #endif
! #define BACKGROUNDCOLOR "grey70"
#define TKW_HANDLE_HEIGHT 15 --- 35,39 ---- #endif
! #define DEFAULT_COLOR "grey70"
#define TKW_HANDLE_HEIGHT 15 *************** *** 68,73 **** int x_width; int x_resizing; - int x_resize_x; - int x_resize_y;
t_symbol *x_bgcolour; --- 62,65 ---- *************** *** 134,145 ****
/* widget helper functions */ - - static void get_widget_state(t_entry *x) - { - // build list of options in Tcl - // make Tcl foreach loop to get those options and create a list with the results - // return results via callback receive as one big list - } - static void set_tk_widget_ids(t_entry *x, t_canvas *canvas) { --- 126,129 ---- *************** *** 243,254 **** }
- static void draw_resize_handle(t_entry *x) - { - } - - static void erase_resize_handle(t_entry *x) - { - } - static void bind_standard_keys(t_entry *x) { --- 227,230 ---- *************** *** 380,383 **** --- 356,360 ---- set_tk_widget_ids(x,glist_getcanvas(glist)); sys_vgui("%s move %s %d %d\n", x->canvas_id, x->all_tag, dx, dy); + sys_vgui("%s move RSZ %d %d\n", x->canvas_id, dx, dy); /* sys_vgui("%s coords %s %d %d %d %d\n", x->canvas_id, x->all_tag, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, *************** *** 393,403 **** { t_entry *x = (t_entry *)z; - int x1, y1, x2, y2; DEBUG(post("entry_select: canvas %lx glist %lx state %d", x->x_canvas, glist, state););
- // set_tk_widget_ids(x,glist_getcanvas(glist)); if( (state) && (!x->x_selected)) { - // entry_getrect(z, glist, &x1, &y1, &x2, &y2); sys_vgui("%s configure -bg #bdbddd -state disabled -cursor $cursor_editmode_nothing\n", x->text_id); --- 370,377 ---- *************** *** 428,434 **** int handle_x1 = x2 - TKW_HANDLE_WIDTH; int handle_y1 = y2 - (TKW_HANDLE_HEIGHT - TKW_HANDLE_INSET); ! int handle_x2 = x2; ! int handle_y2 = y2 - TKW_HANDLE_INSET; ! /* no worky */ /* sys_vgui("%s create line %d %d %d %d -fill black -tags RESIZE_LINES\n", */ /* x->handle_id, handle_x2, handle_y1, handle_x1, handle_y2); */ --- 402,408 ---- int handle_x1 = x2 - TKW_HANDLE_WIDTH; int handle_y1 = y2 - (TKW_HANDLE_HEIGHT - TKW_HANDLE_INSET); ! // int handle_x2 = x2; ! // int handle_y2 = y2 - TKW_HANDLE_INSET; ! /* no worky, this should draw MAC OS X style lines on the resize handle */ /* sys_vgui("%s create line %d %d %d %d -fill black -tags RESIZE_LINES\n", */ /* x->handle_id, handle_x2, handle_y1, handle_x1, handle_y2); */ *************** *** 471,475 **** }
! /* static int entry_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) --- 445,449 ---- }
! /* the clickfn is only called in run mode static int entry_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) *************** *** 552,557 **** }
- /* Output the symbol */ - /* , t_symbol *s, int argc, t_atom *argv) */ static void entry_output(t_entry* x, t_symbol *s, int argc, t_atom *argv) { --- 526,529 ---- *************** *** 684,688 **** { DEBUG(post("entry_fontsize");); - post("font size: %f",font_size); if(font_size > 8) { --- 656,659 ---- *************** *** 702,706 **** x->x_height = height; x->x_width = width; - // sys_vgui("%s configure -width %d -height %d \n", x->text_id, (int)width, (int)height); if(glist_isvisible(x->x_glist)) { --- 673,676 ---- *************** *** 708,715 **** x->canvas_id, x->window_tag, x->x_width, x->x_height); canvas_fixlinesfor(x->x_glist, (t_text *)x); // 2nd inlet - /* sys_vgui("%s itemconfigure %s -width %d -height %d \n", */ - /* x->canvas_id, x->all_tag, (int)width, (int)height); */ - /* entry_vis((t_gobj *)x, x->x_canvas, 0); */ - /* entry_vis((t_gobj *)x, x->x_canvas, 1); */ } } --- 678,681 ---- *************** *** 730,735 **** if (x->x_resizing && newstate == 0) { - x->x_width += x->x_resize_x; - x->x_height += x->x_resize_y; if (canvas) { --- 696,699 ---- *************** *** 740,752 **** else if (!x->x_resizing && newstate) { - /* TODO I think this is not used */ - /* if (canvas) */ - /* { */ - /* int x1, y1, x2, y2; */ - /* entry_getrect((t_gobj *)x, x->x_glist, &x1, &y1, &x2, &y2); */ - /* } */ erase_inlets(x); - x->x_resize_x = 0; - x->x_resize_y = 0; } x->x_resizing = newstate; --- 704,708 ---- *************** *** 759,778 **** { int dx = (int)f1, dy = (int)f2; ! int x1, y1, x2, y2, newx, newy; ! entry_getrect((t_gobj *)x, x->x_glist, &x1, &y1, &x2, &y2); ! newx = x2 + dx; ! newy = y2 + dy; ! if (newx > x1 + ENTRY_MIN_WIDTH && newy > y1 + ENTRY_MIN_HEIGHT) { ! if (glist_isvisible(x->x_glist)) ! { ! sys_vgui("%s itemconfigure %s -width %d -height %d\n", ! x->canvas_id, x->window_tag, ! x->x_width + dx, x->x_height + dy); ! // sys_vgui("%s coords RSZ %d %d\n", ! // x->canvas_id, newx, newy); ! } ! x->x_resize_x = dx; ! x->x_resize_y = dy; } } --- 715,727 ---- { int dx = (int)f1, dy = (int)f2; ! if (glist_isvisible(x->x_glist)) { ! x->x_width += dx; ! x->x_height += dy; ! sys_vgui("%s itemconfigure %s -width %d -height %d\n", ! x->canvas_id, x->window_tag, ! x->x_width, x->x_height); ! sys_vgui("%s move RSZ %d %d\n", ! x->canvas_id, dx, dy); } } *************** *** 802,806 **** x->x_width = ENTRY_DEFAULT_WIDTH; x->x_height = ENTRY_DEFAULT_HEIGHT; ! x->x_bgcolour = gensym("grey70"); x->x_fgcolour = gensym("black"); --- 751,755 ---- x->x_width = ENTRY_DEFAULT_WIDTH; x->x_height = ENTRY_DEFAULT_HEIGHT; ! x->x_bgcolour = gensym(DEFAULT_COLOR); x->x_fgcolour = gensym("black");