[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: g_hook.c



  User: werner  
  Date: 06/12/12 12:32:54

  Modified:    .        Tag: autonumber g_hook.c g_rc.c g_register.c
                        i_basic.c i_callbacks.c i_vars.c o_arc.c o_box.c
                        o_circle.c o_line.c o_slot.c o_text.c
                        x_compselect.c x_dialog.c x_fileselect.c x_grid.c
                        x_image.c x_log.c x_menus.c x_print.c x_window.c
  Log:
  	sync autonumber branch with trunk
  
  
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.10.4.1  +132 -25   eda/geda/gaf/gschem/src/g_hook.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_hook.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_hook.c,v
  retrieving revision 1.10
  retrieving revision 1.10.4.1
  diff -u -b -r1.10 -r1.10.4.1
  --- g_hook.c	30 Sep 2006 16:01:36 -0000	1.10
  +++ g_hook.c	12 Dec 2006 17:32:51 -0000	1.10.4.1
  @@ -376,43 +376,150 @@
    *  I got top and bottom values reversed from world_get_complex_bounds,
    *  so don\'t rely on the position in the list. 
    */
  -SCM g_get_object_bounds (SCM object_smob, SCM scm_inc_attribs)
  +SCM g_get_object_bounds (SCM object_smob, SCM scm_exclude_attribs, SCM scm_exclude_object_type)
   {
  +  void custom_world_get_complex_bounds (TOPLEVEL *w_current, OBJECT *o_current,
  +                                        int *left, int *top, 
  +                                        int *right, int *bottom,
  +                                        GList *exclude_attrib_list,
  +					GList *exclude_obj_type_list) {
  +    OBJECT *obj_ptr = NULL;
  +    ATTRIB *attr_ptr = NULL;
  +    int rleft, rright, rbottom, rtop;
  +    char *text_value; 
  +    char *name_ptr, *value_ptr, aux_ptr[2];
  +    gboolean include_text;
  +
  +    *left = rleft = w_current->init_right;
  +    *top = rtop = w_current->init_bottom;;
  +    *right = *bottom = rright = rbottom = 0;
  +    
  +    if (o_current->type == OBJ_PIN) {
  +      attr_ptr = o_current->attribs;
  +      if (attr_ptr)
  +	obj_ptr = attr_ptr->object;
  +      else 
  +	obj_ptr = NULL;
  +    } else {
  +      obj_ptr = o_current;
  +    }
  +
  +    while (obj_ptr != NULL) {
  +      sprintf(aux_ptr, "%c", obj_ptr->type);
  +      include_text = TRUE;
  +
  +      if (!g_list_find_custom(exclude_obj_type_list, aux_ptr, (GCompareFunc) &strcmp)) {
  +	switch(obj_ptr->type) {
  +          case (OBJ_PIN):
  +	    world_get_single_object_bounds (w_current, obj_ptr,
  +					    &rleft, &rtop, &rright, &rbottom);
  +	    break;
  +          case (OBJ_TEXT):
  +	    if (obj_ptr->text && obj_ptr->text->string) {
  +	      text_value = obj_ptr->text->string;
  +	      if (o_attrib_get_name_value(text_value, &name_ptr, &value_ptr) &&
  +		  g_list_find_custom(exclude_attrib_list, name_ptr, (GCompareFunc) &strcmp)) {
  +		include_text = FALSE;
  +	      }
  +	      if (g_list_find_custom(exclude_attrib_list, "all", (GCompareFunc) &strcmp))
  +		include_text = FALSE;
  +	      if (include_text) {
  +		world_get_single_object_bounds (w_current, obj_ptr, 
  +						&rleft, &rtop, &rright, &rbottom);
  +	      }
  +	      g_free(name_ptr);
  +	      g_free(value_ptr);
  +	    }
  +	    break;
  +          case (OBJ_COMPLEX):
  +          case (OBJ_PLACEHOLDER):
  +	    custom_world_get_complex_bounds(w_current, 
  +					    o_current->complex->prim_objs, 
  +					    left, top, right, bottom,
  +					    exclude_attrib_list,
  +					    exclude_obj_type_list);          
  +	    break;
  +	    
  +          default:
  +	    world_get_single_object_bounds (w_current, obj_ptr, 
  +					    &rleft, &rtop, &rright, &rbottom);
  +	    break;
  +	}
  +      }
  +      
  +      if (rleft < *left) *left = rleft;
  +      if (rtop < *top) *top = rtop;
  +      if (rright > *right) *right = rright;
  +      if (rbottom > *bottom) *bottom = rbottom;
  +      
  +      if (o_current->type == OBJ_PIN) {
  +	attr_ptr = attr_ptr->next;
  +	if (attr_ptr)
  +	  obj_ptr = attr_ptr->object;
  +	else
  +	  obj_ptr = NULL;
  +      }
  +      else {
  +	obj_ptr = obj_ptr->next;
  +      }
  +    }
  +  }
  +
     TOPLEVEL *w_current=NULL;
     OBJECT *object=NULL;
     int left=0, right=0, bottom=0, top=0; 
     SCM returned = SCM_EOL;
     SCM vertical = SCM_EOL;
     SCM horizontal = SCM_EOL;
  -  OBJECT *new_object = NULL;
  -  gboolean include_attribs;
  +  GList *exclude_attrib_list = NULL, *exclude_obj_type_list = NULL;
  +  gboolean exclude_all_attribs = FALSE;
  +  int i;
   
  -  SCM_ASSERT (scm_boolean_p(scm_inc_attribs), scm_inc_attribs,
  +  SCM_ASSERT (scm_list_p(scm_exclude_attribs), scm_exclude_attribs, 
   	      SCM_ARG2, "get-object-bounds");
  -  include_attribs = SCM_NFALSEP(scm_inc_attribs);
  +  SCM_ASSERT (scm_list_p(scm_exclude_object_type), scm_exclude_object_type,
  +	      SCM_ARG3, "get-object-bounds");
   
  -  /* Get w_current and o_current */
  -  SCM_ASSERT (g_get_data_from_object_smob (object_smob, &w_current, &object),
  -	      object_smob, SCM_ARG1, "get-object-bounds");
  -
  -  if (!include_attribs) {
  -    new_object = (OBJECT *) g_malloc(sizeof(OBJECT));
  -    memcpy (new_object, object, sizeof(OBJECT));
  -    new_object->attribs = NULL;
  -    new_object->next = NULL;
  -    new_object->prev = NULL;
  +  /* Build the exclude attrib list */
  +  for (i=0; i <= SCM_INUM(scm_length(scm_exclude_attribs))-1; i++) {
  +    SCM_ASSERT (SCM_STRINGP(scm_list_ref(scm_exclude_attribs, SCM_MAKINUM(i))), 
  +		scm_exclude_attribs, 
  +		SCM_ARG2, "get-object-bounds"); 
  +    exclude_attrib_list = g_list_append(exclude_attrib_list, 
  +					SCM_STRING_CHARS(scm_list_ref(scm_exclude_attribs,
  +								      SCM_MAKINUM(i))));
     }
  -  else { 
  -    new_object = object;
  +
  +  /* Build the exclude object type list */
  +  for (i=0; i <= SCM_INUM(scm_length(scm_exclude_object_type))-1; i++) {
  +    SCM_ASSERT (SCM_STRINGP(scm_list_ref(scm_exclude_object_type, SCM_MAKINUM(i))), 
  +		scm_exclude_object_type, 
  +		SCM_ARG3, "get-object-bounds"); 
  +    exclude_obj_type_list = g_list_append(exclude_obj_type_list, 
  +					SCM_STRING_CHARS(scm_list_ref(scm_exclude_object_type,
  +								      SCM_MAKINUM(i))));
     } 
       
  -  world_get_complex_bounds (w_current, new_object, 
  -			    &left, &top, &right, &bottom);
  +  /* Get w_current and o_current. */
  +  g_get_data_from_object_smob (object_smob, &w_current, &object);
     
  -  if (!include_attribs) {
  -    /* Free the newly created object */
  -    g_free(new_object);
  -  }
  +  SCM_ASSERT (w_current && object,
  +	      object_smob, SCM_ARG1, "get-object-bounds");
  +
  +  if (g_list_find_custom(exclude_attrib_list, "all", (GCompareFunc) &strcmp))
  +    exclude_all_attribs = TRUE;
  +
  +  custom_world_get_complex_bounds (w_current, object,
  +				   &left, &top, 
  +				   &right, &bottom, 
  +				   exclude_attrib_list,
  +				   exclude_obj_type_list);
  +  
  +  /* Free the exclude attrib_list. Don't free the nodes!! */
  +  g_list_free(exclude_attrib_list);
  +
  +  /* Free the exclude attrib_list. Don't free the nodes!! */
  +  g_list_free(exclude_obj_type_list);
     
     horizontal = scm_cons (SCM_MAKINUM(left), SCM_MAKINUM(right));
     vertical = scm_cons (SCM_MAKINUM(top), SCM_MAKINUM(bottom));
  
  
  
  1.41.4.1  +17 -0     eda/geda/gaf/gschem/src/g_rc.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_rc.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_rc.c,v
  retrieving revision 1.41
  retrieving revision 1.41.4.1
  diff -u -b -r1.41 -r1.41.4.1
  --- g_rc.c	7 Sep 2006 02:41:28 -0000	1.41
  +++ g_rc.c	12 Dec 2006 17:32:51 -0000	1.41.4.1
  @@ -455,6 +455,23 @@
    *  \par Function Description
    *
    */
  +SCM g_rc_line_style(SCM mode)
  +{
  +  static const vstbl_entry mode_table[] = {
  +    {THIN , "thin" },
  +    {THICK, "thick"}
  +  };
  +
  +  RETURN_G_RC_MODE("pin-style",
  +		   default_line_style,
  +		   2);
  +}
  +
  +/*! \todo Finish function documentation!!!
  + *  \brief
  + *  \par Function Description
  + *
  + */
   SCM g_rc_action_feedback_mode(SCM mode)
   {
     static const vstbl_entry mode_table[] = {
  
  
  
  1.47.4.1  +2 -1      eda/geda/gaf/gschem/src/g_register.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_register.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_register.c,v
  retrieving revision 1.47
  retrieving revision 1.47.4.1
  diff -u -b -r1.47 -r1.47.4.1
  --- g_register.c	3 Oct 2006 16:35:11 -0000	1.47
  +++ g_register.c	12 Dec 2006 17:32:51 -0000	1.47.4.1
  @@ -80,6 +80,7 @@
     { "net-style",                 1, 0, 0, g_rc_net_style },
     { "bus-style",                 1, 0, 0, g_rc_bus_style },
     { "pin-style",                 1, 0, 0, g_rc_pin_style },
  +  { "line-style",                1, 0, 0, g_rc_line_style },
     { "zoom-with-pan",             1, 0, 0, g_rc_zoom_with_pan },
     { "action-feedback-mode",      1, 0, 0, g_rc_action_feedback_mode },
     { "text-feedback",             1, 0, 0, g_rc_text_feedback },
  @@ -334,7 +335,7 @@
     /* Hook stuff */
     scm_c_define_gsubr ("add-attribute-to-object", 5, 0, 0, g_add_attrib);
     scm_c_define_gsubr ("get-object-attributes", 1, 0, 0, g_get_object_attributes);
  -  scm_c_define_gsubr ("get-object-bounds", 2, 0, 0, g_get_object_bounds);
  +  scm_c_define_gsubr ("get-object-bounds", 3, 0, 0, g_get_object_bounds);
     scm_c_define_gsubr ("get-object-pins", 1, 0, 0, g_get_object_pins);
     scm_c_define_gsubr ("get-pin-ends", 1, 0, 0, g_get_pin_ends);
     scm_c_define_gsubr ("set-attribute-text-properties!", 7, 0, 0, g_set_attrib_text_properties);
  
  
  
  1.13.4.1  +99 -39    eda/geda/gaf/gschem/src/i_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: i_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_basic.c,v
  retrieving revision 1.13
  retrieving revision 1.13.4.1
  diff -u -b -r1.13 -r1.13.4.1
  --- i_basic.c	15 Jul 2006 18:51:41 -0000	1.13
  +++ i_basic.c	12 Dec 2006 17:32:51 -0000	1.13.4.1
  @@ -266,7 +266,7 @@
    *
    */
   void i_update_middle_button(TOPLEVEL *w_current,
  -			    void *func_ptr, const char *string)
  +			    void (*func_ptr)(gpointer, guint, GtkWidget*), const char *string)
   {
     char *temp_string;
   
  @@ -428,9 +428,12 @@
     if (o_selection_return_num(w_current->page_current->selection2_head)) {
       /* since one or more things are selected, we set these TRUE */
       /* These strings should NOT be internationalized */
  +    x_menus_sensitivity(w_current, "Edit/Cut Buffer", TRUE);
  +    x_menus_sensitivity(w_current, "Edit/Copy Buffer", TRUE);
       x_menus_sensitivity(w_current, "Edit/Edit...", TRUE);
       x_menus_sensitivity(w_current, "Edit/Edit Text...", TRUE);
       x_menus_sensitivity(w_current, "Edit/Copy Mode", TRUE);
  +    x_menus_sensitivity(w_current, "Edit/Multiple Copy Mode", TRUE);
       x_menus_sensitivity(w_current, "Edit/Move Mode", TRUE);
       x_menus_sensitivity(w_current, "Edit/Delete", TRUE);
       x_menus_sensitivity(w_current, "Edit/Rotate 90 Mode", TRUE);
  @@ -472,9 +475,12 @@
     } else {
       /* Nothing is slected.  grey these out */
       /* These strings should NOT be internationalized */
  +    x_menus_sensitivity(w_current, "Edit/Cut Buffer", FALSE);
  +    x_menus_sensitivity(w_current, "Edit/Copy Buffer", FALSE);
       x_menus_sensitivity(w_current, "Edit/Edit...", FALSE);
       x_menus_sensitivity(w_current, "Edit/Edit Text...", FALSE);
       x_menus_sensitivity(w_current, "Edit/Copy Mode", FALSE);
  +    x_menus_sensitivity(w_current, "Edit/Multiple Copy Mode", FALSE);
       x_menus_sensitivity(w_current, "Edit/Move Mode", FALSE);
       x_menus_sensitivity(w_current, "Edit/Delete", FALSE);
       x_menus_sensitivity(w_current, "Edit/Rotate 90 Mode", FALSE);
  @@ -513,6 +519,40 @@
       x_menus_popup_sensitivity(w_current, "/Down Symbol", FALSE);
       /* x_menus_popup_sensitivity(w_current, "/Up", FALSE);	*/
     }
  +
  +  if ((object_buffer[0] != NULL) && (object_buffer[0]->next != NULL)) {
  +    x_menus_sensitivity(w_current, "Edit/Paste Buffer", TRUE);
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 1", TRUE);
  +  } else {
  +    x_menus_sensitivity(w_current, "Edit/Paste Buffer", FALSE);
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 1", FALSE);
  +  }
  +
  +  if ((object_buffer[1] != NULL) && (object_buffer[1]->next != NULL)) {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 2", TRUE);
  +  } else {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 2", FALSE);
  +  }
  +
  +  if ((object_buffer[2] != NULL) && (object_buffer[2]->next != NULL)) {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 3", TRUE);
  +  } else {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 3", FALSE);
  +  }
  +
  +  if ((object_buffer[3] != NULL) && (object_buffer[3]->next != NULL)) {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 4", TRUE);
  +  } else {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 4", FALSE);
  +  }
  +
  +  if ((object_buffer[4] != NULL) && (object_buffer[4]->next != NULL)) {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 5", TRUE);
  +  } else {
  +    x_menus_sensitivity(w_current, "Buffer/Paste from 5", FALSE);
  +  }
  + 
  +
   }
    
   #if 0
  @@ -639,52 +679,72 @@
   #endif
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Set filename as gschem  window title
    *  \par Function Description
  - *
  + *  Set the window title using the gnome HID format style.
    */
  -void i_set_filename(TOPLEVEL *w_current, const char *string)
  +void i_set_filename(TOPLEVEL *w_current, const gchar *string)
   {
  -  char trunc_string[41];
  -  int len;
  -  int i;
  +  gchar *print_string=NULL;
  +  gchar *filename=NULL;
   
  -  if (!w_current->filename_label) {
  +  if (!w_current->main_window)
  +    return;
  +  if (string == NULL)
       return;
  -  }
   
  -  if (string) {
  -    len = strlen(string);
  -    w_current->DONT_RESIZE = 1;
  +  filename = g_path_get_basename(string);
   
  -    if (w_current->filename_label) {
  -      if (len > 40) {
  +  print_string = g_strdup_printf("%s - gschem", filename);
   
  -        trunc_string[0] = '.';
  -        trunc_string[1] = '.';
  -        trunc_string[2] = '.';
  -
  -        trunc_string[40] = '\0';
  -        for (i = 39 ; i > 2; i--) {
  -          if (len >= 0) {
  -            trunc_string[i] = string[len];
  -          } else {
  -            break;
  +  /* alternativ code with length limited pathname */
  +/*  int max_len = 70;
  +    if (strlen(string) > max_len) {
  +    print_string = g_strdup_printf("gschem: ...%s",
  +				   &(string[strlen(string)-max_len]));
             }
  -          len--;
  +  else {
  +    print_string = g_strdup_printf("gschem: %s",string);
           }
  +*/
   
  -        gtk_label_set(GTK_LABEL(w_current->
  -                                filename_label),
  -                      trunc_string);
  +  gtk_window_set_title(GTK_WINDOW(w_current->main_window),
  +		       print_string);
   
  -      } else {
  +  g_free(print_string);
  +  g_free(filename);
  +}
   
  -        gtk_label_set(GTK_LABEL(w_current->
  -                                filename_label),
  -                      (char *) string);
  -      }
  -    }
  +/*! \brief Write the grid settings to the gschem status bar
  + *  \par Function Description
  + *  The function takes the current grid paramters of gschem and
  + *  prints it to the status bar.
  + *  The format is "Grid([SnapGridSize],[CurrentGridSize])"
  + */
  +void i_set_grid(TOPLEVEL *w_current, int visible_grid) 
  +{
  +  gchar *print_string=NULL;
  +  gchar *snap=NULL;
  +  gchar *grid=NULL;
  +
  +  if (!w_current->grid_label) {
  +    return;
     }
  +  
  +  if (!w_current->snap)
  +    snap = g_strdup(_("OFF"));
  +  else
  +    snap = g_strdup_printf("%d", w_current->snap_size);
  +
  +  if (!w_current->grid)
  +    grid = g_strdup(_("OFF"));
  +  else
  +    grid = g_strdup_printf("%d", visible_grid);
  +
  +  print_string = g_strdup_printf(_("Grid(%s, %s)"), snap, grid);
  +  gtk_label_set(GTK_LABEL(w_current->grid_label), print_string);
  +  
  +  g_free(print_string);
  +  g_free(grid);
  +  g_free(snap);
   }
  
  
  
  1.69.4.1  +10 -0     eda/geda/gaf/gschem/src/i_callbacks.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: i_callbacks.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_callbacks.c,v
  retrieving revision 1.69
  retrieving revision 1.69.4.1
  diff -u -b -r1.69 -r1.69.4.1
  --- i_callbacks.c	20 Oct 2006 22:59:05 -0000	1.69
  +++ i_callbacks.c	12 Dec 2006 17:32:51 -0000	1.69.4.1
  @@ -1859,6 +1859,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_copy1, _("Copy 1"));
     o_buffer_copy(w_current, 0);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1877,6 +1878,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_copy2, _("Copy 2"));
     o_buffer_copy(w_current, 1);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1895,6 +1897,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_copy3, _("Copy 3"));
     o_buffer_copy(w_current, 2);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1913,6 +1916,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_copy4, _("Copy 4"));
     o_buffer_copy(w_current, 3);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1931,6 +1935,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_copy5, _("Copy 5"));
     o_buffer_copy(w_current, 4);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1949,6 +1954,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_cut1, _("Cut 1"));
     o_buffer_cut(w_current, 0);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1967,6 +1973,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_cut2, _("Cut 2"));
     o_buffer_cut(w_current, 1);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1985,6 +1992,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_cut3, _("Cut 3"));
     o_buffer_cut(w_current, 2);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -2003,6 +2011,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_cut4, _("Cut 4"));
     o_buffer_cut(w_current, 3);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -2021,6 +2030,7 @@
   
     i_update_middle_button(w_current, i_callback_buffer_cut5, _("Cut 5"));
     o_buffer_cut(w_current, 4);
  +  i_update_menus(w_current);
   }
   
   /*! \todo Finish function documentation!!!
  
  
  
  1.34.4.1  +3 -0      eda/geda/gaf/gschem/src/i_vars.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: i_vars.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_vars.c,v
  retrieving revision 1.34
  retrieving revision 1.34.4.1
  diff -u -b -r1.34 -r1.34.4.1
  --- i_vars.c	4 Sep 2006 16:51:57 -0000	1.34
  +++ i_vars.c	12 Dec 2006 17:32:51 -0000	1.34.4.1
  @@ -46,6 +46,7 @@
   int   default_pin_style = THICK;
   int   default_net_style = THICK;
   int   default_bus_style = THICK;
  +int   default_line_style = THICK;
   int   default_grid_color = GRID_COLOR;
   int   default_background_color = BACKGROUND_COLOR;
   int   default_select_color = SELECT_COLOR;
  @@ -177,6 +178,8 @@
     w_current->pin_style          = default_pin_style;
     w_current->override_pin_color = default_override_pin_color;
   
  +  w_current->line_style         = default_line_style;
  +
     w_current->zoom_with_pan           = default_zoom_with_pan;
     w_current->actionfeedback_mode     = default_actionfeedback_mode;
     w_current->text_display_zoomfactor = default_text_display_zoomfactor;
  
  
  
  1.25.4.1  +7 -7      eda/geda/gaf/gschem/src/o_arc.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_arc.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_arc.c,v
  retrieving revision 1.25
  retrieving revision 1.25.4.1
  diff -u -b -r1.25 -r1.25.4.1
  --- o_arc.c	21 Oct 2006 13:56:23 -0000	1.25
  +++ o_arc.c	12 Dec 2006 17:32:51 -0000	1.25.4.1
  @@ -151,25 +151,25 @@
     case TYPE_SOLID:
       length = -1;
       space = -1;
  -    draw_func = (void *) o_arc_draw_solid;
  +    draw_func = o_arc_draw_solid;
       break;
   			
     case TYPE_DOTTED:
       length = -1; /* AVH changed o_arc_draw_dotted to use */
       /* space parameter only */
  -    draw_func = (void *) o_arc_draw_dotted;
  +    draw_func = o_arc_draw_dotted;
       break;
   			
     case TYPE_DASHED:
  -    draw_func = (void *) o_arc_draw_dashed;
  +    draw_func = o_arc_draw_dashed;
       break;
   			
     case TYPE_CENTER:
  -    draw_func = (void *) o_arc_draw_center;
  +    draw_func = o_arc_draw_center;
       break;
   			
     case TYPE_PHANTOM:
  -    draw_func = (void *) o_arc_draw_phantom;
  +    draw_func = o_arc_draw_phantom;
       break;
   			
     case TYPE_ERASE:
  @@ -179,13 +179,13 @@
       length = -1;
       space = -1;
       arc_width = 0; /* just to be careful */
  -    draw_func = (void *) o_arc_draw_solid;
  +    draw_func = o_arc_draw_solid;
       fprintf(stderr, _("Unknown type for arc !\n"));
       break;
     }
   
     if((length == 0) || (space == 0))
  -    draw_func = (void *) o_arc_draw_solid;
  +    draw_func =  o_arc_draw_solid;
   
     (*draw_func)(w_current->window, w_current->gc, color,
                  arc_end,
  
  
  
  1.23.4.1  +13 -13    eda/geda/gaf/gschem/src/o_box.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_box.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_box.c,v
  retrieving revision 1.23
  retrieving revision 1.23.4.1
  diff -u -b -r1.23 -r1.23.4.1
  --- o_box.c	21 Oct 2006 13:56:24 -0000	1.23
  +++ o_box.c	12 Dec 2006 17:32:51 -0000	1.23.4.1
  @@ -148,24 +148,24 @@
       case TYPE_SOLID:
         length = -1;
         space = -1;
  -      draw_func = (void *) o_box_draw_solid;
  +      draw_func = o_box_draw_solid;
         break;
   
       case TYPE_DOTTED:
         length = -1; /* ..._draw_dotted only space is used */
  -      draw_func = (void *) o_box_draw_dotted;
  +      draw_func = o_box_draw_dotted;
         break;
   
       case TYPE_DASHED:
  -      draw_func = (void *) o_box_draw_dashed;
  +      draw_func = o_box_draw_dashed;
         break;
   
       case TYPE_CENTER:
  -      draw_func = (void *) o_box_draw_center;
  +      draw_func = o_box_draw_center;
         break;
   
       case TYPE_PHANTOM:
  -      draw_func = (void *) o_box_draw_phantom;
  +      draw_func = o_box_draw_phantom;
         break;
   
       case TYPE_ERASE:
  @@ -175,13 +175,13 @@
         length = -1;
         space = -1;
         line_width = 0; /* just to be careful */
  -      draw_func = (void *) o_box_draw_solid;
  +      draw_func = o_box_draw_solid;
         fprintf(stderr, _("Unknown type for box !\n"));
         break;
     }
   
     if((length == 0) || (space == 0))
  -  draw_func = (void *) o_box_draw_solid;
  +  draw_func = o_box_draw_solid;
   	
     (*draw_func)(w_current->window, w_current->gc, color, box_end,
                  FALSE,
  @@ -244,35 +244,35 @@
          * possible as it would prevent any hollow box from having its grips
          * drawn
          */
  -      fill_func = (void *) o_box_fill_hollow;
  +      fill_func = o_box_fill_hollow;
         break;
   		
       case FILLING_FILL:
         angle1 = -1; angle2 = -1;
         pitch1 = 1; pitch2 = 1;
  -      fill_func = (void *) o_box_fill_fill;
  +      fill_func = o_box_fill_fill;
         break;
   			
       case FILLING_MESH:
  -      fill_func = (void *) o_box_fill_mesh;
  +      fill_func = o_box_fill_mesh;
         break;
   
       case FILLING_HATCH:
         angle2 = -1;
         pitch2 = 1;
  -      fill_func = (void *) o_box_fill_hatch;
  +      fill_func = o_box_fill_hatch;
         break;
   			
       case FILLING_VOID:
       default:
         angle1 = -1; angle2 = -1;
         pitch1 = 1; pitch2 = 1;
  -      fill_func = (void *) o_box_fill_hollow;
  +      fill_func = o_box_fill_hollow;
         fprintf(stderr, _("Unknown type for box (fill)!\n"));
     }
   
     if((pitch1 <= 0) || (pitch2 <= 0)) {
  -    fill_func = (void *) o_box_fill_fill;
  +    fill_func = o_box_fill_fill;
     }
   
     (*fill_func)(w_current->window, w_current->gc, color,
  
  
  
  1.21.4.1  +13 -13    eda/geda/gaf/gschem/src/o_circle.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_circle.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_circle.c,v
  retrieving revision 1.21
  retrieving revision 1.21.4.1
  diff -u -b -r1.21 -r1.21.4.1
  --- o_circle.c	21 Oct 2006 13:56:24 -0000	1.21
  +++ o_circle.c	12 Dec 2006 17:32:51 -0000	1.21.4.1
  @@ -140,24 +140,24 @@
       case TYPE_SOLID:
       length = -1;
       space = -1;
  -    draw_func = (void *) o_arc_draw_solid;
  +    draw_func = o_arc_draw_solid;
       break;
   			
       case TYPE_DOTTED:
       length = -1; /* ..._draw_dotted only space used */
  -    draw_func = (void *) o_arc_draw_dotted;
  +    draw_func = o_arc_draw_dotted;
       break;
   			
       case TYPE_DASHED:
  -    draw_func = (void *) o_arc_draw_dashed;
  +    draw_func = o_arc_draw_dashed;
       break;
   			
       case TYPE_CENTER:
  -    draw_func = (void *) o_arc_draw_center;
  +    draw_func = o_arc_draw_center;
       break;
   			
       case TYPE_PHANTOM:
  -    draw_func = (void *) o_arc_draw_phantom;
  +    draw_func = o_arc_draw_phantom;
       break;
   			
       case TYPE_ERASE:
  @@ -168,12 +168,12 @@
       space = -1;
       circle_width = 0; /* just to be careful */
       fprintf(stderr, _("Unknown type for circle!\n"));
  -    draw_func = (void *) o_arc_draw_solid;			
  +    draw_func = o_arc_draw_solid;			
       break;
     }
   
     if((length == 0) || (space == 0))
  -  draw_func = (void *) o_arc_draw_solid;
  +  draw_func = o_arc_draw_solid;
   	
     (*draw_func)(w_current->window, w_current->gc, color,
                  circle_end,
  @@ -231,35 +231,35 @@
          * a test before the call. Simply putting a return here instead is not
          * possible as it would prevent any hollow circle from having its grips
          */
  -      fill_func = (void *) o_circle_fill_hollow;
  +      fill_func = o_circle_fill_hollow;
         break;
   		
       case FILLING_FILL:
         angle1 = -1; angle2 = -1;
         pitch1 = 1; pitch2 = 1;
  -      fill_func = (void *) o_circle_fill_fill;
  +      fill_func = o_circle_fill_fill;
         break;
   			
       case FILLING_MESH:
  -      fill_func = (void *) o_circle_fill_mesh;
  +      fill_func = o_circle_fill_mesh;
         break;
   
       case FILLING_HATCH:
         angle2 = -1;
         pitch2 = 1;
  -      fill_func = (void *) o_circle_fill_hatch;
  +      fill_func = o_circle_fill_hatch;
         break;
   			
       case FILLING_VOID:
       default:
         angle1 = -1; angle2 = -1;
         pitch1 = 1; pitch2 = 1;
  -      fill_func = (void *) o_circle_fill_hollow;			
  +      fill_func = o_circle_fill_hollow;			
         fprintf(stderr, _("Unknown type for circle (fill)!\n"));
     }
   
     if((pitch1 <= 0) || (pitch2 <= 0)) {
  -    fill_func = (void *) o_circle_fill_fill;
  +    fill_func = o_circle_fill_fill;
     }
   
     (*fill_func)(w_current->window, w_current->gc, color,
  
  
  
  1.22.4.1  +7 -7      eda/geda/gaf/gschem/src/o_line.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_line.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_line.c,v
  retrieving revision 1.22
  retrieving revision 1.22.4.1
  diff -u -b -r1.22 -r1.22.4.1
  --- o_line.c	21 Oct 2006 13:56:25 -0000	1.22
  +++ o_line.c	12 Dec 2006 17:32:51 -0000	1.22.4.1
  @@ -128,24 +128,24 @@
       case TYPE_SOLID:
         length = -1;
         space = -1;
  -      draw_func = (void *) o_line_draw_solid;
  +      draw_func = o_line_draw_solid;
         break;
   			
       case TYPE_DOTTED:
         length = -1; /* in ..._draw_dotted, length is unused */
  -      draw_func = (void *) o_line_draw_dotted;
  +      draw_func = o_line_draw_dotted;
         break;
   			
       case TYPE_DASHED:
  -      draw_func = (void *) o_line_draw_dashed;
  +      draw_func = o_line_draw_dashed;
         break;
   			
       case TYPE_CENTER:
  -      draw_func = (void *) o_line_draw_center;
  +      draw_func = o_line_draw_center;
         break;
   			
       case TYPE_PHANTOM:
  -      draw_func = (void *) o_line_draw_phantom;
  +      draw_func = o_line_draw_phantom;
         break;
   			
       case TYPE_ERASE:
  @@ -157,12 +157,12 @@
         line_width = 0; /* just to be careful */
         fprintf(stderr, _("Unknown type for line (%d) !\n"),
                 o_current->line_type);
  -      draw_func = (void *) o_line_draw_solid;
  +      draw_func = o_line_draw_solid;
         break;
     }
   
     if((length == 0) || (space == 0))
  -  draw_func = (void *) o_line_draw_solid;
  +  draw_func = o_line_draw_solid;
   
     (*draw_func)(w_current->window, w_current->gc, color, line_end,
                  x1, y1, x2, y2, line_width, length, space);
  
  
  
  1.19.4.2  +7 -0      eda/geda/gaf/gschem/src/o_slot.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_slot.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_slot.c,v
  retrieving revision 1.19.4.1
  retrieving revision 1.19.4.2
  diff -u -b -r1.19.4.1 -r1.19.4.2
  --- o_slot.c	7 Nov 2006 20:30:29 -0000	1.19.4.1
  +++ o_slot.c	12 Dec 2006 17:32:51 -0000	1.19.4.2
  @@ -130,6 +130,13 @@
   
     object = o_select_return_first_object(w_current);
   
  +  /* get the parent object if the selection is only a text object */
  +  if (object != NULL && object->type == OBJ_TEXT) {
  +    if (object->attached_to != NULL) {
  +      object=o_attrib_return_parent(object->attached_to);
  +    }
  +  }
  +
     /* now find the slot attribute on the outside first */
     if (object != NULL) {
       numslots_value = o_attrib_search_numslots(object, NULL);
  
  
  
  1.24.2.1  +4 -9      eda/geda/gaf/gschem/src/o_text.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_text.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_text.c,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -b -r1.24 -r1.24.2.1
  --- o_text.c	23 Oct 2006 20:23:52 -0000	1.24
  +++ o_text.c	12 Dec 2006 17:32:51 -0000	1.24.2.1
  @@ -653,15 +653,11 @@
             if (object->text->string) {
               g_free(object->text->string);
             }
  -          /* Kazu <kazu@xxxxxxxx> on August 5, 1999 - I am not
  -             sure if strlen(string) == len. If so, activate the
  -             second part of this "if".*/
  -#if 1
  -          object->text->string = g_malloc(sizeof(char) * len + 1);
  -          strcpy(object->text->string, string);
  -#else
             object->text->string = g_strdup (string);
  -#endif
  +	  /* handle slot= attribute, it's a special case */
  +	  if (g_ascii_strncasecmp (string, "slot=", 5) == 0) {
  +	    o_slot_end (w_current, string, strlen (string));
  +	  }
           }
   
           object->text->size = text_size;
  @@ -683,7 +679,6 @@
     
     w_current->page_current->CHANGED = 1;
     o_undo_savestate(w_current, UNDO_ALL);
  -
   }
   
   /*! \todo Finish function documentation!!!
  
  
  
  1.8.4.1   +27 -26    eda/geda/gaf/gschem/src/x_compselect.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_compselect.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_compselect.c,v
  retrieving revision 1.8
  retrieving revision 1.8.4.1
  diff -u -b -r1.8 -r1.8.4.1
  --- x_compselect.c	13 Oct 2006 14:43:28 -0000	1.8
  +++ x_compselect.c	12 Dec 2006 17:32:51 -0000	1.8.4.1
  @@ -119,15 +119,17 @@
               g_ascii_strcasecmp (toplevel->current_clib, directory) != 0 ||
               toplevel->current_basename == NULL ||
               g_ascii_strcasecmp (toplevel->current_basename, component) != 0) {
  -          gint diff_x, diff_y;
  -          
             g_free (toplevel->current_clib);
             toplevel->current_clib = directory;
           
             strcpy (toplevel->current_basename, component);
  +	} else {
  +	  g_free(directory);
  +	}
             g_free (component);
  -        
             if (toplevel->event_state == ENDCOMP) {
  +          gint diff_x, diff_y;
  +
               diff_x = toplevel->last_x - toplevel->start_x;
               diff_y = toplevel->last_y - toplevel->start_y;
               
  @@ -142,10 +144,7 @@
                                    toplevel->current_basename);
           
             toplevel->event_state = DRAWCOMP;
  -        } else {
  -          g_free (component);
  -          g_free (directory);
  -        }
  +
           break;
         }
         case GTK_RESPONSE_CLOSE:
  @@ -181,12 +180,14 @@
                         G_CALLBACK (x_compselect_callback_response),
                         toplevel);
       
  +    gtk_window_set_transient_for(GTK_WINDOW(toplevel->cswindow),
  +				 GTK_WINDOW(toplevel->main_window));
  +
       gtk_widget_show (toplevel->cswindow);
       
     } else {
       gdk_window_raise (toplevel->cswindow->window);
     }
  -
   }
   
   /*! \brief Closes the component selection dialog.
  @@ -531,14 +532,14 @@
   compselect_create_child_model (void)
   {
     GtkTreeStore *store;
  -  const GSList *directories, *dir; 
  +  const GList *directories, *dir; 
   
     store = (GtkTreeStore*)gtk_tree_store_new (1,
                                                G_TYPE_STRING);
     
     /* populate component store */
     directories = s_clib_get_directories ();
  -  for (dir = directories; dir != NULL; dir = g_slist_next (dir)) {
  +  for (dir = directories; dir != NULL; dir = g_list_next (dir)) {
       GtkTreeIter iter, iter2;
       GSList *components, *comp;
   
  
  
  
  1.62.4.3  +487 -733  eda/geda/gaf/gschem/src/x_dialog.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_dialog.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_dialog.c,v
  retrieving revision 1.62.4.2
  retrieving revision 1.62.4.3
  diff -u -b -r1.62.4.2 -r1.62.4.3
  --- x_dialog.c	7 Nov 2006 20:30:29 -0000	1.62.4.2
  +++ x_dialog.c	12 Dec 2006 17:32:51 -0000	1.62.4.3
  @@ -42,17 +42,18 @@
     g_object_set_data_full (G_OBJECT (component), name, \
       gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
   
  +#define DIALOG_BORDER_SPACING 10
  +#define DIALOG_ELEMENT_SPACING 10
  +
  +
   static GtkWidget* create_menu_linetype (TOPLEVEL *w_current);
   static gint line_type_dialog_linetype_change (GtkWidget *w, gpointer data);
  -static int line_type_dialog_keypress (GtkWidget * widget, GdkEventKey * event, gpointer data);
   static void line_type_dialog_ok (GtkWidget *w, gpointer data);
  -static void line_type_dialog_cancel (GtkWidget *w, gpointer data);
   
   static GtkWidget* create_menu_filltype (TOPLEVEL *w_current);
   static gint fill_type_dialog_filltype_change(GtkWidget *w, gpointer data);
  -static int fill_type_dialog_keypress(GtkWidget * widget, GdkEventKey * event, gpointer data);
   static void fill_type_dialog_ok(GtkWidget *w, gpointer data);
  -static void fill_type_dialog_cancel(GtkWidget *w, gpointer data);
  +
   
   struct line_type_data {
     GtkWidget *dialog;
  @@ -304,10 +305,12 @@
   /***************** End of Text Input dialog box ***********************/
   
   /***************** Start of Text Edit dialog box **********************/
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief CAllback for a text aligment change
    *  \par Function Description
  - *
  + *  This function stores a change of the text alignment in the
  + *  <b>TOPLEVEL</b> struct.
  + *  \todo Remove that function. Only the OK-Button should set any
  + *  properties in the TOPLEVEL struct.
    */
   gint change_alignment(GtkWidget *w, TOPLEVEL *w_current)
   {
  @@ -318,13 +321,13 @@
     /*w_current->page_current->CHANGED=1; I don't think this belongs */
     /* o_undo_savestate(w_current, UNDO_ALL); I don't think this belongs */
   	
  -  return(0);
  +  return 0;
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Create the alignment menu for the text property dialog
    *  \par Function Description
  - *
  + *  This function creates a GtkMenu with nine different alignment 
  + *  entries.
    */
   static GtkWidget *create_menu_alignment (TOPLEVEL *w_current)
   {
  @@ -435,32 +438,17 @@
                        w_current);
     gtk_widget_show (menuitem);
   
  -  return(menu);
  +  return menu;
   }
   
   /* we reuse the color menu so we need to declare it */
   static GtkWidget *create_color_menu(TOPLEVEL * w_current, int * select_index);
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Apply the settings from the text property dialog
    *  \par Function Description
  - *
  - */
  -int text_edit_dialog_keypress(GtkWidget * widget, GdkEventKey * event, 
  -			      TOPLEVEL * w_current)
  -{
  -   if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  -	text_edit_dialog_cancel(NULL, w_current);	
  - 	return TRUE;
  -   }
  -
  -   return FALSE;
  -}
  -
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  + *  This function applies the user settings to the selected text objects
  + *  and closes the dialog
  + *  \todo Check why we have no color attribute in that dialog
    */
   void text_edit_dialog_ok(GtkWidget *w, TOPLEVEL *w_current)
   {
  @@ -472,17 +460,20 @@
     int num_selected;
     GtkTextBuffer *textbuffer;
     GtkTextIter start, end;
  +  GtkWidget *widget;
   
     num_selected = o_selection_return_num(w_current->page_current->selection2_head);
   
     /* text string entry will only show up if one object is selected */
     if (num_selected == 1) {
  -    textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w_current->teentry));
  +    widget = g_object_get_data (G_OBJECT (w_current->tewindow), "textentry");
  +    textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
       gtk_text_buffer_get_bounds (textbuffer, &start, &end);
       text_string =  gtk_text_iter_get_text (&start, &end);
     } /* else the string will be null which is okay */
     
  -  text_size_string = (char *) gtk_entry_get_text(GTK_ENTRY(w_current->tsentry));
  +  widget = g_object_get_data (G_OBJECT (w_current->tewindow), "sizeentry");
  +  text_size_string = (char *) gtk_entry_get_text(GTK_ENTRY(widget));
   
     if (text_string) {
       len = strlen(text_string);
  @@ -502,139 +493,150 @@
   
     i_set_state(w_current, SELECT);
     i_update_toolbar(w_current);
  -
  -  gtk_grab_remove(w_current->tewindow);
     gtk_widget_destroy(w_current->tewindow);
     w_current->tewindow = NULL;
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! 
  + *  \brief Cancel function for the text property dialog
    *  \par Function Description
  - *
  + *  Just close the dialog and clean up.
  + *  \todo join the function into text_edit_dialog_response()
    */
   void text_edit_dialog_cancel(GtkWidget *w, TOPLEVEL *w_current)
   {
     i_set_state(w_current, SELECT);
     i_update_toolbar(w_current);
  -  gtk_grab_remove(w_current->tewindow);
     gtk_widget_destroy(w_current->tewindow);
     w_current->tewindow = NULL;
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Response function for the text property dialog
    *  \par Function Description
  + *  This function receives the user response of the text property dialog.
  + *  The response is either <b>OK</b> or <b>Cancel</b>
    *
    */
  +void text_edit_dialog_response(GtkWidget * widget, gint response, TOPLEVEL *w_current)
  +{
  +  switch(response) {
  +  case GTK_RESPONSE_REJECT:
  +  case GTK_RESPONSE_DELETE_EVENT:
  +    text_edit_dialog_cancel(widget, w_current);
  +    break;
  +  case GTK_RESPONSE_ACCEPT:
  +    text_edit_dialog_ok(widget, w_current);
  +    break;
  +  default:
  +    printf("text_edit_dialog_response(): strange signal %d\n", response);
  +  }
  +}
  +
  +/*! \brief Create the edit text properties dialog
  + *  \par Function Description
  + *  This Function creates the dialog to edit text properties. 
  + *  \todo Check why there's no color in the calling parameters
  + */
   void text_edit_dialog (TOPLEVEL *w_current, char *string, int text_size,
   		       int text_alignment)
   {
     GtkWidget *label = NULL;
  -  GtkWidget *buttonok     = NULL;
  -  GtkWidget *buttoncancel = NULL;
  -  GtkWidget *vbox, *action_area;
  +  GtkWidget *vbox;
     GtkWidget *optionmenu = NULL;
     GtkWidget *align_menu = NULL;
     GtkWidget *viewport1 = NULL;
  +  GtkWidget *textentry = NULL;
  +  GtkWidget *sizeentry = NULL;
     GtkWidget *scrolled_window = NULL;
     GtkTextBuffer *textbuffer;
     char *text_size_string;
  -  int len;
  -  int num_selected;
  +  int num_selected=0;
     int select_index=0;
   
  -  num_selected = o_selection_return_num(w_current->page_current->selection2_head);
  -  
     if (!w_current->tewindow) {
  -    w_current->tewindow = x_create_dialog_box(&vbox, &action_area);
  +    w_current->tewindow = gtk_dialog_new_with_buttons(_("Edit Text Properties"),
  +						      GTK_WINDOW(w_current->main_window),
  +						      GTK_DIALOG_MODAL,
  +						      GTK_STOCK_CANCEL,
  +						      GTK_RESPONSE_REJECT,
  +						      GTK_STOCK_OK,
  +						      GTK_RESPONSE_ACCEPT,
  +						      NULL);
  +
  +    gtk_dialog_set_default_response(GTK_DIALOG(w_current->tewindow),
  +				    GTK_RESPONSE_ACCEPT);
       
  -    gtk_window_set_default_size (GTK_WINDOW (w_current->tewindow), 250, 300);
  +    gtk_signal_connect(GTK_OBJECT(w_current->tewindow), "response",
  +		       GTK_SIGNAL_FUNC(text_edit_dialog_response), w_current);
   
       gtk_window_position(GTK_WINDOW (w_current->tewindow),
                           GTK_WIN_POS_MOUSE);
   
  -    gtk_signal_connect(GTK_OBJECT (w_current->tewindow),
  -                       "destroy",
  -                       GTK_SIGNAL_FUNC(destroy_window),
  -                       &w_current->tewindow);
  -
  -    gtk_signal_connect(GTK_OBJECT(w_current->tewindow),
  -                     "key_press_event",
  -                     (GtkSignalFunc) text_edit_dialog_keypress, w_current);
   
  +    vbox = GTK_DIALOG(w_current->tewindow)->vbox;
  +    gtk_container_set_border_width(GTK_CONTAINER(w_current->tewindow),5);
  +    gtk_box_set_spacing(GTK_BOX(vbox),5);
   
  -#if 0 /* removed because it was causing the dialog box to not close */
  -    gtk_signal_connect(GTK_OBJECT (w_current->tewindow),
  -                       "delete_event",
  -                       GTK_SIGNAL_FUNC(gtk_widget_destroyed),
  -                       &w_current->tewindow);
  -#endif
  -
  -    gtk_window_set_title(GTK_WINDOW (w_current->tewindow),
  -                         _("Edit Text"));
  -    gtk_container_border_width(
  -                               GTK_CONTAINER(w_current->tewindow), 10);
  -
  +    /* add a text box if only one object is selected */
  +    num_selected = o_selection_return_num(w_current->page_current->selection2_head);
       if (num_selected == 1) {
  -      label = gtk_label_new (_("Edit Text"));
  -      gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 3);
  +      label = gtk_label_new (_("Text Content:"));
  +      gtk_misc_set_alignment(GTK_MISC(label),0,0);
  +      gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
         gtk_widget_show (label);
   
         viewport1 = gtk_viewport_new (NULL, NULL);
         gtk_widget_show (viewport1);
  +      gtk_widget_set_size_request(GTK_WIDGET(viewport1),-1,75);
   
         scrolled_window = gtk_scrolled_window_new(NULL, NULL);
         gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
   				     GTK_POLICY_AUTOMATIC, 
   				     GTK_POLICY_AUTOMATIC);
         gtk_container_add (GTK_CONTAINER (viewport1), scrolled_window);
  -      gtk_box_pack_start( GTK_BOX(vbox), viewport1, TRUE, TRUE, 10);
  +      gtk_box_pack_start( GTK_BOX(vbox), viewport1, TRUE, TRUE, 0);
         gtk_widget_show(scrolled_window);
         
  -      w_current->teentry = gtk_text_view_new();
  -      gtk_text_view_set_editable(GTK_TEXT_VIEW(w_current->teentry), TRUE);
  -      select_all_text_in_textview(GTK_TEXT_VIEW(w_current->teentry));
  +      textentry = gtk_text_view_new();
  +      gtk_text_view_set_editable(GTK_TEXT_VIEW(textentry), TRUE);
  +      select_all_text_in_textview(GTK_TEXT_VIEW(textentry));
   
         /*! \bug FIXME: Set tab's width in the textview widget. */
         /* See first the code in text_input_dialog and get it working before adding it here. */
   
  -      gtk_container_add(GTK_CONTAINER(scrolled_window), w_current->teentry);
  -
  -      gtk_widget_show (w_current->teentry);
  -      gtk_widget_grab_focus(w_current->teentry);
  +      gtk_container_add(GTK_CONTAINER(scrolled_window), textentry);
  +      gtk_widget_show (textentry);
  +      gtk_widget_grab_focus(textentry);
  +      GLADE_HOOKUP_OBJECT(w_current->tewindow, textentry,"textentry");
       }
   
  -    label = gtk_label_new(_("Edit Text Color"));
  -    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
  +    label = gtk_label_new(_("Text Color:"));
  +    gtk_misc_set_alignment(GTK_MISC(label),0,0);
  +    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
       gtk_widget_show(label);
       
       optionmenu = gtk_option_menu_new();
  -    
  -    gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu), create_color_menu(w_current, &select_index));
  +    gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu), 
  +			     create_color_menu(w_current, &select_index));
       gtk_option_menu_set_history(GTK_OPTION_MENU(optionmenu), select_index);
   	
  -    gtk_box_pack_start(GTK_BOX(vbox), optionmenu, FALSE, TRUE, 5);
  +    gtk_box_pack_start(GTK_BOX(vbox), optionmenu, FALSE, TRUE, 0);
       gtk_widget_show(optionmenu);
   
  -    label = gtk_label_new (_("Edit Text Size"));
  -    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
  +    label = gtk_label_new (_("Text Size:"));
  +    gtk_misc_set_alignment(GTK_MISC(label),0,0);
  +    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
       gtk_widget_show (label);
   
  -    w_current->tsentry = gtk_entry_new_with_max_length (10);
  -    gtk_editable_select_region(
  -                               GTK_EDITABLE (w_current->tsentry), 0, -1);
  -    gtk_box_pack_start(
  -                       GTK_BOX(vbox),
  -                       w_current->tsentry, FALSE, FALSE, 5);
  -    gtk_signal_connect(GTK_OBJECT(w_current->tsentry), "activate",
  -                       GTK_SIGNAL_FUNC(text_edit_dialog_ok),
  -                       w_current);
  -    gtk_widget_show (w_current->tsentry);
  -
  +    sizeentry = gtk_entry_new_with_max_length (10);
  +    gtk_editable_select_region(GTK_EDITABLE (sizeentry), 0, -1);
  +    gtk_box_pack_start(GTK_BOX(vbox),
  +                       sizeentry, FALSE, FALSE, 5);
  +    gtk_widget_show (sizeentry);
   		
  -    label = gtk_label_new (_("Edit Text Alignment"));
  -    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 5);
  +    label = gtk_label_new (_("Text Alignment:"));
  +    gtk_misc_set_alignment(GTK_MISC(label),0,0);
  +    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
       gtk_widget_show (label);
   
       optionmenu = gtk_option_menu_new ();
  @@ -647,50 +649,28 @@
       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_menu_get_active(GTK_MENU(align_menu))),
   				   TRUE);
   
  +    GLADE_HOOKUP_OBJECT(w_current->tewindow, sizeentry,"sizeentry");
  +
       gtk_box_pack_start(GTK_BOX(vbox), optionmenu, FALSE, TRUE, 0);
       gtk_widget_show(optionmenu);
  -
  -
  -    buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  -    GTK_WIDGET_SET_FLAGS(buttoncancel, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start(
  -                       GTK_BOX(action_area),
  -                       buttoncancel, TRUE, TRUE, 5);
  -    gtk_signal_connect(GTK_OBJECT (buttoncancel), "clicked",
  -                       GTK_SIGNAL_FUNC(text_edit_dialog_cancel),
  -                       w_current);
  -    gtk_widget_show(buttoncancel);
  -
  -    buttonok = gtk_button_new_from_stock (GTK_STOCK_OK);
  -    GTK_WIDGET_SET_FLAGS (buttonok, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start(
  -                       GTK_BOX(action_area),
  -                       buttonok, TRUE, TRUE, 5);
  -    gtk_signal_connect(GTK_OBJECT (buttonok), "clicked",
  -                       GTK_SIGNAL_FUNC(text_edit_dialog_ok),
  -                       w_current);
  -    gtk_widget_show(buttonok);
  -    gtk_widget_grab_default(buttonok);
  -
     }
   
     if (!GTK_WIDGET_VISIBLE (w_current->tewindow)) {
       gtk_widget_show (w_current->tewindow);
       if (string != NULL) {
  -      len = strlen(string);
         if (num_selected == 1) { /* only if one thing is selected */
  -	textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w_current->teentry));
  +	textentry = g_object_get_data (G_OBJECT (w_current->tewindow), "textentry");
  +	textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textentry));
   	gtk_text_buffer_set_text(GTK_TEXT_BUFFER(textbuffer), string, -1);
  -	select_all_text_in_textview(GTK_TEXT_VIEW(w_current->teentry));
  +	select_all_text_in_textview(GTK_TEXT_VIEW(textentry));
         }
       }
   
       text_size_string = g_strdup_printf("%d", text_size);
  -    gtk_entry_set_text(GTK_ENTRY(w_current->tsentry),
  +    sizeentry = g_object_get_data (G_OBJECT (w_current->tewindow), "sizeentry");
  +    gtk_entry_set_text(GTK_ENTRY(sizeentry),
                          text_size_string);
       g_free(text_size_string);
  -
  -    gtk_grab_add (w_current->tewindow);
     }
   }
   
  @@ -698,10 +678,9 @@
   
   /***************** Start of Line Type/width dialog box ****************/
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Create a line type menu for the line type dialog
    *  \par Function Description
  - *
  + *  This function creates a GtkMenu with the different linetypes.
    */
   static GtkWidget *create_menu_linetype (TOPLEVEL *w_current)
   {
  @@ -734,10 +713,10 @@
     return(menu);
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Callback function for the linetype menu item in the line type dialog
    *  \par Function Description
  - *
  + *  This Function is called when the user changes the line type selection.
  + *  It sets the dash space/length entries either active or inactive.
    */
   static gint line_type_dialog_linetype_change(GtkWidget *w, gpointer data)
   {
  @@ -780,28 +759,11 @@
     return(0);
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -static int line_type_dialog_keypress(GtkWidget *widget, GdkEventKey *event, 
  -				     gpointer data)
  -{
  -  struct line_type_data *line_type_data = (struct line_type_data*)data;
  -    
  -  if (strcmp (gdk_keyval_name (event->keyval), "Escape") == 0) {
  -    line_type_dialog_cancel (NULL, (gpointer) line_type_data);
  -    return TRUE;
  -  }
  -
  -  return FALSE;
  -}
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Worker function for the line type and width dialog
    *  \par Function Description
  - *
  + *  The function takes the properties of the dialog and applies
  + *  them to the selected objects.
    */
   static void line_type_dialog_ok(GtkWidget *w, gpointer data)
   {
  @@ -883,59 +845,54 @@
       }
     }
   
  -  /* get ride of the list of objects but not the objects */
  -  g_list_free (objects);
  -  line_type_data->objects = NULL;
  -    
     toplevel->page_current->CHANGED = 1;
  -  i_set_state (toplevel, SELECT);
  -  i_update_toolbar (toplevel);
  -    
  -  gtk_grab_remove (line_type_data->dialog);
  -  gtk_widget_destroy (line_type_data->dialog);
  -    
  -  g_free (line_type_data);
  -
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief response function for the line type and width dialog
    *  \par Function Description
  - *
  - */
  -static void line_type_dialog_cancel(GtkWidget *w, gpointer data)
  -{
  -  struct line_type_data *line_type_data = (struct line_type_data*)data;
  -  TOPLEVEL *toplevel = line_type_data->toplevel;
  -    
  -  /* free the list of selected objects */
  -  g_list_free (line_type_data->objects);
  -    
  -  i_set_state (toplevel, SELECT);
  -  i_update_toolbar (toplevel);
  + *  This function takes the user input and applies it to selected 
  + *  objects.
  + *  After that it kills the dialog.
  + */
  +void line_type_dialog_response(GtkWidget *widget, gint response, 
  +			       struct line_type_data *line_type_data)
  +{
  +  switch (response) {
  +  case GTK_RESPONSE_REJECT:
  +  case GTK_RESPONSE_DELETE_EVENT:
  +    /* void */
  +    break;
  +  case GTK_RESPONSE_ACCEPT:
  +    line_type_dialog_ok(widget, line_type_data);
  +    break;
  +  default:
  +    printf("line_type_dialog_response(): strange signal %d\n",response);
  +  }
       
  -  gtk_grab_remove (line_type_data->dialog);
  +  i_set_state (line_type_data->toplevel, SELECT);
  +  i_update_toolbar (line_type_data->toplevel);
     gtk_widget_destroy (line_type_data->dialog);
   
  +  /* get ride of the list of objects but not the objects */
  +  g_list_free (line_type_data->objects);
     g_free (line_type_data);
  -    
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Creates the line type and width dialog
    *  \par Function Description
  - *
  + *  This function creates and sets up a dialog for manipulating the 
  + *  line width and the line type setting of objects.
    */
   void line_type_dialog (TOPLEVEL *w_current, GList *objects)
   {
     GtkWidget *dialog;
  -  GtkWidget *buttonok     = NULL;
  -  GtkWidget *buttoncancel = NULL;
  -  GtkWidget *vbox, *action_area;
  +  GtkWidget *vbox;
     GtkWidget *optionmenu   = NULL;
     GtkWidget *length_entry = NULL;
     GtkWidget *space_entry  = NULL;
     GtkWidget *width_entry  = NULL;
  +  GtkWidget *table;
  +  GtkWidget *label;
     struct line_type_data *line_type_data;
     gchar *width_str, *space_str, *length_str;
     gint type;
  @@ -943,88 +900,81 @@
     line_type_data = (struct line_type_data*) g_malloc (
       sizeof (struct line_type_data));
   
  -  dialog = x_create_dialog_box(&vbox, &action_area);
  +  dialog = gtk_dialog_new_with_buttons(_("Edit Line Width & Type"),
  +				       GTK_WINDOW(w_current->main_window),
  +				       GTK_DIALOG_MODAL,
  +				       GTK_STOCK_CANCEL,
  +				       GTK_RESPONSE_REJECT,
  +				       GTK_STOCK_OK,
  +				       GTK_RESPONSE_ACCEPT,
  +				       NULL);
   
     gtk_window_position(GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
     
  -  gtk_signal_connect(GTK_OBJECT (dialog),
  -                     "destroy",
  -                     GTK_SIGNAL_FUNC(destroy_window),
  -                     &dialog);
  -  gtk_signal_connect (GTK_OBJECT (dialog),
  -                      "key_press_event",
  -                      (GtkSignalFunc) line_type_dialog_keypress,
  -                      line_type_data);
  +  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
   
  -  gtk_window_set_title(GTK_WINDOW (dialog), _("Edit Line Width & Type"));
  -  gtk_container_border_width(GTK_CONTAINER(dialog), 10);
  +  gtk_signal_connect(GTK_OBJECT(dialog), "response",
  +		     GTK_SIGNAL_FUNC(line_type_dialog_response),
  +		     line_type_data);
   
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      gtk_label_new (_("Line Width")),
  -                      TRUE, TRUE, 0);
  +  gtk_container_border_width(GTK_CONTAINER(dialog), 
  +			     DIALOG_BORDER_SPACING);
  +  vbox = GTK_DIALOG(dialog)->vbox;
  +  gtk_box_set_spacing(GTK_BOX(vbox), DIALOG_ELEMENT_SPACING);
  +
  +
  +  label = gtk_label_new(_("Line Properties:"));
  +  gtk_misc_set_alignment(GTK_MISC(label),0,0);
  +  gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
  +
  +  table = gtk_table_new (4, 2, FALSE);
  +  gtk_table_set_row_spacings(GTK_TABLE(table), DIALOG_ELEMENT_SPACING);
  +  gtk_table_set_col_spacings(GTK_TABLE(table), DIALOG_ELEMENT_SPACING);
  +  gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
  +
  +  label = gtk_label_new (_("Width:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,0,1, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Type:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,1,2, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Dash Length:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,2,3, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Dash Space:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,3,4, GTK_FILL,0,0,0);
   
     width_entry = gtk_entry_new();
  -  /*    gtk_editable_select_region(
  -        GTK_EDITABLE(width_entry), 0, -1); */
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      width_entry,
  -                      TRUE, TRUE, 10);
  -  gtk_signal_connect(GTK_OBJECT(width_entry), "activate",
  -                     GTK_SIGNAL_FUNC(line_type_dialog_ok),
  -                     line_type_data);
  -  
  -  gtk_box_pack_start(GTK_BOX(vbox),
  -                     gtk_label_new (_("Line Type")),
  -                     TRUE, TRUE, 5);
  +  gtk_entry_set_activates_default (GTK_ENTRY(width_entry), TRUE);
  +  gtk_editable_select_region(GTK_EDITABLE(width_entry), 0, -1);
  +  gtk_table_attach_defaults(GTK_TABLE(table), width_entry,
  +			    1,2,0,1);
   
     optionmenu = gtk_option_menu_new ();
     gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu),
                              create_menu_linetype (w_current));
  -  gtk_box_pack_start(GTK_BOX(vbox),
  -                     optionmenu,
  -                     TRUE, TRUE, 0);
  +  gtk_table_attach_defaults(GTK_TABLE(table), optionmenu,
  +			    1,2,1,2);
  +
     gtk_signal_connect(GTK_OBJECT (optionmenu), "changed",
                        (GtkSignalFunc) line_type_dialog_linetype_change,
                        line_type_data);
     
  -  gtk_box_pack_start(GTK_BOX(vbox),
  -                     gtk_label_new (_("Line Dash Length")),
  -                     TRUE, TRUE, 5);
  -  
     length_entry = gtk_entry_new();
  +  gtk_entry_set_activates_default (GTK_ENTRY(length_entry), TRUE);
     gtk_editable_select_region(GTK_EDITABLE(length_entry), 0, -1);
  -  gtk_box_pack_start(GTK_BOX(vbox),
  -                     length_entry,
  -                     TRUE, TRUE, 10);
  -
  -  gtk_box_pack_start(GTK_BOX(vbox),
  -                     gtk_label_new (_("Line Dash Space")),
  -                     TRUE, TRUE, 5);
  +  gtk_table_attach_defaults(GTK_TABLE(table), length_entry,
  +			    1,2,2,3);
     
     space_entry = gtk_entry_new();
  +  gtk_entry_set_activates_default (GTK_ENTRY(space_entry), TRUE);
     gtk_editable_select_region(GTK_EDITABLE(space_entry), 0, -1);
  -  gtk_box_pack_start(GTK_BOX(vbox),
  -                     space_entry,
  -                     TRUE, TRUE, 10);
  -
  -  buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  -  GTK_WIDGET_SET_FLAGS(buttoncancel, GTK_CAN_DEFAULT);
  -  gtk_box_pack_start(GTK_BOX(action_area),
  -                     buttoncancel,
  -                     TRUE, TRUE, 0);
  -  gtk_signal_connect(GTK_OBJECT (buttoncancel), "clicked",
  -                     GTK_SIGNAL_FUNC(line_type_dialog_cancel),
  -                     line_type_data);
  -
  -  buttonok = gtk_button_new_from_stock (GTK_STOCK_OK);
  -  GTK_WIDGET_SET_FLAGS (buttonok, GTK_CAN_DEFAULT);
  -  gtk_box_pack_start(GTK_BOX(action_area),
  -                     buttonok,
  -                     TRUE, TRUE, 0);
  -  gtk_signal_connect(GTK_OBJECT (buttonok), "clicked",
  -                     GTK_SIGNAL_FUNC(line_type_dialog_ok),
  -                     line_type_data);
  -  gtk_widget_grab_default(buttonok);
  +  gtk_table_attach_defaults(GTK_TABLE(table), space_entry,
  +			    1,2,3,4);
   
     /* populate the data structure */
     line_type_data->dialog = dialog;
  @@ -1073,6 +1023,9 @@
     gtk_entry_set_text (GTK_ENTRY (space_entry), space_str);
     gtk_entry_set_text (GTK_ENTRY (length_entry), length_str);
     
  +  /* calling it once will set the dash space/length activity */
  +  line_type_dialog_linetype_change(optionmenu, line_type_data);
  +  
     gtk_widget_grab_focus(width_entry);
     gtk_grab_add (dialog);
     
  @@ -1081,17 +1034,15 @@
     g_free (length_str);
     
     gtk_widget_show_all (dialog);
  -  
   }
   
   /***************** End of Line Type / Width dialog box ****************/
   
   /***************** Start of Fill Type dialog box **********************/
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Create a menu with fill types for the line type dialog
    *  \par Function Description
  - *
  + *  This function creates a GtkMenu with the different fill types.
    */
   static GtkWidget *create_menu_filltype (TOPLEVEL *w_current)
   {
  @@ -1123,10 +1074,10 @@
     return menu;
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Callback function for the filltype menu in the filltype dialog
    *  \par Function Description
  - *
  + *  This function sets the entry activity according to the selected 
  + *  filltype of the filltype dialog.
    */
   static gint fill_type_dialog_filltype_change(GtkWidget *w, gpointer data)
   {
  @@ -1180,28 +1131,10 @@
     return(0);
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -static int fill_type_dialog_keypress(GtkWidget * widget, GdkEventKey * event,
  -				     gpointer data)
  -{
  -  struct fill_type_data *fill_type_data = (struct fill_type_data*)data;
  -
  -  if (strcmp (gdk_keyval_name (event->keyval), "Escape") == 0) {
  -    fill_type_dialog_cancel (NULL, (gpointer) fill_type_data);
  -    return TRUE;
  -  }
  -
  -  return FALSE;
  -}
  -
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Apply the settings of the filltype dialog to the selection
    *  \par Function Description
  - *
  + *  This function applies the settings of the filltype dialog to the 
  + *  selected objects
    */
   static void fill_type_dialog_ok(GtkWidget *w, gpointer data)
   {
  @@ -1291,43 +1224,38 @@
         object = object->next;
       }
     }
  -
  -  /* get ride of the list of objects but not the objects */
  -  g_list_free (objects);
  -  fill_type_data->objects = NULL;
  -    
     toplevel->page_current->CHANGED = 1;
  -  i_set_state (toplevel, SELECT);
  -  i_update_toolbar (toplevel);
  -    
  -  gtk_grab_remove (fill_type_data->dialog);
  -  gtk_widget_destroy (fill_type_data->dialog);
  -    
  -  g_free (fill_type_data);
  -  
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief response function for the filltype dialog
    *  \par Function Description
  - *
  + *  This function handles the user response to the filltype dialog.
  + *  It destroys the dialog after that.
    */
  -static void fill_type_dialog_cancel(GtkWidget *w, gpointer data)
  +void fill_type_dialog_response(GtkWidget *widget, gint response,
  +			       struct fill_type_data *fill_type_data)
   {
  -  struct fill_type_data *fill_type_data = (struct fill_type_data*)data;
  -  TOPLEVEL *toplevel = fill_type_data->toplevel;
  -
  -  /* free the list of selected objects */
  -  g_list_free (fill_type_data->objects);
  +  switch (response) {
  +  case GTK_RESPONSE_REJECT:
  +  case GTK_RESPONSE_DELETE_EVENT:
  +    /* void */
  +    break;
  +  case GTK_RESPONSE_ACCEPT:
  +    fill_type_dialog_ok(widget, fill_type_data);
  +    break;
  +  default:
  +    printf("line_type_dialog_response(): strange signal %d\n",response);
  +  }
     
  -  i_set_state (toplevel, SELECT);
  -  i_update_toolbar (toplevel);
  +  i_set_state (fill_type_data->toplevel, SELECT);
  +  i_update_toolbar (fill_type_data->toplevel);
     
     gtk_grab_remove (fill_type_data->dialog);
     gtk_widget_destroy (fill_type_data->dialog);
   
  +  /* get ride of the list of objects but not the objects */
  +  g_list_free (fill_type_data->objects);
     g_free (fill_type_data);
  -  
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1338,15 +1266,15 @@
   void fill_type_dialog(TOPLEVEL *w_current, GList *objects)
   {
     GtkWidget *dialog;
  -  GtkWidget *buttonok     = NULL;
  -  GtkWidget *buttoncancel = NULL;
  -  GtkWidget *vbox, *action_area;
  +  GtkWidget *vbox;
     GtkWidget *optionmenu = NULL;
     GtkWidget *width_entry = NULL;
     GtkWidget *angle1_entry = NULL;
     GtkWidget *pitch1_entry = NULL;
     GtkWidget *angle2_entry = NULL;
     GtkWidget *pitch2_entry = NULL;
  +  GtkWidget *label;
  +  GtkWidget *table;
     struct fill_type_data *fill_type_data;
     gchar *width_str, *angle1_str, *pitch1_str, *angle2_str, *pitch2_str;
     gint type;
  @@ -1354,120 +1282,96 @@
     fill_type_data = (struct fill_type_data*) g_malloc (
       sizeof (struct fill_type_data));
   
  -  dialog = x_create_dialog_box (&vbox, &action_area);
  +  dialog = gtk_dialog_new_with_buttons(_("Edit Fill Type"),
  +				       GTK_WINDOW(w_current->main_window),
  +				       GTK_DIALOG_MODAL,
  +				       GTK_STOCK_CANCEL,
  +				       GTK_RESPONSE_REJECT,
  +				       GTK_STOCK_OK,
  +				       GTK_RESPONSE_ACCEPT,
  +				       NULL);
   
     gtk_window_position(GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
     
  -  gtk_signal_connect(GTK_OBJECT (dialog),
  -                     "destroy",
  -                     GTK_SIGNAL_FUNC(destroy_window),
  -                     &dialog);
  -  gtk_signal_connect (GTK_OBJECT (dialog),
  -                      "key_press_event",
  -                      (GtkSignalFunc) fill_type_dialog_keypress,
  -                      fill_type_data);
  +  gtk_dialog_set_default_response(GTK_DIALOG(dialog),
  +				  GTK_RESPONSE_ACCEPT);
   
  -  gtk_window_set_title(GTK_WINDOW (dialog), _("Edit Fill Type"));
  -  gtk_container_border_width(GTK_CONTAINER(dialog), 10);
  +  gtk_signal_connect(GTK_OBJECT(dialog), "response",
  +		     GTK_SIGNAL_FUNC(fill_type_dialog_response), fill_type_data);
  +
  +  gtk_container_border_width(GTK_CONTAINER(dialog), DIALOG_BORDER_SPACING);
  +  vbox = GTK_DIALOG(dialog)->vbox;
  +  gtk_box_set_spacing(GTK_BOX(vbox), DIALOG_ELEMENT_SPACING);
  +  
  +
  +  label = gtk_label_new(_("Fill Properties:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_box_pack_start(GTK_BOX(vbox),label, FALSE, FALSE, 0);
  +
  +  table = gtk_table_new (6, 2, FALSE);
  +  gtk_table_set_row_spacings(GTK_TABLE(table), DIALOG_ELEMENT_SPACING);
  +  gtk_table_set_col_spacings(GTK_TABLE(table), DIALOG_ELEMENT_SPACING);
  +  gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
  +
  +  label = gtk_label_new (_("Fill Type:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,0,1, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Line Width:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,1,2, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Angle 1:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,2,3, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Pitch 1:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,3,4, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Angle 2:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,4,5, GTK_FILL,0,0,0);
  +
  +  label = gtk_label_new (_("Pitch 2:"));
  +  gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
  +  gtk_table_attach(GTK_TABLE(table), label, 0,1,5,6, GTK_FILL,0,0,0);
     
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      gtk_label_new (_("Fill Type")),
  -                      TRUE, TRUE, 0);
   
     optionmenu = gtk_option_menu_new ();
     gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu),
                              create_menu_filltype (w_current));
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      optionmenu,
  -                      TRUE, TRUE, 0);
  +  gtk_table_attach_defaults(GTK_TABLE(table), optionmenu,
  +			    1,2,0,1);
  +
     gtk_signal_connect(GTK_OBJECT (optionmenu), "changed",
                        (GtkSignalFunc) fill_type_dialog_filltype_change,
                        fill_type_data);
   
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      gtk_label_new (_("Line Width")),
  -                      TRUE, TRUE, 0);
  -
     width_entry = gtk_entry_new();
  -  gtk_editable_select_region (GTK_EDITABLE (width_entry), 0, -1);
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      width_entry,
  -                      TRUE, TRUE, 10);
  -  gtk_signal_connect (GTK_OBJECT (width_entry), "activate",
  -                      GTK_SIGNAL_FUNC (fill_type_dialog_ok),
  -                      fill_type_data);
  -
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      gtk_label_new (_("Angle1")),
  -                      TRUE, TRUE, 0);
  +  gtk_entry_set_activates_default (GTK_ENTRY(width_entry), TRUE);
  +  gtk_table_attach_defaults(GTK_TABLE(table), width_entry,
  +			    1,2,1,2);
   
     angle1_entry = gtk_entry_new ();
  -  gtk_editable_select_region (GTK_EDITABLE (angle1_entry), 0, -1);
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      angle1_entry,
  -                      TRUE, TRUE, 10);
  -  gtk_signal_connect (GTK_OBJECT (angle1_entry), "activate",
  -                      GTK_SIGNAL_FUNC (fill_type_dialog_ok),
  -                      fill_type_data);
  -		
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      gtk_label_new (_("Pitch1")),
  -                      TRUE, TRUE, 0);
  +  gtk_entry_set_activates_default (GTK_ENTRY(angle1_entry), TRUE);
  +  gtk_table_attach_defaults(GTK_TABLE(table), angle1_entry,
  +			    1,2,2,3);
   
     pitch1_entry = gtk_entry_new ();
  -  gtk_editable_select_region (GTK_EDITABLE (pitch1_entry), 0, -1);
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      pitch1_entry,
  -                      TRUE, TRUE, 10);
  -  gtk_signal_connect (GTK_OBJECT (pitch1_entry), "activate",
  -                      GTK_SIGNAL_FUNC (fill_type_dialog_ok),
  -                      fill_type_data);
  -		
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      gtk_label_new (_("Angle2")),
  -                      TRUE, TRUE, 0);
  +  gtk_entry_set_activates_default (GTK_ENTRY(pitch1_entry), TRUE);
  +  gtk_table_attach_defaults(GTK_TABLE(table), pitch1_entry,
  +			    1,2,3,4);
   
     angle2_entry = gtk_entry_new ();
  -  gtk_editable_select_region (GTK_EDITABLE (angle2_entry), 0, -1);
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      angle2_entry,
  -                      TRUE, TRUE, 10);
  -  gtk_signal_connect (GTK_OBJECT (angle2_entry), "activate",
  -                      GTK_SIGNAL_FUNC (fill_type_dialog_ok),
  -                      fill_type_data);
  -
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      gtk_label_new (_("Pitch2")),
  -                      TRUE, TRUE, 0);
  -
  -  pitch2_entry = gtk_entry_new ();
  -  gtk_editable_select_region (GTK_EDITABLE (pitch2_entry), 0, -1);
  -  gtk_box_pack_start (GTK_BOX (vbox),
  -                      pitch2_entry,
  -                      TRUE, TRUE, 10);
  -  gtk_signal_connect (GTK_OBJECT (pitch2_entry), "activate",
  -                      GTK_SIGNAL_FUNC (fill_type_dialog_ok),
  -                      fill_type_data);
  -
  -		
  -  buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  -  GTK_WIDGET_SET_FLAGS (buttoncancel, GTK_CAN_DEFAULT);
  -  gtk_box_pack_start (GTK_BOX (action_area),
  -                      buttoncancel,
  -                      TRUE, TRUE, 0);
  -  gtk_signal_connect (GTK_OBJECT (buttoncancel), "clicked",
  -                      GTK_SIGNAL_FUNC (fill_type_dialog_cancel),
  -                      fill_type_data);
  +  gtk_entry_set_activates_default (GTK_ENTRY(angle2_entry), TRUE);
  +  gtk_table_attach_defaults(GTK_TABLE(table), angle2_entry,
  +			    1,2,4,5);
   
  -  buttonok = gtk_button_new_from_stock (GTK_STOCK_OK);
  -  GTK_WIDGET_SET_FLAGS (buttonok, GTK_CAN_DEFAULT);
  -  gtk_box_pack_start (GTK_BOX (action_area),
  -                      buttonok,
  -                      TRUE, TRUE, 0);
  -  gtk_signal_connect (GTK_OBJECT (buttonok), "clicked",
  -                      GTK_SIGNAL_FUNC (fill_type_dialog_ok),
  -                      fill_type_data);
  -  gtk_widget_grab_default (buttonok);
  +  pitch2_entry = gtk_entry_new ();
  +  gtk_entry_set_activates_default (GTK_ENTRY(pitch2_entry), TRUE);
  +  gtk_table_attach_defaults(GTK_TABLE(table), pitch2_entry,
  +			    1,2,5,6);
   
     /* populate the data structure */
     fill_type_data->dialog = dialog;
  @@ -1528,6 +1432,9 @@
     gtk_entry_set_text (GTK_ENTRY (pitch2_entry), pitch2_str);
     gtk_entry_select_region (GTK_ENTRY (pitch2_entry), 0, strlen (pitch2_str));
     
  +  /* Set the widget activity according to the current filltype */
  +  fill_type_dialog_filltype_change(optionmenu, fill_type_data);
  +
     gtk_widget_grab_focus(width_entry);
     gtk_grab_add (dialog);
     
  @@ -1702,146 +1609,87 @@
   
   /***************** Start of Translate dialog box *********************/
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -int translate_dialog_keypress(GtkWidget * widget, GdkEventKey * event, 
  -			      TOPLEVEL * w_current)
  -{
  -   if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  -	translate_dialog_cancel(NULL, w_current);	
  -        return TRUE;
  -   }
  -
  -   return FALSE;
  -}
  -
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief response function for the translate dialog
    *  \par Function Description
  - *
  + *  This function takes the user action and applies it.
  + *  \todo improve put error detection
    */
  -void translate_dialog_ok(GtkWidget *w, TOPLEVEL *w_current)
  +void translate_dialog_response(GtkWidget *widget, gint response,
  +			       TOPLEVEL *w_current)
   {
  -  char *string=NULL;
  -
  -  string = (char *) gtk_entry_get_text(GTK_ENTRY(w_current->trentry));
  +  GtkWidget *textentry;
  +  gchar *string;
   
  -  if ((string[0] != '\0')) {
  -    /*! \todo put error detection */
  -    /* zero offset has a special meaning... */
  +  switch (response) {
  +  case GTK_RESPONSE_REJECT:
  +  case GTK_RESPONSE_DELETE_EVENT:
  +    /* void */
  +    break;
  +  case GTK_RESPONSE_ACCEPT:
  +    textentry = g_object_get_data(G_OBJECT(w_current->trwindow),"textentry");
  +    string = (gchar*) gtk_entry_get_text(GTK_ENTRY(textentry));
  +    if (strlen(string) != 0) {
       o_complex_translate_all(w_current, atoi(string));
     }
  +    break;
  +  default:
  +    printf("slot_edit_dialog_response(): strange signal %d\n",response);
  +  }
   
  -#if 0
  -  gtk_grab_remove(w_current->trwindow);
  -#endif
  -  gtk_widget_destroy(w_current->trwindow);
  -  w_current->trwindow=NULL;
  -}
  -
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -void translate_dialog_cancel(GtkWidget *w, TOPLEVEL *w_current)
  -{
     i_set_state(w_current, SELECT);
     i_update_toolbar(w_current);
  -#if 0
  -	gtk_grab_remove(w_current->trwindow);
  -#endif
     gtk_widget_destroy(w_current->trwindow);
     w_current->trwindow=NULL;
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +
  +/*! \brief Create the translate dialog
    *  \par Function Description
  - *
  + *  Create the dialog to translate symbols.
    */
   void translate_dialog (TOPLEVEL *w_current)
   {
  -  GtkWidget *label = NULL;
  -  GtkWidget *buttonok = NULL;
  -  GtkWidget *buttoncancel = NULL;
  -  GtkWidget *vbox, *action_area;
  +  GtkWidget *label;
  +  GtkWidget *textentry;
  +  GtkWidget *vbox;
   
     if (!w_current->trwindow) {
  -    w_current->trwindow = x_create_dialog_box(&vbox, &action_area);
  -
  +    w_current->trwindow = gtk_dialog_new_with_buttons(_("Translate"),
  +						      GTK_WINDOW(w_current->main_window),
  +						      GTK_DIALOG_MODAL,
  +						      GTK_STOCK_CANCEL,
  +						      GTK_RESPONSE_REJECT,
  +						      GTK_STOCK_OK,
  +						      GTK_RESPONSE_ACCEPT,
  +						      NULL);
       gtk_window_position(GTK_WINDOW (w_current->trwindow),
                           GTK_WIN_POS_MOUSE);
   
  -    gtk_signal_connect(GTK_OBJECT (w_current->trwindow),
  -                       "destroy",
  -                       GTK_SIGNAL_FUNC(destroy_window),
  -                       &w_current->trwindow);
  -
  -    gtk_signal_connect(GTK_OBJECT(w_current->trwindow),
  -                     "key_press_event",
  -                     (GtkSignalFunc) translate_dialog_keypress, w_current);
  +    gtk_signal_connect(GTK_OBJECT (w_current->trwindow), "response",
  +                       GTK_SIGNAL_FUNC(translate_dialog_response), w_current);
   
  -#if 0 /* removed because it was causing the dialog box to not close */
  -    gtk_signal_connect(GTK_OBJECT (w_current->trwindow),
  -                       "delete_event",
  -                       GTK_SIGNAL_FUNC(destroy_window),
  -                       &w_current->trwindow);
  -#endif
  +    gtk_dialog_set_default_response(GTK_DIALOG(w_current->trwindow),
  +				    GTK_RESPONSE_ACCEPT);
   
  -    gtk_window_set_title(GTK_WINDOW (w_current->trwindow),
  -                         _("Translate"));
  -    gtk_container_border_width (GTK_CONTAINER (
  -                                               w_current->trwindow), 10);
  +    gtk_container_border_width(GTK_CONTAINER(w_current->trwindow), DIALOG_BORDER_SPACING);
  +    vbox = GTK_DIALOG(w_current->trwindow)->vbox;
  +    gtk_box_set_spacing(GTK_BOX(vbox), DIALOG_ELEMENT_SPACING);
   
       label = gtk_label_new(_("Offset to translate?\n(0 for origin)"));
       gtk_misc_set_padding(GTK_MISC (label), 10, 10);
  -    gtk_box_pack_start(
  -                       GTK_BOX(vbox),
  -                       label, TRUE, TRUE, 0);
  -    gtk_widget_show (label);
  -
  -    w_current->trentry = gtk_entry_new_with_max_length (10);
  -    gtk_editable_select_region(GTK_EDITABLE(w_current->trentry),
  -                               0, -1);
  -    gtk_box_pack_start(GTK_BOX(vbox),
  -                       w_current->trentry, FALSE, FALSE, 5);
  -    gtk_signal_connect(GTK_OBJECT(w_current->trentry), "activate",
  -                       GTK_SIGNAL_FUNC(translate_dialog_ok),
  -                       w_current);
  -    gtk_widget_show (w_current->trentry);
  -    gtk_widget_grab_focus(w_current->trentry);
  -
  -    buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  -    GTK_WIDGET_SET_FLAGS (buttoncancel, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start(
  -                       GTK_BOX(action_area),
  -                       buttoncancel, TRUE, TRUE, 0);
  -    gtk_signal_connect(GTK_OBJECT (buttoncancel), "clicked",
  -                       GTK_SIGNAL_FUNC(translate_dialog_cancel),
  -                       w_current);
  -    gtk_widget_show (buttoncancel);
  +    gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
   
  -    buttonok = gtk_button_new_from_stock (GTK_STOCK_OK);
  -    GTK_WIDGET_SET_FLAGS (buttonok, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start (GTK_BOX (action_area),
  -                        buttonok, TRUE, TRUE, 0);
  -    gtk_signal_connect(GTK_OBJECT (buttonok), "clicked",
  -                       GTK_SIGNAL_FUNC(translate_dialog_ok),
  -                       w_current);
  -    gtk_widget_show (buttonok);
  -    gtk_widget_grab_default (buttonok);
  +    textentry = gtk_entry_new_with_max_length (10);
  +    gtk_entry_set_text(GTK_ENTRY(textentry), "0");
  +    gtk_editable_select_region(GTK_EDITABLE(textentry), 0, -1);
  +    gtk_entry_set_activates_default(GTK_ENTRY(textentry), TRUE);
  +    gtk_box_pack_start(GTK_BOX(vbox),textentry, FALSE, FALSE, 0);
   
  +    GLADE_HOOKUP_OBJECT(w_current->trwindow, textentry, "textentry");
     }
   
     if (!GTK_WIDGET_VISIBLE (w_current->trwindow)) {
  -    gtk_widget_show (w_current->trwindow);
  -#if 0
  -    gtk_grab_add (w_current->trwindow);
  -#endif
  +    gtk_widget_show_all (w_current->trwindow);
     }
   }
   
  @@ -2150,162 +1998,100 @@
   
   /***************** Start of slot edit dialog box *********************/
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -int slot_edit_dialog_keypress(GtkWidget * widget, GdkEventKey * event, 
  -			      TOPLEVEL * w_current)
  -{
  -   if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  -	slot_edit_dialog_cancel(NULL, w_current);	
  -        return TRUE;
  -   }
  -
  -   return FALSE;
  -}
  -
  -/*! \todo Finish function documentation!!!
  +/*! \todo response function for the slot edit dialog
    *  \brief
    *  \par Function Description
  - *
  + *  The function takes the dialog entry and applies the new slot to the 
  + *  symbol.
    */
  -void slot_edit_dialog_ok(GtkWidget *w, TOPLEVEL *w_current)
  +void slot_edit_dialog_response(GtkWidget *widget, gint response, TOPLEVEL *w_current)
   {
  +  GtkWidget *textentry;
     int len;
  -  char *string = NULL;
  +  gchar *string = NULL;
   
  -  string = (char *) gtk_entry_get_text(GTK_ENTRY(w_current->seentry));
  -
  -  if (string[0] != '\0') {
  +  switch (response) {
  +  case GTK_RESPONSE_REJECT:
  +  case GTK_RESPONSE_DELETE_EVENT:
  +    /* void */
  +    break;
  +  case GTK_RESPONSE_ACCEPT:
  +    textentry = g_object_get_data(G_OBJECT(w_current->sewindow),"textentry");
  +    string = (gchar*) gtk_entry_get_text(GTK_ENTRY(textentry));
       len = strlen(string);
  -
  -#if DEBUG
  -    printf("text was: _%s_ %d\n", string, len);
  -#endif
  -
  -    if (len < 80) {
  +    if (len != 0) {
         o_slot_end(w_current, string, len);
  -      o_undo_savestate(w_current, UNDO_ALL);
  -    } else {
  -      /*! \todo you should NOT have limits */
  -      fprintf(stderr, _("String too long... hack!\n"));
       }
  +    break;
  +  default:
  +    printf("slot_edit_dialog_response(): strange signal %d\n",response);
     }
  -
     i_set_state(w_current, SELECT);
     i_update_toolbar(w_current);
  -
  -  gtk_grab_remove(w_current->sewindow);
     gtk_widget_destroy(w_current->sewindow);
     w_current->sewindow = NULL;
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -void slot_edit_dialog_cancel(GtkWidget *w, TOPLEVEL *w_current)
  -{
  -  i_set_state(w_current, SELECT);
  -  i_update_toolbar(w_current);
  -  gtk_grab_remove(w_current->sewindow);
  -  gtk_widget_destroy(w_current->sewindow);
  -  w_current->sewindow = NULL;
  -}
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Create the slot entry dialog
    *  \par Function Description
  - *
  + *  This function creates the slot edit dialog.
    */
   void slot_edit_dialog (TOPLEVEL *w_current, char *string)
   {
     GtkWidget *label = NULL;
  -  GtkWidget *buttonok = NULL;
  -  GtkWidget *buttoncancel = NULL;
  -  GtkWidget *vbox, *action_area;
  -  int len;
  +  GtkWidget *textentry;
  +  GtkWidget *vbox;
   
     if (!w_current->sewindow) {
  -    w_current->sewindow = x_create_dialog_box(&vbox, &action_area);
  +    w_current->sewindow = gtk_dialog_new_with_buttons(_("Edit slot number"),
  +						      GTK_WINDOW(w_current->main_window),
  +						      GTK_DIALOG_MODAL,
  +						      GTK_STOCK_CANCEL,
  +						      GTK_RESPONSE_REJECT,
  +						      GTK_STOCK_OK,
  +						      GTK_RESPONSE_ACCEPT,
  +						      NULL);
   
       gtk_window_position(GTK_WINDOW(w_current->sewindow),
                           GTK_WIN_POS_MOUSE);
   
  -    gtk_signal_connect(GTK_OBJECT (w_current->sewindow),
  -                       "destroy", GTK_SIGNAL_FUNC(destroy_window),
  -                       &w_current->sewindow);
  -
  -    gtk_signal_connect(GTK_OBJECT(w_current->sewindow),
  -                     "key_press_event",
  -                     (GtkSignalFunc) slot_edit_dialog_keypress, w_current);
  -
  -#if 0 /* removed because it was causing the dialog box to not close */
  -    gtk_signal_connect(GTK_OBJECT (w_current->sewindow),
  -                       "delete_event",
  -                       GTK_SIGNAL_FUNC(destroy_window),
  -                       &w_current->sewindow);
  -#endif
  -
  -    gtk_window_set_title(GTK_WINDOW (w_current->sewindow),
  -                         _("Edit slot number"));
  -    gtk_container_border_width(
  -                               GTK_CONTAINER(w_current->sewindow), 10);
  +    gtk_dialog_set_default_response (GTK_DIALOG (w_current->sewindow), 
  +				     GTK_RESPONSE_ACCEPT);
   
  -    label = gtk_label_new (_("Edit slot number"));
  -    gtk_box_pack_start(
  -                       GTK_BOX (vbox),
  -                       label, TRUE, TRUE, 0);
  -    gtk_widget_show (label);
  -
  -    w_current->seentry = gtk_entry_new();
  -    gtk_editable_select_region(
  -                               GTK_EDITABLE (w_current->seentry), 0, -1);
  -    gtk_box_pack_start( GTK_BOX(vbox),
  -                       w_current->seentry, TRUE, TRUE, 10);
  -
  -    gtk_signal_connect(GTK_OBJECT(w_current->seentry), "activate",
  -                       GTK_SIGNAL_FUNC(slot_edit_dialog_ok),
  +    gtk_signal_connect(GTK_OBJECT(w_current->sewindow), "response",
  +		       GTK_SIGNAL_FUNC(slot_edit_dialog_response),
                          w_current);
  -    gtk_widget_show (w_current->seentry);
  -    gtk_widget_grab_focus(w_current->seentry);
   
  -    buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  -    GTK_WIDGET_SET_FLAGS (buttoncancel, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start (GTK_BOX (action_area), buttoncancel, 
  -                        TRUE, TRUE, 0);
  -    gtk_signal_connect (GTK_OBJECT (buttoncancel), "clicked",
  -                        GTK_SIGNAL_FUNC(slot_edit_dialog_cancel),
  -                        w_current);
  -    gtk_widget_show (buttoncancel);
  +    gtk_container_border_width(GTK_CONTAINER(w_current->sewindow), 
  +			       DIALOG_BORDER_SPACING);
  +    vbox = GTK_DIALOG(w_current->sewindow)->vbox;
  +    gtk_box_set_spacing(GTK_BOX(vbox), DIALOG_ELEMENT_SPACING);
  +
  +    label = gtk_label_new (_("Edit slot number:"));
  +    gtk_misc_set_alignment(GTK_MISC(label),0,0);
  +    gtk_box_pack_start(GTK_BOX (vbox), label, FALSE, FALSE, 0);
   
  -    buttonok = gtk_button_new_from_stock (GTK_STOCK_OK);
  -    GTK_WIDGET_SET_FLAGS (buttonok, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start(
  -                       GTK_BOX(action_area),
  -                       buttonok, TRUE, TRUE, 0);
  -    gtk_signal_connect (GTK_OBJECT (buttonok), "clicked",
  -                        GTK_SIGNAL_FUNC(slot_edit_dialog_ok),
  -                        w_current);
  -    gtk_widget_show (buttonok);
  -    gtk_widget_grab_default (buttonok);
  +    textentry = gtk_entry_new();
  +    gtk_box_pack_start( GTK_BOX(vbox),
  +                       textentry, FALSE, FALSE, 0);
  +    gtk_entry_set_max_length(GTK_ENTRY(textentry), 80);
  +    gtk_entry_set_activates_default (GTK_ENTRY(textentry),TRUE);
   
  +    GLADE_HOOKUP_OBJECT(w_current->sewindow, textentry, "textentry");
  +    gtk_widget_show_all (w_current->sewindow);
     }
   
  -  if (!GTK_WIDGET_VISIBLE (w_current->sewindow)) {
  -    gtk_widget_show (w_current->sewindow);
  -
       if (string != NULL) {
  -      len = strlen(string);
  -      gtk_entry_set_text(GTK_ENTRY(w_current->seentry),
  -                         string);
  -      gtk_entry_select_region(GTK_ENTRY(w_current->seentry),
  -                              strlen("slot="), len);
  +    textentry = g_object_get_data(G_OBJECT(w_current->sewindow),"textentry");
  +    gtk_entry_set_text(GTK_ENTRY(textentry), string);
  +    gtk_entry_select_region(GTK_ENTRY(textentry),
  +			    strlen("slot="), strlen(string));
       }
  -    gtk_grab_add (w_current->sewindow);
  +
  +  if (!GTK_WIDGET_VISIBLE (w_current->sewindow)) {
  +    gtk_widget_show_all (w_current->sewindow);
  +    gtk_window_activate_focus (GTK_WINDOW(w_current->sewindow));
     }
   }
   
  @@ -2316,7 +2102,6 @@
   /*! \todo Finish function documentation!!!
    *  \brief
    *  \par Function Description
  - *
    */
   int about_dialog_keypress(GtkWidget * widget, GdkEventKey * event, 
   			  TOPLEVEL * w_current)
  @@ -2744,42 +2529,12 @@
         item_index++;
       }
     }
  -  
  -  
     return menu;
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -int color_edit_dialog_keypress(GtkWidget * widget, GdkEventKey * event, 
  -			       TOPLEVEL * w_current)
  -{
  -   if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  -	color_edit_dialog_close(NULL, w_current);	
  -        return TRUE;
  -   }
  -
  -   return FALSE;
  -}
  -
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - *
  - */
  -void color_edit_dialog_close(GtkWidget *w, TOPLEVEL *w_current)
  -{
  -  gtk_widget_destroy(w_current->clwindow);
  -  w_current->clwindow = NULL;
  -}
  -
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief Apply a color change to selected objects
    *  \par Function Description
  - *
  + *  This function applies a color change to the currently selected objects.
    */
   void color_edit_dialog_apply(GtkWidget *w, TOPLEVEL *w_current)
   {
  @@ -2823,80 +2578,79 @@
     o_undo_savestate(w_current, UNDO_ALL);
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  +/*! \brief response function for the color edit dialog
    *  \par Function Description
  - *
  + *  This function takes the user response from the color edit dialog
  + */
  +void color_edit_dialog_response(GtkWidget *widget, gint response, TOPLEVEL *w_current)
  +{
  +  switch (response) {
  +  case GTK_RESPONSE_REJECT:
  +  case GTK_RESPONSE_DELETE_EVENT:
  +    gtk_widget_destroy(w_current->clwindow);
  +    w_current->clwindow = NULL;
  +    break;
  +  case GTK_RESPONSE_ACCEPT:
  +    color_edit_dialog_apply(widget, w_current);
  +    break;
  +  default:
  +    printf("ERROR: color_edit_dialog_response(): strange signal %d\n",response);
  +  }
  +}
  +
  +
  +/*! \brief Create the color edit dialog
  + *  \par Function Description
  + *  This function creates the color edit dialog
    */
   void color_edit_dialog (TOPLEVEL *w_current)
   {
  -  GtkWidget *buttonclose = NULL;
  -  GtkWidget *buttonapply = NULL;
     GtkWidget *optionmenu;
  -  GtkWidget *vbox, *action_area;
  +  GtkWidget *label;
  +  GtkWidget *vbox;
     int select_index = 0;
   
     if (!w_current->clwindow) {
  -    w_current->clwindow = x_create_dialog_box(&vbox, &action_area);
  +    w_current->clwindow = gtk_dialog_new_with_buttons(_("Color Edit"),
  +						      GTK_WINDOW(w_current->main_window),
  +						      0, /* nonmodal dialog */
  +						      GTK_STOCK_CLOSE,
  +						      GTK_RESPONSE_REJECT,
  +						      GTK_STOCK_APPLY,
  +						      GTK_RESPONSE_ACCEPT,
  +						      NULL);
   
       gtk_window_position (GTK_WINDOW (w_current->clwindow),
                            GTK_WIN_POS_MOUSE);
   
  -    gtk_window_set_title (GTK_WINDOW (w_current->clwindow),
  -                          _("Color Edit"));
  -    gtk_container_border_width(
  -                               GTK_CONTAINER(w_current->clwindow), 5);
  -
  -    gtk_signal_connect (GTK_OBJECT (w_current->clwindow),
  -                        "destroy", GTK_SIGNAL_FUNC(destroy_window),
  -                        &w_current->clwindow);
  +    gtk_dialog_set_default_response (GTK_DIALOG (w_current->clwindow), 
  +				     GTK_RESPONSE_ACCEPT);
   
  -    gtk_signal_connect(GTK_OBJECT(w_current->clwindow),
  -                     "key_press_event",
  -                     (GtkSignalFunc) color_edit_dialog_keypress, w_current);
  +    gtk_signal_connect(GTK_OBJECT(w_current->clwindow), "response",
  +		       GTK_SIGNAL_FUNC(color_edit_dialog_response),
  +		       w_current);
   
  -#if 0 /* removed because it was causing the dialog box to not close */
  -    gtk_signal_connect (GTK_OBJECT (w_current->clwindow),
  -                        "delete_event",
  -                        GTK_SIGNAL_FUNC(destroy_window),
  -                        &w_current->clwindow);
  -#endif
  +    gtk_container_border_width(GTK_CONTAINER(w_current->clwindow), 
  +			       DIALOG_BORDER_SPACING);
  +    vbox = GTK_DIALOG(w_current->clwindow)->vbox;
  +    gtk_box_set_spacing(GTK_BOX(vbox), DIALOG_ELEMENT_SPACING);
  +
  +    label = gtk_label_new(_("Object color:"));
  +    gtk_misc_set_alignment(GTK_MISC(label),0,0);
  +    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
   
       optionmenu = gtk_option_menu_new ();
       gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu),
                                create_color_menu (w_current, &select_index));
       gtk_option_menu_set_history(GTK_OPTION_MENU (optionmenu), select_index);
  -    gtk_box_pack_start(
  -                       GTK_BOX(vbox),
  -                       optionmenu, TRUE, TRUE, 0);
  -    gtk_widget_show (optionmenu);
  -
  -    buttonclose = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
  -    gtk_box_pack_start(
  -                       GTK_BOX(action_area),
  -                       buttonclose, TRUE, TRUE, 0);
  -    gtk_signal_connect(GTK_OBJECT (buttonclose), "clicked",
  -                       GTK_SIGNAL_FUNC(color_edit_dialog_close),
  -                       w_current);
  -    gtk_widget_show(buttonclose);
  -
  -    buttonapply = gtk_button_new_from_stock (GTK_STOCK_APPLY);
  -    GTK_WIDGET_SET_FLAGS (buttonapply, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start(
  -                       GTK_BOX(action_area),
  -                       buttonapply, TRUE, TRUE, 0);
  -    gtk_signal_connect(GTK_OBJECT (buttonapply), "clicked",
  -                       GTK_SIGNAL_FUNC(color_edit_dialog_apply),
  -                       w_current);
  -    gtk_widget_show (buttonapply);
  -    gtk_widget_grab_default(buttonapply);
  -
  +    gtk_box_pack_start(GTK_BOX(vbox),
  +                       optionmenu, FALSE, FALSE, 0);
  +    gtk_widget_show_all(w_current->clwindow);
     }
   
  -  if (!GTK_WIDGET_VISIBLE(w_current->clwindow)) {
  -    gtk_widget_show(w_current->clwindow);
  -  } else {
  -    gdk_window_raise(w_current->clwindow->window);
  +  if (w_current->clwindow) {
  +    gtk_widget_show_all(w_current->clwindow);
  +    gtk_window_activate_focus(GTK_WINDOW(w_current->clwindow));
     }
   }
   
  @@ -2904,8 +2658,8 @@
   
   /***************** Start of help/keymapping dialog box **************/
   
  -/* limit this to 128 hotkeys */
  -static char *hotkey_strings[128];
  +#define MAX_HOTKEY_BUFFER  256
  +static char *hotkey_strings[MAX_HOTKEY_BUFFER];
   static int hotkey_counter=0;
   
   /*! \todo Finish function documentation!!!
  @@ -2959,7 +2713,7 @@
   void x_dialog_hotkeys_fill(char *string) 
   {
   
  -  if (hotkey_counter > 127) {
  +  if (hotkey_counter > MAX_HOTKEY_BUFFER-1) {
       printf(_("Ran out of space in the hotkey buffer...\n"));
       return;
     }	
  @@ -4430,7 +4184,7 @@
   	                    FALSE, FALSE, 0);
     
     return object;
  -};
  +}
   
   static void
   close_confirmation_dialog_set_property (GObject      *object,
  
  
  
  1.30.4.1  +3 -0      eda/geda/gaf/gschem/src/x_fileselect.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_fileselect.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_fileselect.c,v
  retrieving revision 1.30
  retrieving revision 1.30.4.1
  diff -u -b -r1.30 -r1.30.4.1
  --- x_fileselect.c	4 Oct 2006 20:11:40 -0000	1.30
  +++ x_fileselect.c	12 Dec 2006 17:32:53 -0000	1.30.4.1
  @@ -234,6 +234,9 @@
     /* set the current filename or directory name if new document */
     gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog),
                                    toplevel->page_current->page_filename);
  +
  +  gtk_dialog_set_default_response(GTK_DIALOG(dialog),
  +				  GTK_RESPONSE_ACCEPT);
     gtk_widget_show (dialog);
     if (gtk_dialog_run ((GtkDialog*)dialog) == GTK_RESPONSE_ACCEPT) {
       gchar *filename =
  
  
  
  1.15.4.1  +4 -0      eda/geda/gaf/gschem/src/x_grid.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_grid.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_grid.c,v
  retrieving revision 1.15
  retrieving revision 1.15.4.1
  diff -u -b -r1.15 -r1.15.4.1
  --- x_grid.c	15 Jul 2006 18:51:41 -0000	1.15
  +++ x_grid.c	12 Dec 2006 17:32:53 -0000	1.15.4.1
  @@ -50,6 +50,7 @@
     int screen_incr = 0;
   
     if (!w_current->grid) {
  +    i_set_grid(w_current, -1);
       return;
     }
   
  @@ -80,6 +81,9 @@
       }
     }
   
  +  /* update status bar */
  +  i_set_grid(w_current, incr);
  +
   #if DEBUG 
     printf("---------x_grid_draw\n incr: %d\n",incr);
   
  
  
  
  1.26.4.1  +98 -121   eda/geda/gaf/gschem/src/x_image.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_image.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_image.c,v
  retrieving revision 1.26
  retrieving revision 1.26.4.1
  diff -u -b -r1.26 -r1.26.4.1
  --- x_image.c	30 Sep 2006 20:03:32 -0000	1.26
  +++ x_image.c	12 Dec 2006 17:32:53 -0000	1.26.4.1
  @@ -35,6 +35,9 @@
   #include <dmalloc.h>
   #endif
   
  +#define GLADE_HOOKUP_OBJECT(component,widget,name) \
  +  g_object_set_data_full (G_OBJECT (component), name, \
  +    gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
   
   /* static const   gchar   *list_item_data_key="list_item_data";	*/
   
  @@ -339,15 +342,18 @@
   gint x_image_write(GtkWidget *w, TOPLEVEL *w_current)
   {
     const char *filename=NULL;
  +  GtkWidget *widget;
   
  -  filename = gtk_entry_get_text(GTK_ENTRY(w_current->ifilename_entry));
  +  widget = g_object_get_data (G_OBJECT (w_current->iwindow), "filename_entry");
  +
  +  filename = gtk_entry_get_text(GTK_ENTRY(widget));
     if (filename[0] != '\0') {
       x_image_lowlevel(w_current, filename);
     }
   
     gtk_widget_destroy(w_current->iwindow);
     w_current->iwindow=NULL;
  -  return(0);
  +  return 0;
   }
   
   /*! \todo Finish function documentation!!!
  @@ -368,17 +374,59 @@
    *  \par Function Description
    *
    */
  -int x_image_keypress(GtkWidget * widget, GdkEventKey * event, 
  -		     TOPLEVEL * w_current)
  +void x_image_response(GtkWidget * widget, gint response, TOPLEVEL *w_current)
   {
  -  if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  -    x_image_cancel(NULL, w_current);	
  -    return TRUE;
  +  switch(response) {
  +  case GTK_RESPONSE_REJECT:
  +  case GTK_RESPONSE_DELETE_EVENT:
  +    x_image_cancel(widget, w_current);
  +    break;
  +  case GTK_RESPONSE_ACCEPT:
  +    x_image_write(widget, w_current);
  +    break;
  +  default:
  +    printf("x_image_response(): strange signal %d\n", response);
     }
  +}
  +
  +
  +/*! \todo Finish function documentation!!!
  + *  \brief
  + *  \par Function Description
  + *
  + */
  +void x_image_select_filename(GtkWidget *w, GtkWidget *image_dialog)
  +{
  +  GtkWidget *widget;
  +  GtkWidget *filechooser;
  +  const gchar *filename;
  +
  +  filechooser = gtk_file_chooser_dialog_new (_("Select Image Filename..."),
  +					     GTK_WINDOW (image_dialog),
  +					     GTK_FILE_CHOOSER_ACTION_SAVE,
  +					     GTK_STOCK_CANCEL,
  +					     GTK_RESPONSE_CANCEL,
  +					     GTK_STOCK_OK,
  +					     GTK_RESPONSE_ACCEPT, NULL);
   
  -  return FALSE;
  +  widget = g_object_get_data (G_OBJECT (image_dialog), "filename_entry");
  +  filename = gtk_entry_get_text (GTK_ENTRY (widget));
  +
  +  gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filechooser), filename);
  +
  +  gtk_dialog_set_default_response(GTK_DIALOG(filechooser),
  +				  GTK_RESPONSE_ACCEPT);
  +
  +  if (gtk_dialog_run (GTK_DIALOG (filechooser)) == GTK_RESPONSE_ACCEPT) {
  +    filename =
  +      gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooser));
  +    gtk_entry_set_text (GTK_ENTRY (widget), filename);
  +   }
  +
  +  gtk_widget_destroy (filechooser);  
   }
   
  +
   /*! \todo Finish function documentation!!!
    *  \brief
    *  \par Function Description
  @@ -387,146 +435,75 @@
   void x_image_setup (TOPLEVEL *w_current, char *filename)
   {
     GtkWidget *label;
  -  GtkWidget *separator;
     GtkWidget *box;
  -  GtkWidget *buttonwrite;
  -  GtkWidget *buttoncancel;
  +  GtkWidget *hbox;
     GtkWidget *optionmenu;
  -  GtkWidget *vbox, *action_area;
  -
  -  /* freeze the window_current pointer so that it doesn't change */
  +  GtkWidget *filename_entry;
  +  GtkWidget *button;
   
  +  /* only create the dialog if it's not there yet */
     if (!w_current->iwindow) {
   
  -    w_current->iwindow = x_create_dialog_box(&vbox, &action_area); 
  +    w_current->iwindow = gtk_dialog_new_with_buttons(_("Write Image..."),
  +						     GTK_WINDOW(w_current->main_window),
  +						     GTK_DIALOG_MODAL,
  +						     GTK_STOCK_CANCEL,
  +						     GTK_RESPONSE_REJECT,
  +						     GTK_STOCK_OK,
  +						     GTK_RESPONSE_ACCEPT,
  +						     NULL);
  +
  +    gtk_dialog_set_default_response(GTK_DIALOG(w_current->iwindow),
  +				    GTK_RESPONSE_ACCEPT);
   
       gtk_window_position (GTK_WINDOW (w_current->iwindow),
                            GTK_WIN_POS_MOUSE);
   
  -    gtk_signal_connect (GTK_OBJECT (w_current->iwindow), "destroy",
  -			GTK_SIGNAL_FUNC(destroy_window),
  -			&w_current->iwindow);
  -
  -#if 0 /* this was causing the dialog box to not die */
  -    gtk_signal_connect (GTK_OBJECT (w_current->iwindow), "delete_event",
  -			GTK_SIGNAL_FUNC(destroy_window),
  -			&w_current->iwindow);
  -#endif
  -
  -    gtk_window_set_title (GTK_WINDOW (w_current->iwindow), _("Write Image..."));
  +    gtk_signal_connect(GTK_OBJECT(w_current->iwindow), "response",
  +		       GTK_SIGNAL_FUNC(x_image_response), w_current);
   
  -    buttonwrite = gtk_button_new_from_stock (GTK_STOCK_OK);
  -    GTK_WIDGET_SET_FLAGS (buttonwrite, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start (GTK_BOX (action_area),
  -			buttonwrite, TRUE, TRUE, 0);
  -    gtk_signal_connect (GTK_OBJECT (buttonwrite), "clicked",
  -			GTK_SIGNAL_FUNC(x_image_write), w_current);
  -    gtk_widget_show (buttonwrite);
  -    gtk_widget_grab_default (buttonwrite);
  -
  -    buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
  -    GTK_WIDGET_SET_FLAGS (buttoncancel, GTK_CAN_DEFAULT);
  -    gtk_box_pack_start (GTK_BOX (action_area),
  -			buttoncancel, TRUE, TRUE, 0);
  -    gtk_signal_connect ( GTK_OBJECT(buttoncancel),
  -                         "clicked", GTK_SIGNAL_FUNC(x_image_cancel),
  -                         w_current);
  -    gtk_widget_show (buttoncancel);
  +    box = GTK_DIALOG(w_current->iwindow)->vbox;
  +    gtk_container_set_border_width(GTK_CONTAINER(w_current->iwindow),5);
  +    gtk_box_set_spacing(GTK_BOX(box),5);
   
  -#if 0
  -    separator = gtk_hseparator_new ();
  -    gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, TRUE, 0);
  -    gtk_widget_show (separator);
  -#endif
  -
  -    box = gtk_vbox_new(FALSE, 0);
  -    gtk_container_border_width(GTK_CONTAINER(box), 5);
  -    gtk_container_add(GTK_CONTAINER(vbox), box);
  -    gtk_widget_show(box);
  -
  -#if 0
  -    label = gtk_label_new (_("Width"));
  -    gtk_misc_set_alignment( GTK_MISC (label), 0, 0);
  -    gtk_misc_set_padding (GTK_MISC (label), 0, 0);
  -    gtk_box_pack_start (GTK_BOX (box),
  -                        label, FALSE, FALSE, 0);
  -    gtk_widget_show (label);
  -
  -    w_current->iwidth_entry = gtk_entry_new_with_max_length (5);
  -    gtk_editable_select_region (GTK_EDITABLE (w_current->iwidth_entry), 0, -1);
  -    gtk_box_pack_start (GTK_BOX (box),
  -                        w_current->iwidth_entry, TRUE, TRUE, 10);
  -    /*
  -      gtk_signal_connect(GTK_OBJECT(w_current->width_entry),
  -      "activate",
  -      GTK_SIGNAL_FUNC(x_image_write),
  -      w_current);
  -    */
  -    gtk_widget_show (w_current->iwidth_entry);
  -
  -    label = gtk_label_new (_("Height"));
  -    gtk_misc_set_alignment( GTK_MISC (label), 0, 0);
  -    gtk_misc_set_padding (GTK_MISC (label), 0, 0);
  -    gtk_box_pack_start (GTK_BOX (box),
  -                        label, FALSE, FALSE, 0);
  -    gtk_widget_show (label);
  -
  -    w_current->iheight_entry = gtk_entry_new_with_max_length (5);
  -    gtk_editable_select_region (GTK_EDITABLE (w_current->iheight_entry), 0, -1);
  -    gtk_box_pack_start (GTK_BOX (box),
  -                        w_current->iheight_entry, TRUE, TRUE, 10);
  -    /*
  -      gtk_signal_connect(GTK_OBJECT(w_current->height_entry),
  -      "activate",
  -      GTK_SIGNAL_FUNC(x_image_write),
  -      w_current);
  -    */
  -    gtk_widget_show (w_current->iheight_entry);
  -#endif
  -    label = gtk_label_new (_("Width x Height"));
  +    label = gtk_label_new (_("Width x Height:"));
       gtk_misc_set_alignment( GTK_MISC (label), 0, 0);
       gtk_misc_set_padding (GTK_MISC (label), 0, 0);
  -    gtk_box_pack_start (GTK_BOX (box),
  -                        label, FALSE, FALSE, 0);
  -    gtk_widget_show (label);
  +    gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
   
       optionmenu = gtk_option_menu_new ();
  -    gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), create_menu_size (w_current));
  +    gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), 
  +			      create_menu_size (w_current));
       gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), 2);
       gtk_box_pack_start (GTK_BOX (box), optionmenu, TRUE, TRUE, 0);
  -    gtk_widget_show (optionmenu);
   
  -    label = gtk_label_new (_("Filename"));
  +    label = gtk_label_new (_("Filename:"));
       gtk_misc_set_alignment( GTK_MISC (label), 0, 0);
       gtk_misc_set_padding (GTK_MISC (label), 0, 0);
       gtk_box_pack_start (GTK_BOX (box),
                           label, FALSE, FALSE, 0);
  -    gtk_widget_show (label);
   
  -    w_current->ifilename_entry = gtk_entry_new_with_max_length (200);
  -    gtk_editable_select_region (GTK_EDITABLE (w_current->ifilename_entry), 0, -1);
  -    gtk_box_pack_start (GTK_BOX (box),
  -                        w_current->ifilename_entry, TRUE, TRUE, 10);
  -    gtk_signal_connect(GTK_OBJECT(w_current->ifilename_entry),
  -                       "activate",
  -                       GTK_SIGNAL_FUNC(x_image_write),
  -                       w_current);
  -    gtk_widget_show (w_current->ifilename_entry);
  +    hbox = gtk_hbox_new(FALSE,10);
  +    gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
  +    filename_entry = gtk_entry_new_with_max_length (200);
  +    gtk_editable_select_region (GTK_EDITABLE (filename_entry), 0, -1);
  +    gtk_box_pack_start (GTK_BOX (hbox),
  +                        filename_entry, TRUE, TRUE, 0);
  +
  +    button = gtk_button_new_with_mnemonic(_("_Browse"));
  +    gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
  +    g_signal_connect(button, "clicked",
  +		     GTK_SIGNAL_FUNC (x_image_select_filename),
  +		     w_current->iwindow);
   
  -    separator = gtk_hseparator_new ();
  -    gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, TRUE, 0);
  -    gtk_widget_show (separator);
  +    GLADE_HOOKUP_OBJECT(w_current->iwindow,filename_entry,"filename_entry");
   
  -    gtk_signal_connect(GTK_OBJECT(w_current->iwindow), "key_press_event",
  -                       (GtkSignalFunc) x_image_keypress, w_current);
  +    gtk_widget_show_all (box);
     }
    
     if (!GTK_WIDGET_VISIBLE (w_current->iwindow)) {
  -    gtk_entry_set_text(GTK_ENTRY(w_current->ifilename_entry), filename);
  -    /* gtk_entry_set_text(GTK_ENTRY(w_current->iwidth_entry), "800");
  -       gtk_entry_set_text(GTK_ENTRY(w_current->iheight_entry), "600");*/
  -
  -    /*gtk_entry_select_region(GTK_ENTRY(w_current->ifilename_entry), 0, strlen(filename)); 	*/
  +    filename_entry = g_object_get_data (G_OBJECT (w_current->iwindow), "filename_entry");
  +    gtk_entry_set_text(GTK_ENTRY(filename_entry), filename);
       w_current->image_width = 800;
       w_current->image_height = 600;
       gtk_widget_show (w_current->iwindow);
  
  
  
  1.17.4.1  +1 -1      eda/geda/gaf/gschem/src/x_log.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_log.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_log.c,v
  retrieving revision 1.17
  retrieving revision 1.17.4.1
  diff -u -b -r1.17 -r1.17.4.1
  --- x_log.c	14 Jul 2006 02:23:55 -0000	1.17
  +++ x_log.c	12 Dec 2006 17:32:53 -0000	1.17.4.1
  @@ -82,7 +82,7 @@
       log_message (LOG (log_dialog), contents);
       g_free (contents);
   
  -    x_log_update_func = (void*)x_log_message;
  +    x_log_update_func = x_log_message;
      
       if( auto_place_mode )
   	gtk_widget_set_uposition( log_dialog, 10, 10); 
  
  
  
  1.38.4.1  +3 -5      eda/geda/gaf/gschem/src/x_menus.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_menus.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_menus.c,v
  retrieving revision 1.38
  retrieving revision 1.38.4.1
  diff -u -b -r1.38 -r1.38.4.1
  --- x_menus.c	6 Aug 2006 16:45:29 -0000	1.38
  +++ x_menus.c	12 Dec 2006 17:32:53 -0000	1.38.4.1
  @@ -220,10 +220,8 @@
       root_menu = gtk_menu_item_new_with_label (menu_name);
       /* do not free *raw_menu_name */
   
  -    help_string = gettext("Help");
  -    if (strcmp(menu_name, help_string) == 0) {
  -      gtk_menu_item_right_justify (GTK_MENU_ITEM(root_menu));
  -    }
  +    /* no longer right justify the help menu since that has gone out of style */
  +
       gtk_widget_show (root_menu);
       gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu);
       gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), root_menu);
  @@ -239,7 +237,7 @@
    *
    */
   static gchar* gettext_fn(const gchar *path,
  -			 gpointer func_data __attribute__((unused)))
  +			 gpointer func_data ATTRIBUTE_UNUSED)
   {
   	return gettext(path);
   }
  
  
  
  1.25.4.1  +10 -3     eda/geda/gaf/gschem/src/x_print.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_print.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_print.c,v
  retrieving revision 1.25
  retrieving revision 1.25.4.1
  diff -u -b -r1.25 -r1.25.4.1
  --- x_print.c	21 Oct 2006 01:46:29 -0000	1.25
  +++ x_print.c	12 Dec 2006 17:32:53 -0000	1.25.4.1
  @@ -98,6 +98,8 @@
     filename = gtk_entry_get_text (GTK_ENTRY (dialog->fnfield));
     gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filechooser), filename);
   
  +  gtk_dialog_set_default_response(GTK_DIALOG(filechooser),
  +				  GTK_RESPONSE_ACCEPT);
   
     if (gtk_dialog_run (GTK_DIALOG (filechooser)) == GTK_RESPONSE_ACCEPT)
       {
  @@ -129,7 +131,7 @@
   			       GTK_RESPONSE_REJECT);
   	  return TRUE;
   	}
  -      if (strcmp (gdk_keyval_name (event->keyval), "Linefeed") == 0)
  +      if (strcmp (gdk_keyval_name (event->keyval), "Return") == 0)
   	{
   	  gtk_dialog_response (GTK_DIALOG (dialog),
   			       GTK_RESPONSE_ACCEPT);
  @@ -214,7 +216,6 @@
   				 renderer, "text", 0);
   
     d->typecbox = GTK_COMBO_BOX (combobox);
  -
   }
   
   /*!
  @@ -710,6 +711,12 @@
   						"usefile", usefile,
   						 NULL));
     gtk_widget_show_all (GTK_WIDGET (dialog));
  +
  +  gtk_dialog_set_default_response(GTK_DIALOG(dialog),
  +				  GTK_RESPONSE_ACCEPT);
  +  gtk_window_set_transient_for(GTK_WINDOW(dialog),
  +			       GTK_WINDOW(w_current->main_window));
  +
     result = gtk_dialog_run (dialog);
     
     if (result == GTK_RESPONSE_ACCEPT)
  
  
  
  1.49.4.1  +3 -3      eda/geda/gaf/gschem/src/x_window.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_window.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_window.c,v
  retrieving revision 1.49
  retrieving revision 1.49.4.1
  diff -u -b -r1.49 -r1.49.4.1
  --- x_window.c	8 Oct 2006 17:43:34 -0000	1.49
  +++ x_window.c	12 Dec 2006 17:32:53 -0000	1.49.4.1
  @@ -92,7 +92,7 @@
   
     toplevel->status_label = NULL;
     toplevel->middle_label = NULL;
  -  toplevel->filename_label = NULL;
  +  toplevel->grid_label = NULL;
     
     toplevel->cswindow = NULL;
     toplevel->aswindow = NULL;
  @@ -704,8 +704,8 @@
     label = gtk_label_new (" ");
     gtk_box_pack_start (GTK_BOX (bottom_box), label, FALSE, FALSE, 5);
   
  -  w_current->filename_label = gtk_label_new (" ");
  -  gtk_box_pack_start (GTK_BOX (bottom_box), w_current->filename_label,
  +  w_current->grid_label = gtk_label_new (" ");
  +  gtk_box_pack_start (GTK_BOX (bottom_box), w_current->grid_label,
                         FALSE, FALSE, 10);
   
     w_current->status_label = gtk_label_new (_("Select Mode"));
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs