Example #1
0
void
select_border_cmd_callback (GtkAction *action,
                            gpointer   data)
{
  GimpDisplay *display;
  GimpImage   *image;
  GtkWidget   *dialog;
  GtkWidget   *button;
  gdouble      xres;
  gdouble      yres;
  return_if_no_display (display, data);

  image = gimp_display_get_image (display);

  gimp_image_get_resolution (image, &xres, &yres);

  dialog = gimp_query_size_box (_("Border Selection"),
                                GTK_WIDGET (gimp_display_get_shell (display)),
                                gimp_standard_help_func,
                                GIMP_HELP_SELECTION_BORDER,
                                _("Border selection by"),
                                select_border_radius, 1, 32767, 0,
                                gimp_display_get_shell (display)->unit,
                                MIN (xres, yres),
                                FALSE,
                                G_OBJECT (image), "disconnect",
                                select_border_callback, image);

  /* Feather button */
  button = gtk_check_button_new_with_mnemonic (_("_Feather border"));

  gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), button,
                      FALSE, FALSE, 0);

  g_object_set_data (G_OBJECT (dialog), "border-feather-toggle", button);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
                                select_border_feather);
  gtk_widget_show (button);

  /* Edge lock button */
  button = gtk_check_button_new_with_mnemonic (_("_Selected areas continue outside the image"));
  g_object_set_data (G_OBJECT (dialog), "edge-lock-toggle", button);
  gimp_help_set_help_data (button,
                           _("When bordering, act as if selected areas "
                             "continued outside the image."),
                           NULL);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
                                select_border_edge_lock);
  gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), button,
                      FALSE, FALSE, 0);
  gtk_widget_show (button);

  gtk_widget_show (dialog);
}
Example #2
0
void
select_border_cmd_callback (GtkAction *action,
                            gpointer   data)
{
  GimpDisplay *display;
  GtkWidget   *dialog;
  GtkWidget   *button;
  return_if_no_display (display, data);

  dialog = gimp_query_size_box (_("Border Selection"),
                                display->shell,
                                gimp_standard_help_func,
                                GIMP_HELP_SELECTION_BORDER,
                                _("Border selection by"),
                                select_border_radius, 1, 32767, 0,
                                GIMP_DISPLAY_SHELL (display->shell)->unit,
                                MIN (display->image->xresolution,
                                     display->image->yresolution),
                                FALSE,
                                G_OBJECT (display->image), "disconnect",
                                select_border_callback, display->image);

  /* Feather button */
  button = gtk_check_button_new_with_mnemonic (_("_Feather border"));

  gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), button,
                      FALSE, FALSE, 0);

  g_object_set_data (G_OBJECT (dialog), "border-feather-toggle", button);

  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
                                select_border_feather);
  gtk_widget_show (button);


  /* Edge lock button */
  button = gtk_check_button_new_with_mnemonic (_("_Lock selection to image edges"));

  gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), button,
                      FALSE, FALSE, 0);

  g_object_set_data (G_OBJECT (dialog), "edge-lock-toggle", button);

  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
                                select_border_edge_lock);
  gtk_widget_show (button);



  gtk_widget_show (dialog);
}
Example #3
0
void
select_shrink_cmd_callback (GtkAction *action,
                            gpointer   data)
{
  GimpDisplay *display;
  GtkWidget   *dialog;
  GtkWidget   *button;
  return_if_no_display (display, data);

  dialog = gimp_query_size_box (_("Shrink Selection"),
                                display->shell,
                                gimp_standard_help_func,
                                GIMP_HELP_SELECTION_SHRINK,
                                _("Shrink selection by"),
                                select_shrink_pixels, 1, 32767, 0,
                                GIMP_DISPLAY_SHELL (display->shell)->unit,
                                MIN (display->image->xresolution,
                                     display->image->yresolution),
                                FALSE,
                                G_OBJECT (display->image), "disconnect",
                                select_shrink_callback, display->image);

  button = gtk_check_button_new_with_mnemonic (_("_Shrink from image border"));

  gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), button,
                      FALSE, FALSE, 0);

  g_object_set_data (G_OBJECT (dialog), "edge-lock-toggle", button);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
                                ! select_shrink_edge_lock);
  gtk_widget_show (button);

  gtk_widget_show (dialog);
}