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

gEDA-cvs: CVS update: i_callbacks.c



  User: cnieves 
  Date: 07/04/14 15:47:25

  Modified:    .        i_callbacks.c x_compselect.c
  Log:
  Added an "ok" button to the component selector.
  
  * include/x_compselect.h, src/i_callbacks.c, src/x_compselect.c:
  
    Added an "ok" button to the component selector, which hides it
  
    while the user places the components.
  
  
  
  
  Revision  Changes    Path
  1.76      +17 -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.75
  retrieving revision 1.76
  diff -u -b -r1.75 -r1.76
  --- i_callbacks.c	24 Feb 2007 18:43:14 -0000	1.75
  +++ i_callbacks.c	14 Apr 2007 19:47:24 -0000	1.76
  @@ -3508,9 +3508,26 @@
   DEFINE_I_CALLBACK(cancel)
   {
     TOPLEVEL *w_current = (TOPLEVEL *) data;
  +  GValue value = { 0, };
   
     exit_if_null(w_current);
   
  +  if (w_current->event_state == ENDCOMP &&
  +      w_current->cswindow) {
  +    /* user hit escape key when placing components */
  +
  +    /* delete the complex place list */
  +    g_list_free(w_current->page_current->complex_place_list);
  +    w_current->page_current->complex_place_list = NULL;
  +    o_redraw_all(w_current); 
  +
  +    /* Present the component selector again */
  +    g_value_init (&value, G_TYPE_BOOLEAN);
  +    g_value_set_boolean (&value, FALSE);
  +    g_object_set_property (G_OBJECT(w_current->cswindow), "hidden", &value);
  +    return;
  +  }
  +
     if ( (w_current->inside_action) && 
          (w_current->rotated_inside != 0)) {
       o_undo_callback(w_current, UNDO_ACTION);	 
  
  
  
  1.16      +47 -4     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.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- x_compselect.c	10 Feb 2007 21:25:29 -0000	1.15
  +++ x_compselect.c	14 Apr 2007 19:47:25 -0000	1.16
  @@ -82,6 +82,7 @@
   {
     Compselect *compselect = (Compselect*)dialog;
     TOPLEVEL *toplevel = (TOPLEVEL*)user_data;
  +  GValue value = { 0, };
   
     switch (arg1) {
         case GTK_RESPONSE_APPLY: {
  @@ -148,11 +149,33 @@
   
           break;
         }
  +      case GTK_RESPONSE_OK:
  +	/* Response when clicking on the "hide" button */
  +
  +	/* If there is no component in the complex place list, set the current one */
  +	if (toplevel->page_current->complex_place_list == NULL) {
  +	  gtk_dialog_response (GTK_DIALOG (compselect), GTK_RESPONSE_APPLY);
  +	}
  +
  +	/* Hide the component selector */
  +	g_value_init (&value, G_TYPE_BOOLEAN);
  +	g_value_set_boolean(&value, TRUE);
  +	g_object_set_property (G_OBJECT(compselect), "hidden", &value);
  +	break;
         case GTK_RESPONSE_CLOSE:
         case GTK_RESPONSE_DELETE_EVENT:
           g_assert (GTK_WIDGET (dialog) == toplevel->cswindow);
           gtk_widget_destroy (GTK_WIDGET (dialog));
           toplevel->cswindow = NULL;
  +
  +	/* Free the complex place list */
  +	g_list_free(toplevel->page_current->complex_place_list);
  +	toplevel->page_current->complex_place_list = NULL;
  +	
  +	/* return to the default state */
  +	i_set_state(toplevel, SELECT);
  +	i_update_toolbar(toplevel);
  +  
           break;
         default:
           g_assert_not_reached ();
  @@ -208,14 +231,14 @@
       gtk_widget_destroy (toplevel->cswindow);
       toplevel->cswindow = NULL;
     }
  -  
   }
   
   
   
   enum {
     PROP_FILENAME=1,
  -  PROP_BEHAVIOR
  +  PROP_BEHAVIOR,
  +  PROP_HIDDEN
   };
   
   static GObjectClass *compselect_parent_class = NULL;
  @@ -647,6 +670,13 @@
                          COMPSELECT_TYPE_BEHAVIOR,
                          COMPSELECT_BEHAVIOR_REFERENCE,
                          G_PARAM_READWRITE));
  +  g_object_class_install_property (
  +    gobject_class, PROP_HIDDEN,
  +    g_param_spec_boolean ("hidden",
  +			  "",
  +			  "",
  +			  FALSE,
  +			  G_PARAM_READWRITE));
     
   }
   
  @@ -884,8 +914,11 @@
                             GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
                             /*  - update button */
                             GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
  +			  GTK_STOCK_OK, GTK_RESPONSE_OK,
                             NULL);
     
  +  /* Initialize the hidden property */
  +  compselect->hidden = FALSE;
   }
   
   static void
  @@ -914,6 +947,13 @@
         gtk_combo_box_set_active (compselect->combobox_behaviors,
                                   g_value_get_enum (value));
         break;
  +    case PROP_HIDDEN:
  +      compselect->hidden = g_value_get_boolean(value);
  +      if (compselect->hidden) 
  +	gtk_widget_hide(GTK_WIDGET(compselect));
  +      else
  +	gtk_window_present (GTK_WINDOW(compselect));
  +      break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
  @@ -960,6 +1000,9 @@
                             gtk_combo_box_get_active (
                               compselect->combobox_behaviors));
           break;
  +      case PROP_HIDDEN:
  +	g_value_set_boolean(value, compselect->hidden);
  +        break;
         default:
           G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
  
  
  


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