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

gEDA-cvs: CVS update: x_autonumber.c



  User: werner  
  Date: 06/11/26 13:49:46

  Modified:    .        Tag: autonumber x_autonumber.c
  Log:
  	 * src/x_autonumber.c: remove the slot attribute if remove numbers
  
  	   and slotting is active.
  
  
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +40 -14    eda/geda/gaf/gschem/src/Attic/x_autonumber.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_autonumber.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/Attic/x_autonumber.c,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -b -r1.1.2.5 -r1.1.2.6
  --- x_autonumber.c	24 Nov 2006 22:45:10 -0000	1.1.2.5
  +++ x_autonumber.c	26 Nov 2006 18:49:45 -0000	1.1.2.6
  @@ -559,6 +559,10 @@
    */
   void autonumber_remove_number(AUTONUMBER_TEXT * autotext, OBJECT *o_current)
   {
  +  ATTRIB *a_current;
  +  OBJECT *o_parent, *o_slot;
  +  gchar *slot_str;
  +
     /* replace old text */
     g_free(o_current->text->string);
     o_current->text->string = g_strdup_printf("%s?", 
  @@ -568,6 +572,23 @@
     o_text_erase(autotext->toplevel, o_current);
     o_text_recreate(autotext->toplevel, o_current);
     o_text_draw(autotext->toplevel, o_current);
  +
  +  /* remove the slot attribute if slotting is active */
  +  if (autotext->slotting) {
  +    /* get the slot attribute */
  +    if ((a_current = o_current->attached_to) != NULL) {
  +      o_parent = o_attrib_return_parent(a_current);
  +      slot_str = o_attrib_search_slot(o_parent, &o_slot);
  +      if (slot_str != NULL && o_slot != NULL) {
  +	g_free(slot_str);
  +	/* delete the slot attribute */
  +	o_selection_remove (autotext->toplevel->page_current->selection2_head, o_slot);
  +	o_delete_text (autotext->toplevel, o_slot);
  +	/* redraw the slotted object. So that the pinnumbers appear as with slot=1 */
  +	/* --> No: should be done by o_delete_text as several dialog use it. */
  +      }
  +    }
  +  }
     autotext->toplevel->page_current->CHANGED = 1;
   }
   
  @@ -832,7 +853,11 @@
     return found_widget;
   }
   
  -
  +/*! \brief Put the icons and the text into the sortorder combobox
  + *  \par Function Description
  + *  Load all bitmaps for the combobox and store them together with the label
  + *  in a GtkListStore.
  + */
   void autonumber_sortorder_create(TOPLEVEL *w_current, GtkWidget *sort_order)
   {
     GtkListStore *store;
  @@ -1104,6 +1129,19 @@
     autotext->dialog = NULL;
   }
   
  +/** @brief Close button callback function of the autonumber text dialog
  + *
  + *  Just destroys the dialog. The triggered destroy event will save the 
  + *  dialog contents.
  + */
  +void autonumber_text_close(GtkWidget * w, AUTONUMBER_TEXT *autotext)
  +{
  +  gtk_widget_destroy(autotext->dialog);
  +
  +  /* the settings are stored by autonumber_text_destroy, 
  +     called by the destroy event */
  +}
  +
   /*! \brief Keypress callback for the autonumber text dialog
    *  \par Function Description
    *  The function just closes the dialog if one presses the Escape key.
  @@ -1149,18 +1187,6 @@
     }
   }
   
  -/** @brief Close button callback function of the autonumber text dialog
  - *
  - *  Just destroys the dialog. The triggered destroy event will save the 
  - *  dialog contents.
  - */
  -void autonumber_text_close(GtkWidget * w, AUTONUMBER_TEXT *autotext)
  -{
  -  gtk_widget_destroy(autotext->dialog);
  -
  -  /* the settings are stored by autonumber_text_destroy, 
  -     called by the destroy event */
  -}
   
   /* ***** DIALOG SET-UP ***************************************************** */
   
  
  
  


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