~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/tools/gimpselectionoptions.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
20
20
 
21
21
#include <gtk/gtk.h>
22
22
 
23
 
#include "libgimpbase/gimpbase.h"
 
23
#include "libgimpconfig/gimpconfig.h"
24
24
#include "libgimpwidgets/gimpwidgets.h"
25
25
 
26
26
#include "tools-types.h"
27
27
 
28
 
#include "config/gimpconfig-params.h"
29
28
#include "config/gimpguiconfig.h"
30
29
 
31
30
#include "core/gimp.h"
34
33
#include "widgets/gimppropwidgets.h"
35
34
#include "widgets/gimpwidgets-utils.h"
36
35
 
37
 
#include "gimpbycolorselecttool.h"
38
 
#include "gimpellipseselecttool.h"
39
 
#include "gimpfuzzyselecttool.h"
 
36
#include "gimpforegroundselecttool.h"
 
37
#include "gimprectangleselecttool.h"
 
38
#include "gimpregionselecttool.h"
40
39
#include "gimpiscissorstool.h"
41
40
#include "gimpselectionoptions.h"
 
41
#include "gimprectangleselectoptions.h"
42
42
#include "gimptooloptions-gui.h"
43
43
 
44
44
#include "gimp-intl.h"
54
54
  PROP_SELECT_TRANSPARENT,
55
55
  PROP_SAMPLE_MERGED,
56
56
  PROP_THRESHOLD,
57
 
  PROP_AUTO_SHRINK,
58
 
  PROP_SHRINK_MERGED,
59
 
  PROP_FIXED_MODE,
60
 
  PROP_FIXED_WIDTH,
61
 
  PROP_FIXED_HEIGHT,
62
 
  PROP_FIXED_UNIT,
 
57
  PROP_SELECT_CRITERION,
63
58
  PROP_INTERACTIVE
64
59
};
65
60
 
66
61
 
67
 
static void   gimp_selection_options_class_init (GimpSelectionOptionsClass *options_class);
68
 
 
69
62
static void   gimp_selection_options_set_property (GObject         *object,
70
63
                                                   guint            property_id,
71
64
                                                   const GValue    *value,
77
70
 
78
71
static void   gimp_selection_options_reset        (GimpToolOptions *tool_options);
79
72
 
80
 
static void   selection_options_fixed_mode_notify (GimpSelectionOptions *options,
81
 
                                                   GParamSpec           *pspec,
82
 
                                                   GtkWidget            *fixed_box);
83
 
 
84
 
 
85
 
static GimpToolOptionsClass *parent_class = NULL;
86
 
 
87
 
 
88
 
GType
89
 
gimp_selection_options_get_type (void)
90
 
{
91
 
  static GType type = 0;
92
 
 
93
 
  if (! type)
94
 
    {
95
 
      static const GTypeInfo info =
96
 
      {
97
 
        sizeof (GimpSelectionOptionsClass),
98
 
        (GBaseInitFunc) NULL,
99
 
        (GBaseFinalizeFunc) NULL,
100
 
        (GClassInitFunc) gimp_selection_options_class_init,
101
 
        NULL,           /* class_finalize */
102
 
        NULL,           /* class_data     */
103
 
        sizeof (GimpSelectionOptions),
104
 
        0,              /* n_preallocs    */
105
 
        (GInstanceInitFunc) NULL
106
 
      };
107
 
 
108
 
      type = g_type_register_static (GIMP_TYPE_TOOL_OPTIONS,
109
 
                                     "GimpSelectionOptions",
110
 
                                     &info, 0);
111
 
    }
112
 
 
113
 
  return type;
114
 
}
 
73
 
 
74
G_DEFINE_TYPE (GimpSelectionOptions, gimp_selection_options,
 
75
               GIMP_TYPE_TOOL_OPTIONS)
 
76
 
 
77
#define parent_class gimp_selection_options_parent_class
 
78
 
115
79
 
116
80
static void
117
81
gimp_selection_options_class_init (GimpSelectionOptionsClass *klass)
119
83
  GObjectClass         *object_class  = G_OBJECT_CLASS (klass);
120
84
  GimpToolOptionsClass *options_class = GIMP_TOOL_OPTIONS_CLASS (klass);
121
85
 
122
 
  parent_class = g_type_class_peek_parent (klass);
123
 
 
124
86
  object_class->set_property = gimp_selection_options_set_property;
125
87
  object_class->get_property = gimp_selection_options_get_property;
126
88
 
130
92
                                 "operation", NULL,
131
93
                                 GIMP_TYPE_CHANNEL_OPS,
132
94
                                 GIMP_CHANNEL_OP_REPLACE,
133
 
                                 0);
 
95
                                 GIMP_PARAM_STATIC_STRINGS);
134
96
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ANTIALIAS,
135
97
                                    "antialias",
136
98
                                    N_("Smooth edges"),
137
99
                                    TRUE,
138
 
                                    0);
 
100
                                    GIMP_PARAM_STATIC_STRINGS);
139
101
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FEATHER,
140
102
                                    "feather", NULL,
141
103
                                    FALSE,
142
 
                                    0);
 
104
                                    GIMP_PARAM_STATIC_STRINGS);
143
105
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_FEATHER_RADIUS,
144
106
                                   "feather-radius", NULL,
145
107
                                   0.0, 100.0, 10.0,
146
 
                                   0);
 
108
                                   GIMP_PARAM_STATIC_STRINGS);
147
109
 
148
110
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SELECT_TRANSPARENT,
149
111
                                    "select-transparent",
150
112
                                    N_("Allow completely transparent regions "
151
113
                                       "to be selected"),
152
114
                                    TRUE,
153
 
                                    0);
 
115
                                    GIMP_PARAM_STATIC_STRINGS);
154
116
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAMPLE_MERGED,
155
117
                                    "sample-merged",
156
118
                                    N_("Base selection on all visible layers"),
157
119
                                    FALSE,
158
 
                                    0);
 
120
                                    GIMP_PARAM_STATIC_STRINGS);
159
121
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_THRESHOLD,
160
122
                                   "threshold",
161
123
                                   N_("Maximum color difference"),
162
124
                                   0.0, 255.0, 15.0,
163
 
                                   0);
164
 
 
165
 
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_AUTO_SHRINK,
166
 
                                    "auto-shrink", NULL,
167
 
                                    FALSE,
168
 
                                    0);
169
 
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHRINK_MERGED,
170
 
                                    "shrink-merged",
171
 
                                    N_("Use all visible layers when shrinking "
172
 
                                       "the selection"),
173
 
                                    FALSE,
174
 
                                    0);
175
 
 
176
 
  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_FIXED_MODE,
177
 
                                 "fixed-mode", NULL,
178
 
                                 GIMP_TYPE_RECT_SELECT_MODE,
179
 
                                 GIMP_RECT_SELECT_MODE_FREE,
180
 
                                 0);
181
 
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_FIXED_WIDTH,
182
 
                                   "fixed-width", NULL,
183
 
                                   0.0, GIMP_MAX_IMAGE_SIZE, 1.0,
184
 
                                   0);
185
 
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_FIXED_HEIGHT,
186
 
                                   "fixed-height", NULL,
187
 
                                   0.0, GIMP_MAX_IMAGE_SIZE, 1.0,
188
 
                                   0);
189
 
  GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_FIXED_UNIT,
190
 
                                 "fixed-unit", NULL,
191
 
                                 TRUE, TRUE, GIMP_UNIT_PIXEL,
192
 
                                 0);
 
125
                                   GIMP_PARAM_STATIC_STRINGS);
 
126
  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_SELECT_CRITERION,
 
127
                                 "select-criterion", NULL,
 
128
                                 GIMP_TYPE_SELECT_CRITERION,
 
129
                                 GIMP_SELECT_CRITERION_COMPOSITE,
 
130
                                 GIMP_PARAM_STATIC_STRINGS);
193
131
 
194
132
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INTERACTIVE,
195
133
                                    "interactive", NULL,
196
134
                                    FALSE,
197
 
                                    0);
 
135
                                    GIMP_PARAM_STATIC_STRINGS);
 
136
}
 
137
 
 
138
static void
 
139
gimp_selection_options_init (GimpSelectionOptions *options)
 
140
{
198
141
}
199
142
 
200
143
static void
229
172
    case PROP_THRESHOLD:
230
173
      options->threshold = g_value_get_double (value);
231
174
      break;
232
 
 
233
 
    case PROP_AUTO_SHRINK:
234
 
      options->auto_shrink = g_value_get_boolean (value);
235
 
      break;
236
 
    case PROP_SHRINK_MERGED:
237
 
      options->shrink_merged = g_value_get_boolean (value);
238
 
      break;
239
 
 
240
 
    case PROP_FIXED_MODE:
241
 
      options->fixed_mode = g_value_get_enum (value);
242
 
      break;
243
 
    case PROP_FIXED_WIDTH:
244
 
      options->fixed_width = g_value_get_double (value);
245
 
      break;
246
 
    case PROP_FIXED_HEIGHT:
247
 
      options->fixed_height = g_value_get_double (value);
248
 
      break;
249
 
    case PROP_FIXED_UNIT:
250
 
      options->fixed_unit = g_value_get_int (value);
 
175
    case PROP_SELECT_CRITERION:
 
176
      options->select_criterion = g_value_get_enum (value);
251
177
      break;
252
178
 
253
179
    case PROP_INTERACTIVE:
292
218
    case PROP_THRESHOLD:
293
219
      g_value_set_double (value, options->threshold);
294
220
      break;
295
 
 
296
 
    case PROP_AUTO_SHRINK:
297
 
      g_value_set_boolean (value, options->auto_shrink);
298
 
      break;
299
 
    case PROP_SHRINK_MERGED:
300
 
      g_value_set_boolean (value, options->shrink_merged);
301
 
      break;
302
 
 
303
 
    case PROP_FIXED_MODE:
304
 
      g_value_set_enum (value, options->fixed_mode);
305
 
      break;
306
 
    case PROP_FIXED_WIDTH:
307
 
      g_value_set_double (value, options->fixed_width);
308
 
      break;
309
 
    case PROP_FIXED_HEIGHT:
310
 
      g_value_set_double (value, options->fixed_height);
311
 
      break;
312
 
    case PROP_FIXED_UNIT:
313
 
      g_value_set_int (value, options->fixed_unit);
 
221
    case PROP_SELECT_CRITERION:
 
222
      g_value_set_enum (value, options->select_criterion);
314
223
      break;
315
224
 
316
225
    case PROP_INTERACTIVE:
333
242
 
334
243
  if (pspec)
335
244
    G_PARAM_SPEC_BOOLEAN (pspec)->default_value =
336
 
      (tool_options->tool_info->tool_type != GIMP_TYPE_RECT_SELECT_TOOL);
 
245
      (tool_options->tool_info->tool_type != GIMP_TYPE_FOREGROUND_SELECT_TOOL);
337
246
 
338
247
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (tool_options),
339
248
                                        "threshold");
345
254
  GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
346
255
}
347
256
 
 
257
static const gchar *
 
258
gimp_selection_options_get_modifier (GimpChannelOps operation)
 
259
{
 
260
  GdkModifierType mod = 0;
 
261
 
 
262
  switch (operation)
 
263
    {
 
264
    case GIMP_CHANNEL_OP_ADD:
 
265
      mod = GDK_SHIFT_MASK;
 
266
      break;
 
267
 
 
268
    case GIMP_CHANNEL_OP_SUBTRACT:
 
269
      mod = GDK_CONTROL_MASK;
 
270
      break;
 
271
 
 
272
    case GIMP_CHANNEL_OP_REPLACE:
 
273
      mod = 0;
 
274
      break;
 
275
 
 
276
    case GIMP_CHANNEL_OP_INTERSECT:
 
277
      mod = GDK_CONTROL_MASK | GDK_SHIFT_MASK;
 
278
      break;
 
279
    }
 
280
 
 
281
  return gimp_get_mod_string (mod);
 
282
}
 
283
 
348
284
GtkWidget *
349
285
gimp_selection_options_gui (GimpToolOptions *tool_options)
350
286
{
351
287
  GObject              *config  = G_OBJECT (tool_options);
352
288
  GimpSelectionOptions *options = GIMP_SELECTION_OPTIONS (tool_options);
353
 
  GtkWidget            *vbox;
 
289
  GtkWidget            *vbox    = gimp_tool_options_gui (tool_options);
354
290
  GtkWidget            *button;
355
291
 
356
 
  vbox = gimp_tool_options_gui (tool_options);
357
 
 
358
292
  /*  the selection operation radio buttons  */
359
293
  {
360
294
    GtkWidget *hbox;
361
295
    GtkWidget *label;
 
296
    GList     *children;
362
297
    GList     *list;
 
298
    gint       i;
363
299
 
364
300
    hbox = gimp_prop_enum_stock_box_new (config, "operation",
365
301
                                         "gimp-selection", 0, 0);
366
302
    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
367
303
    gtk_widget_show (hbox);
368
304
 
369
 
    list = gtk_container_get_children (GTK_CONTAINER (hbox));
370
 
    gtk_box_reorder_child (GTK_BOX (hbox), GTK_WIDGET (list->next->next->data),
371
 
                           0);
372
 
    g_list_free (list);
 
305
    children = gtk_container_get_children (GTK_CONTAINER (hbox));
 
306
 
 
307
    /*  add modifier keys to the tooltips  */
 
308
    for (list = children, i = 0; list; list = list->next, i++)
 
309
      {
 
310
        GtkWidget       *button   = list->data;
 
311
        GtkTooltipsData *data     = gtk_tooltips_data_get (button);
 
312
        const gchar     *modifier = gimp_selection_options_get_modifier (i);
 
313
 
 
314
        if (! modifier)
 
315
          continue;
 
316
 
 
317
        if (data && data->tip_text)
 
318
          {
 
319
            gchar *tip = g_strdup_printf ("%s  (%s)", data->tip_text, modifier);
 
320
 
 
321
            gimp_help_set_help_data (button, tip, NULL);
 
322
            g_free (tip);
 
323
          }
 
324
        else
 
325
          {
 
326
            gimp_help_set_help_data (button, modifier, NULL);
 
327
          }
 
328
      }
 
329
 
 
330
    /*  move GIMP_CHANNEL_OP_REPLACE to the front  */
 
331
    gtk_box_reorder_child (GTK_BOX (hbox),
 
332
                           GTK_WIDGET (children->next->next->data), 0);
 
333
 
 
334
    g_list_free (children);
373
335
 
374
336
    label = gtk_label_new (_("Mode:"));
375
337
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
383
345
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
384
346
  gtk_widget_show (button);
385
347
 
386
 
  if (tool_options->tool_info->tool_type == GIMP_TYPE_RECT_SELECT_TOOL)
 
348
  if (tool_options->tool_info->tool_type == GIMP_TYPE_FOREGROUND_SELECT_TOOL)
387
349
    gtk_widget_set_sensitive (button, FALSE);
388
350
 
 
351
  options->antialias_toggle = button;
 
352
 
389
353
  /*  the feather frame  */
390
354
  {
391
355
    GtkWidget *frame;
392
356
    GtkWidget *table;
393
357
 
394
 
    frame = gimp_frame_new (NULL);
 
358
    table = gtk_table_new (1, 3, FALSE);
 
359
    gtk_table_set_col_spacings (GTK_TABLE (table), 2);
 
360
 
 
361
    frame = gimp_prop_expanding_frame_new (config, "feather",
 
362
                                           _("Feather edges"),
 
363
                                           table, NULL);
395
364
    gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
396
365
    gtk_widget_show (frame);
397
366
 
398
 
    button = gimp_prop_check_button_new (config, "feather",
399
 
                                         _("Feather edges"));
400
 
    gtk_frame_set_label_widget (GTK_FRAME (frame), button);
401
 
    gtk_widget_show (button);
402
 
 
403
 
    table = gtk_table_new (1, 3, FALSE);
404
 
    gtk_table_set_col_spacings (GTK_TABLE (table), 2);
405
 
    gtk_container_add (GTK_CONTAINER (frame), table);
406
 
    if (options->feather)
407
 
      gtk_widget_show (table);
408
 
 
409
 
    g_signal_connect_object (button, "toggled",
410
 
                             G_CALLBACK (gimp_toggle_button_set_visible),
411
 
                             table, 0);
412
 
 
413
367
    /*  the feather radius scale  */
414
368
    gimp_prop_scale_entry_new (config, "feather-radius",
415
369
                               GTK_TABLE (table), 0, 0,
428
382
    }
429
383
 
430
384
  /*  selection tools which operate on colors or contiguous regions  */
431
 
  if (tool_options->tool_info->tool_type == GIMP_TYPE_FUZZY_SELECT_TOOL ||
432
 
      tool_options->tool_info->tool_type == GIMP_TYPE_BY_COLOR_SELECT_TOOL)
 
385
  if (g_type_is_a (tool_options->tool_info->tool_type,
 
386
                   GIMP_TYPE_REGION_SELECT_TOOL))
433
387
    {
434
388
      GtkWidget *frame;
435
389
      GtkWidget *vbox2;
436
390
      GtkWidget *table;
 
391
      GtkWidget *combo;
437
392
 
438
393
      frame = gimp_frame_new (_("Finding Similar Colors"));
439
394
      gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
456
411
      gtk_widget_show (button);
457
412
 
458
413
      /*  the threshold scale  */
459
 
      table = gtk_table_new (1, 3, FALSE);
 
414
      table = gtk_table_new (2, 3, FALSE);
460
415
      gtk_table_set_col_spacings (GTK_TABLE (table), 2);
461
416
      gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
462
417
      gtk_widget_show (table);
466
421
                                 _("Threshold:"),
467
422
                                 1.0, 16.0, 1,
468
423
                                 FALSE, 0.0, 0.0);
469
 
    }
470
 
 
471
 
  /*  widgets for fixed size select  */
472
 
  if (tool_options->tool_info->tool_type == GIMP_TYPE_RECT_SELECT_TOOL    ||
473
 
      tool_options->tool_info->tool_type == GIMP_TYPE_ELLIPSE_SELECT_TOOL)
474
 
    {
475
 
      GtkWidget *frame;
476
 
      GtkWidget *vbox2;
477
 
      GtkWidget *table;
478
 
      GtkWidget *combo;
479
 
      GtkWidget *menu;
480
 
      GtkWidget *width_spinbutton;
481
 
      GtkWidget *height_spinbutton;
482
 
 
483
 
      frame = gimp_frame_new (NULL);
484
 
      gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
485
 
      gtk_widget_show (frame);
486
 
 
487
 
      button = gimp_prop_check_button_new (config, "auto-shrink",
488
 
                                           _("Auto shrink selection"));
489
 
      gtk_frame_set_label_widget (GTK_FRAME (frame), button);
490
 
      gtk_widget_show (button);
491
 
 
492
 
      vbox2 = gtk_vbox_new (FALSE, 0);
493
 
      gtk_container_add (GTK_CONTAINER (frame), vbox2);
494
 
      if (options->auto_shrink)
495
 
        gtk_widget_show (vbox2);
496
 
 
497
 
      g_signal_connect_object (button, "toggled",
498
 
                               G_CALLBACK (gimp_toggle_button_set_visible),
499
 
                               vbox2, 0);
500
 
 
501
 
      button = gimp_prop_check_button_new (config, "shrink-merged",
502
 
                                           _("Sample merged"));
503
 
      gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
504
 
      gtk_widget_show (button);
505
 
 
506
 
      frame = gimp_frame_new (NULL);
507
 
      gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
508
 
      gtk_widget_show (frame);
509
 
 
510
 
      combo = gimp_prop_enum_combo_box_new (config, "fixed-mode", 0, 0);
511
 
      gtk_frame_set_label_widget (GTK_FRAME (frame), combo);
512
 
      gtk_widget_show (combo);
513
 
 
514
 
      table = gtk_table_new (2, 3, FALSE);
515
 
      gtk_table_set_col_spacings (GTK_TABLE (table), 2);
516
 
      gtk_container_add (GTK_CONTAINER (frame), table);
517
 
 
518
 
      gtk_widget_set_sensitive (table,
519
 
                                options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
520
 
      g_signal_connect (config, "notify::fixed-mode",
521
 
                        G_CALLBACK (selection_options_fixed_mode_notify),
522
 
                        table);
523
 
 
524
 
      width_spinbutton = gimp_prop_spin_button_new (config, "fixed-width",
525
 
                                                    1.0, 50.0, 0);
526
 
      gtk_entry_set_width_chars (GTK_ENTRY (width_spinbutton), 6);
527
 
 
528
 
      gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
529
 
                                 _("Width:"), 0.0, 0.5,
530
 
                                 width_spinbutton, 1, FALSE);
531
 
 
532
 
      height_spinbutton = gimp_prop_spin_button_new (config, "fixed-height",
533
 
                                                     1.0, 50.0, 0);
534
 
      gtk_entry_set_width_chars (GTK_ENTRY (height_spinbutton), 6);
535
 
 
 
424
 
 
425
      /*  the select criterion combo  */
 
426
      combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
536
427
      gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
537
 
                                 _("Height:"), 0.0, 0.5,
538
 
                                 height_spinbutton, 1, FALSE);
539
 
 
540
 
      menu = gimp_prop_unit_menu_new (config, "fixed-unit", "%a");
541
 
      gtk_table_attach (GTK_TABLE (table), menu, 2, 3, 1, 2,
542
 
                        GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
543
 
      gtk_widget_show (menu);
544
 
 
545
 
      g_object_set_data (G_OBJECT (menu), "set_digits", width_spinbutton);
546
 
      g_object_set_data (G_OBJECT (width_spinbutton), "set_digits",
547
 
                         height_spinbutton);
548
 
      gimp_unit_menu_set_pixel_digits (GIMP_UNIT_MENU (menu), 0);
549
 
 
550
 
      gtk_widget_show (table);
 
428
                                 _("Select by:"), 0.0, 0.5,
 
429
                                 combo, 2, FALSE);
551
430
    }
552
431
 
553
432
  return vbox;
554
433
}
555
434
 
556
 
 
557
 
/*  private functions  */
558
 
 
559
 
static void
560
 
selection_options_fixed_mode_notify (GimpSelectionOptions *options,
561
 
                                     GParamSpec           *pspec,
562
 
                                     GtkWidget            *fixed_box)
563
 
{
564
 
  gtk_widget_set_sensitive (fixed_box,
565
 
                            options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
566
 
}