[PD-cvs] externals/unauthorized/grid g_grid.h, 1.1, 1.2 grid.c, 1.9, 1.10

Yves Degoyon sevyves at users.sourceforge.net
Fri Sep 1 18:28:02 CEST 2006


Update of /cvsroot/pure-data/externals/unauthorized/grid
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14834

Modified Files:
	g_grid.h grid.c 
Log Message:
change background color with message ( a.zin ) 

Index: g_grid.h
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/grid/g_grid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** g_grid.h	11 Aug 2003 04:38:38 -0000	1.1
--- g_grid.h	1 Sep 2006 16:28:00 -0000	1.2
***************
*** 32,35 ****
--- 32,36 ----
      int x_xlines; 	/* number of vertical lines                  */
      int x_ylines; 	/* number of horizontal lines                */
+     char *x_bgcolor; 	/* background color                          */
  } t_grid;
  

Index: grid.c
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/grid/grid.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** grid.c	1 Sep 2006 05:32:22 -0000	1.9
--- grid.c	1 Sep 2006 16:28:00 -0000	1.10
***************
*** 54,57 ****
--- 54,61 ----
                           sys_vgui(a,b,c,d,e,f,g)
  
+ #define GRID_SYS_VGUI8(a,b,c,d,e,f,g,h) if (guidebug) \
+                          post(a,b,c,d,e,f,g,h);\
+                          sys_vgui(a,b,c,d,e,f,g,h)
+ 
  #define GRID_SYS_VGUI9(a,b,c,d,e,f,g,h,i) if (guidebug) \
                           post(a,b,c,d,e,f,g,h,i );\
***************
*** 97,104 ****
      rtext_new(glist, (t_text *)x );
      tagRoot = rtext_gettag(glist_findrtext(glist,(t_text *)x));
!     GRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #124392 -tags %xGRID\n",
  	     canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
  	     text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height,
! 	     x);
      GRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -tags %so0\n",
  	     canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist) + x->x_height+1,
--- 101,108 ----
      rtext_new(glist, (t_text *)x );
      tagRoot = rtext_gettag(glist_findrtext(glist,(t_text *)x));
!     GRID_SYS_VGUI8(".x%x.c create rectangle %d %d %d %d -fill %s -tags %xGRID\n",
  	     canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
  	     text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height,
! 	     x->x_bgcolor, x);
      GRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -tags %so0\n",
  	     canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist) + x->x_height+1,
***************
*** 252,286 ****
  }
  
- /*az new method to change color */
- static void grid_draw_new_color(t_grid *x, t_glist *glist, char *col)
- {
-   t_canvas *canvas=glist_getcanvas(glist);
-   char *tagRoot;
-   char str1[80];
- 
-     strcpy (str1,".x%x.c itemconfigure %xGRID -fill #");
-     strcat (str1,col);
-     strcat (str1,"\n");
-     tagRoot = rtext_gettag(glist_findrtext(glist,(t_text *)x));
-     GRID_SYS_VGUI3(str1, canvas, x);
-     GRID_SYS_VGUI3(".x%x.c delete %so0\n", canvas, tagRoot);
-     GRID_SYS_VGUI3(".x%x.c delete %so1\n", canvas, tagRoot);
-     /*az redraw point if needed*/
-     if ( x->x_point )
-     {
-        grid_draw_update(x, glist);
-     }
-     GRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -tags %so0\n",
-          canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist) + x->x_height+1,
-          text_xpix(&x->x_obj, glist)+7, text_ypix(&x->x_obj, glist) + x->x_height+2,
-          tagRoot);
-     GRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -tags %so1\n",
-          canvas, text_xpix(&x->x_obj, glist)+x->x_width-7, text_ypix(&x->x_obj, glist) + x->x_height+1,
-          text_xpix(&x->x_obj, glist)+x->x_width, text_ypix(&x->x_obj, glist) + x->x_height+2,
-          tagRoot);
- 
-     canvas_fixlinesfor( canvas, (t_text*)x );
- }
- 
  /* ------------------------ grid widgetbehaviour----------------------------- */
  
--- 256,259 ----
***************
*** 466,472 ****
  static void grid_new_color(t_grid *x, t_floatarg color1, t_floatarg color2, t_floatarg color3)
  {
!     char col[30], col1[10], col2[10], col3[10];
  
-     sprintf(col1,"%X",(int) color1);
      if (color1 < 17)
          sprintf(col1,"0%X",(int) color1);
--- 439,457 ----
  static void grid_new_color(t_grid *x, t_floatarg color1, t_floatarg color2, t_floatarg color3)
  {
!     char col1[10], col2[10], col3[10];
! 
!     if ( ( color1 < 0 ) || ( color1 > 255 ) )
!     {
!         post( "wrong color component : %d", (int) color1 );
!     }
!     if ( ( color2 < 0 ) || ( color2 > 255 ) )
!     {
!         post( "wrong color component : %d", (int) color2 );
!     }
!     if ( ( color3 < 0 ) || ( color3 > 255 ) )
!     {
!         post( "wrong color component : %d", (int) color3 );
!     }
  
      if (color1 < 17)
          sprintf(col1,"0%X",(int) color1);
***************
*** 483,491 ****
      else
          sprintf(col3,"%X",(int) color3);
!     strcpy( col, col1);
!     strcat( col, col2 );
!     strcat( col, col3 );
  
!     grid_draw_new_color( x, x->x_glist, col);
  }
  
--- 468,475 ----
      else
          sprintf(col3,"%X",(int) color3);
!     sprintf( x->x_bgcolor, "#%s%s%s", col1, col2, col3);
  
!     grid_draw_erase( x, x->x_glist);
!     grid_draw_new( x, x->x_glist );
  }
  
***************
*** 685,688 ****
--- 669,675 ----
      x->x_youtlet = outlet_new(&x->x_obj, &s_float ); 
  
+     x->x_bgcolor = (char*)getbytes(12);
+     strcpy( x->x_bgcolor, "#123589" ); 
+ 
      // post( "grid_new name : %s width: %d height : %d", x->x_name->s_name, x->x_width, x->x_height );
  





More information about the Pd-cvs mailing list