[PD-cvs] externals/bbogart/entry entry.c,1.29,1.30

Hans-Christoph Steiner eighthave at users.sourceforge.net
Tue Nov 13 16:27:56 CET 2007


Update of /cvsroot/pure-data/externals/bbogart/entry
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19649

Modified Files:
	entry.c 
Log Message:
wrote key binding function to pass command keys onto the parent canvas

Index: entry.c
===================================================================
RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** entry.c	13 Nov 2007 08:19:50 -0000	1.29
--- entry.c	13 Nov 2007 15:27:54 -0000	1.30
***************
*** 30,33 ****
--- 30,35 ----
  /* 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 */
+ 
  
  #ifdef _MSC_VER
***************
*** 268,271 ****
--- 270,287 ----
  }
  
+ static void bind_standard_keys(t_entry *x)
+ {
+ #ifdef __APPLE__
+     sys_vgui("bind %s <Mod1-Key> {pdtk_canvas_ctrlkey %s %%K 0}\n",
+              x->text_id, x->canvas_id);
+     sys_vgui("bind %s <Mod1-Shift-Key> {pdtk_canvas_ctrlkey %s %%K 1}\n",
+              x->text_id, x->canvas_id);
+ #else
+     sys_vgui("bind %s <Control-Key> {pdtk_canvas_ctrlkey %s %%K 0}\n",
+              x->text_id, x->canvas_id);
+     sys_vgui("bind %s <Control-Shift-Key> {pdtk_canvas_ctrlkey %s %%K 1}\n",
+              x->text_id, x->canvas_id);
+ #endif
+ }
  
  static void bind_button_events(t_entry *x)
***************
*** 311,315 ****
      sys_vgui("frame %s \n", x->frame_id);
      sys_vgui("text %s -font {%s %d %s} -border 1 \
!     -highlightthickness 2 -relief sunken -bg \"%s\" -fg \"%s\"  \
      -yscrollcommand {%s set} \n",
               x->text_id, 
--- 327,331 ----
      sys_vgui("frame %s \n", x->frame_id);
      sys_vgui("text %s -font {%s %d %s} -border 1 \
!     -highlightthickness 1 -relief sunken -bg \"%s\" -fg \"%s\"  \
      -yscrollcommand {%s set} \n",
               x->text_id, 
***************
*** 324,329 ****
      sys_vgui("bind %s <KeyRelease> {+pd %s keyup %%N \\;} \n", 
               x->text_id, x->x_receive_name->s_name);
-     sys_vgui("pdtk_standardkeybindings %s \n", x->text_id); 
  
      bind_button_events(x);
  }
--- 340,345 ----
      sys_vgui("bind %s <KeyRelease> {+pd %s keyup %%N \\;} \n", 
               x->text_id, x->x_receive_name->s_name);
  
+     bind_standard_keys(x);
      bind_button_events(x);
  }
***************
*** 428,432 ****
      {
          sys_vgui("%s configure -bg grey -state normal\n", x->text_id);
!         sys_vgui("%s delete %xSEL\n", x->canvas_id, x);
          /* activatefn never gets called with 0, so destroy here */
          sys_vgui("destroy %s\n", x->handle_id);
--- 444,448 ----
      {
          sys_vgui("%s configure -bg grey -state normal\n", x->text_id);
! //        sys_vgui("%s delete %xSEL\n", x->canvas_id, x);
          /* activatefn never gets called with 0, so destroy here */
          sys_vgui("destroy %s\n", x->handle_id);





More information about the Pd-cvs mailing list