Update of /cvsroot/pure-data/externals/bbogart/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15122
Modified Files: entry.c Log Message: bind to <Motion> events so that it can be moved easily
Index: entry.c =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** entry.c 13 Nov 2007 08:07:08 -0000 1.28 --- entry.c 13 Nov 2007 08:19:50 -0000 1.29 *************** *** 28,32 **** /* TODO: complete inlet draw/erase logic */ /* TODO: unbind text from all key events when selected */ ! /* TODO: allow moving by clicking and draging */ /* TODO: sort out x_height/x_width vs. x_rect_height/x_rect_width */
--- 28,32 ---- /* TODO: complete inlet draw/erase logic */ /* TODO: unbind text from all key events when selected */ ! /* TODO: handle scrollbar when resizing */ /* TODO: sort out x_height/x_width vs. x_rect_height/x_rect_width */
*************** *** 42,47 **** #define BACKGROUNDCOLOR "grey70"
! #define TKW_HANDLE_HEIGHT 10 ! #define TKW_HANDLE_WIDTH 10
#define SCOPE_SELBDWIDTH 3.0 --- 42,47 ---- #define BACKGROUNDCOLOR "grey70"
! #define TKW_HANDLE_HEIGHT 15 ! #define TKW_HANDLE_WIDTH 15
#define SCOPE_SELBDWIDTH 3.0 *************** *** 271,274 **** --- 271,275 ---- static void bind_button_events(t_entry *x) { + /* mouse buttons */ sys_vgui("bind %s <Button> {pdtk_canvas_sendclick %s \ [expr %%X - [winfo rootx %s]] [expr %%Y - [winfo rooty %s]] %%b 0}\n", *************** *** 289,292 **** --- 290,297 ---- [expr %%X - [winfo rootx %s]] [expr %%Y - [winfo rooty %s]] %%b}\n", x->text_id, x->canvas_id, x->canvas_id, x->canvas_id); + /* mouse motion */ + sys_vgui("bind %s <Motion> {pdtk_canvas_motion %s \ + [expr %%X - [winfo rootx %s]] [expr %%Y - [winfo rooty %s]] 0}\n", + x->text_id, x->canvas_id, x->canvas_id, x->canvas_id); }
*************** *** 412,421 **** sys_vgui("%s configure -bg #bdbddd -state disabled\n", x->text_id); /* */ ! sys_vgui("%s create rectangle %d %d %d %d -tags {%xSEL %s} -outline blue -width 2\n", x->canvas_id, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2, ! x, x->all_tag); x->x_selected = 1; } --- 417,426 ---- sys_vgui("%s configure -bg #bdbddd -state disabled\n", x->text_id); /* */ ! /* sys_vgui("%s create rectangle %d %d %d %d -tags {%xSEL %s} -outline blue -width 2\n", x->canvas_id, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2, ! x, x->all_tag);*/ x->x_selected = 1; } *************** *** 770,773 **** --- 775,779 ---- static void entry_resize_motion_callback(t_entry *x, t_floatarg f1, t_floatarg f2) { + DEBUG(post("entry_resize_motion_callback");); if (x->x_resizing) {