Logo Search packages:      
Sourcecode: ygraph version File versions  Download package

void subtract_select_dialog_create ( Plot plot,
gint  action,
GtkItem *  button 
)

Creates a dialog box for loading a pair of files to be subtracted.

Parameters:
plot The calling Plot.
action The calling action (unused).
button The calling button (unused).

Definition at line 543 of file special_fn.c.

References file_select_A(), file_select_B(), and file_subtract().

{
  GtkWidget* dialog;
  GtkWidget* label;
  GtkWidget* hbox_A;
  GtkWidget* file_label_A;
  GtkWidget* file_button_A;
  GtkWidget* hbox_B;
  GtkWidget* file_label_B;
  GtkWidget* file_button_B;
  GtkWidget* okay_button;
  GtkWidget* cancel_button;

  UNUSED(action);
  UNUSED(button);
  dialog = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(dialog), SUBTRACT_DIALOG_TITLE);
  gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);

  label = gtk_label_new(SUBTRACT_MESSAGE);
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), label);

  hbox_A = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox_A);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox_A, FALSE,
                     FALSE, 0);

  file_label_A = gtk_label_new(FILE_A_LABEL);
  gtk_widget_show(file_label_A);
  gtk_box_pack_start(GTK_BOX(hbox_A), file_label_A, FALSE, FALSE, 0);

  file_entry_A = gtk_entry_new();
  gtk_entry_set_max_length(GTK_ENTRY(file_entry_A), FILE_STR_SIZE);
  gtk_widget_show(file_entry_A);
  gtk_box_pack_start(GTK_BOX(hbox_A), file_entry_A, FALSE, FALSE, 0);
  gtk_widget_set_usize(file_entry_A, FILE_ENTRY_LENGTH, -2);

  file_button_A = gtk_button_new_with_label(SELECT_LABEL);
  gtk_signal_connect(GTK_OBJECT(file_button_A), "clicked",
                     GTK_SIGNAL_FUNC(file_select_A), plot);
  gtk_widget_show(file_button_A);
  gtk_box_pack_start(GTK_BOX(hbox_A), file_button_A, FALSE, FALSE, 0);

  hbox_B = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox_B);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox_B, FALSE,
                     FALSE, 0);

  file_label_B = gtk_label_new(FILE_B_LABEL);
  gtk_widget_show(file_label_B);
  gtk_box_pack_start(GTK_BOX(hbox_B), file_label_B, FALSE, FALSE, 0);

  file_entry_B = gtk_entry_new();
  gtk_entry_set_max_length(GTK_ENTRY(file_entry_B), FILE_STR_SIZE);
  gtk_widget_show(file_entry_B);
  gtk_box_pack_start(GTK_BOX(hbox_B), file_entry_B, FALSE, FALSE, 0);
  gtk_widget_set_usize(file_entry_B, FILE_ENTRY_LENGTH, -2);

  file_button_B = gtk_button_new_with_label(SELECT_LABEL);
  gtk_signal_connect(GTK_OBJECT(file_button_B), "clicked",
                     GTK_SIGNAL_FUNC(file_select_B), NULL);
  gtk_widget_show(file_button_B);
  gtk_box_pack_start(GTK_BOX(hbox_B), file_button_B, FALSE, FALSE, 0);

  new_window_check = gtk_check_button_new_with_label(NEW_WINDOW_LABEL);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), new_window_check,
                     FALSE, FALSE, 0);
  gtk_widget_show(new_window_check);

  okay_button = gtk_button_new_with_label(OKAY_BUTTON_LABEL);
  gtk_signal_connect(GTK_OBJECT(okay_button),
                     "clicked", GTK_SIGNAL_FUNC(file_subtract), plot);
  gtk_signal_connect_object (GTK_OBJECT (okay_button), "clicked",
                             GTK_SIGNAL_FUNC (gtk_widget_destroy),
                             GTK_OBJECT(dialog));
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area),
                     okay_button);
  gtk_widget_show(okay_button);

  cancel_button = gtk_button_new_with_label(CANCEL_BUTTON_LABEL);
  gtk_signal_connect_object (GTK_OBJECT (cancel_button), "clicked",
                             GTK_SIGNAL_FUNC (gtk_widget_destroy),
                             GTK_OBJECT(dialog));
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area),
                     cancel_button);
  gtk_widget_show(cancel_button);

  gtk_widget_show_all (dialog);
}


Generated by  Doxygen 1.6.0   Back to index