case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET(dlg));
break;
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
default:
- g_assert_not_reached();
+ g_print ("response = %d", response);
+ g_assert_not_reached ();
}
gl_debug (DEBUG_VIEW, "END");
{
glViewBarcode *view_barcode;
GtkMenu *menu;
- GtkWidget *dialog;
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (object && GL_IS_LABEL_BARCODE (object));
G_CALLBACK (update_view_barcode_cb), view_barcode);
/* Create a dialog for controlling/viewing object properties. */
- dialog = construct_properties_dialog (view_barcode);
- gl_view_object_set_dialog (GL_VIEW_OBJECT(view_barcode), dialog);
+ gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_barcode),
+ GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
gl_debug (DEBUG_VIEW, "END");
gdouble scale;
glMerge *merge;
GtkSizeGroup *label_size_group;
+ GtkWidget *window;
gl_debug (DEBUG_VIEW, "START");
/*-----------------------------------------------------------------*/
/* Build dialog. */
/*-----------------------------------------------------------------*/
+ window = gtk_widget_get_toplevel (
+ GTK_WIDGET(gl_view_object_get_view(GL_VIEW_OBJECT(view_barcode))));
dialog = gl_hig_dialog_new_with_buttons ( _("Edit barcode object properties"),
- NULL,
+ GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET(dialog));
break;
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
default:
+ g_print ("response = %d", response);
g_assert_not_reached();
}
guint line_color, fill_color;
gdouble w, h;
GtkMenu *menu;
- GtkWidget *dialog;
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (object && GL_IS_LABEL_BOX (object));
G_CALLBACK (update_view_box_cb), view_box);
/* Create a dialog for controlling/viewing object properties. */
- dialog = construct_properties_dialog (view_box);
- gl_view_object_set_dialog (GL_VIEW_OBJECT(view_box), dialog);
+ gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_box),
+ GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
gl_debug (DEBUG_VIEW, "END");
guint line_color, fill_color;
gdouble x, y, w, h, label_width, label_height;
GtkSizeGroup *label_size_group;
+ GtkWidget *window;
gl_debug (DEBUG_VIEW, "START");
/*-----------------------------------------------------------------*/
/* Build dialog with notebook. */
/*-----------------------------------------------------------------*/
+ window = gtk_widget_get_toplevel (
+ GTK_WIDGET(gl_view_object_get_view(GL_VIEW_OBJECT(view_box))));
dialog = gl_hig_dialog_new_with_buttons ( _("Edit box object properties"),
- NULL,
+ GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET(dialog));
break;
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
default:
- g_assert_not_reached();
+ g_print ("response = %d", response);
+ g_assert_not_reached ();
}
gl_debug (DEBUG_VIEW, "END");
guint line_color, fill_color;
gdouble w, h;
GtkMenu *menu;
- GtkWidget *dialog;
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (object && GL_IS_LABEL_ELLIPSE (object));
G_CALLBACK (update_view_ellipse_cb), view_ellipse);
/* Create a dialog for controlling/viewing object properties. */
- dialog = construct_properties_dialog (view_ellipse);
- gl_view_object_set_dialog (GL_VIEW_OBJECT(view_ellipse), dialog);
+ gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_ellipse),
+ GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
gl_debug (DEBUG_VIEW, "END");
guint line_color, fill_color;
gdouble x, y, w, h, label_width, label_height;
GtkSizeGroup *label_size_group;
+ GtkWidget *window;
gl_debug (DEBUG_VIEW, "START");
/*-----------------------------------------------------------------*/
/* Build dialog with notebook. */
/*-----------------------------------------------------------------*/
+ window = gtk_widget_get_toplevel (
+ GTK_WIDGET(gl_view_object_get_view(GL_VIEW_OBJECT(view_ellipse))));
dialog = gl_hig_dialog_new_with_buttons ( _("Edit ellipse object properties"),
- NULL,
+ GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET(dialog));
break;
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
default:
+ g_print ("response = %d", response);
g_assert_not_reached();
}
const GdkPixbuf *pixbuf;
gdouble w, h;
GtkMenu *menu;
- GtkWidget *dialog;
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (object && GL_IS_LABEL_IMAGE (object));
G_CALLBACK (update_view_image_cb), view_image);
/* Create a dialog for controlling/viewing object properties. */
- dialog = construct_properties_dialog (view_image);
- gl_view_object_set_dialog (GL_VIEW_OBJECT(view_image), dialog);
+ gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_image),
+ GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
gl_debug (DEBUG_VIEW, "END");
gdouble x, y, w, h, label_width, label_height;
gchar *filename;
GtkSizeGroup *label_size_group;
+ GtkWidget *window;
gl_debug (DEBUG_VIEW, "START");
/*-----------------------------------------------------------------*/
/* Build dialog. */
/*-----------------------------------------------------------------*/
+ window = gtk_widget_get_toplevel (
+ GTK_WIDGET(gl_view_object_get_view(GL_VIEW_OBJECT(view_image))));
dialog = gl_hig_dialog_new_with_buttons ( _("Edit image object properties"),
- NULL,
+ GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET(dialog));
break;
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
default:
+ g_print ("response = %d", response);
g_assert_not_reached();
}
guint line_color;
gdouble w, h;
GtkMenu *menu;
- GtkWidget *dialog;
GnomeCanvasPoints *points;
gl_debug (DEBUG_VIEW, "START");
G_CALLBACK (update_view_line_cb), view_line);
/* Create a dialog for controlling/viewing object properties. */
- dialog = construct_properties_dialog (view_line);
- gl_view_object_set_dialog (GL_VIEW_OBJECT(view_line), dialog);
+ gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_line),
+ GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
gl_debug (DEBUG_VIEW, "END");
guint line_color;
gdouble x, y, w, h, label_width, label_height;
GtkSizeGroup *label_size_group;
+ GtkWidget *window;
gl_debug (DEBUG_VIEW, "START");
/*-----------------------------------------------------------------*/
/* Build dialog with notebook. */
/*-----------------------------------------------------------------*/
+ window = gtk_widget_get_toplevel (
+ GTK_WIDGET(gl_view_object_get_view(GL_VIEW_OBJECT(view_line))));
dialog = gl_hig_dialog_new_with_buttons ( _("Edit line object properties"),
- NULL,
+ GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET(dialog));
break;
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
default:
+ g_print ("response = %d", response);
g_assert_not_reached();
}
struct _glViewObjectPrivate {
- glView *view;
- glLabelObject *object;
+ glView *view;
+ glLabelObject *object;
- GnomeCanvasItem *group;
- GnomeCanvasItem *highlight;
+ GnomeCanvasItem *group;
+ GnomeCanvasItem *highlight;
- GtkWidget *menu;
- GtkWidget *property_dialog;
+ GtkWidget *menu;
+ GtkWidget *property_dialog;
+
+ glViewObjectDlgConstructor dialog_constructor;
};
/*========================================================*/
/* Set dialog for controlling/viewing object properties. */
/*****************************************************************************/
void
-gl_view_object_set_dialog (glViewObject *view_object,
- GtkWidget *dialog)
+gl_view_object_set_dlg_constructor (glViewObject *view_object,
+ glViewObjectDlgConstructor dlg_constructor)
{
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
- g_return_if_fail (dialog && GTK_IS_WIDGET (dialog));
- view_object->private->property_dialog = dialog;
+ view_object->private->dialog_constructor = dlg_constructor;
gl_debug (DEBUG_VIEW, "END");
}
g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
+ if (view_object->private->property_dialog != NULL) {
+ gtk_window_present (GTK_WINDOW (view_object->private->property_dialog));
+ return;
+ }
+
+ view_object->private->property_dialog =
+ view_object->private->dialog_constructor (view_object);
+
+ g_signal_connect (G_OBJECT (view_object->private->property_dialog),
+ "destroy",
+ G_CALLBACK (gtk_widget_destroyed),
+ &view_object->private->property_dialog);
+
gtk_widget_show_all (view_object->private->property_dialog);
+
gl_debug (DEBUG_VIEW, "END");
}
#include <gnome.h>
#include "label-object.h"
-G_BEGIN_DECLS
-
-
#define GL_TYPE_VIEW_OBJECT (gl_view_object_get_type ())
#define GL_VIEW_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_OBJECT, glViewObject))
#define GL_VIEW_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_OBJECT, glViewObjectClass))
GObjectClass parent_class;
};
-extern GType gl_view_object_get_type (void);
-extern GObject *gl_view_object_new (void);
+typedef GtkWidget * (*glViewObjectDlgConstructor)(glViewObject *);
+#define GL_VIEW_OBJECT_DLG_CONSTRUCTOR(f) ((glViewObjectDlgConstructor) (f))
+
+G_BEGIN_DECLS
+
+GType gl_view_object_get_type (void);
+
+GObject *gl_view_object_new (void);
+
+
+void gl_view_object_set_view (glViewObject *view_object,
+ glView *view);
+
+void gl_view_object_set_object (glViewObject *view_object,
+ glLabelObject *object,
+ glViewHighlightStyle style);
+
+void gl_view_object_set_dlg_constructor (glViewObject *view_object,
+ glViewObjectDlgConstructor dlg_constructor);
+
+glView *gl_view_object_get_view (glViewObject *view_object);
+
+glLabelObject *gl_view_object_get_object (glViewObject *view_object);
+
+GnomeCanvasItem *gl_view_object_get_group (glViewObject *view_object);
+
+GtkMenu *gl_view_object_get_menu (glViewObject *view_object);
-extern void gl_view_object_set_view (glViewObject *view_object,
- glView *view);
-extern void gl_view_object_set_object (glViewObject *view_object,
- glLabelObject *object,
- glViewHighlightStyle style);
-extern void gl_view_object_set_dialog (glViewObject *view_object,
- GtkWidget *dialog);
+void gl_view_object_update_highlight (glViewObject *view_object);
-extern glView *gl_view_object_get_view (glViewObject *view_object);
-extern glLabelObject *gl_view_object_get_object (glViewObject *view_object);
-extern GnomeCanvasItem *gl_view_object_get_group (glViewObject *view_object);
-extern GtkMenu *gl_view_object_get_menu (glViewObject *view_object);
+void gl_view_object_show_highlight (glViewObject *view_object);
-extern void gl_view_object_update_highlight (glViewObject *view_object);
-extern void gl_view_object_show_highlight (glViewObject *view_object);
-extern void gl_view_object_hide_highlight (glViewObject *view_object);
+void gl_view_object_hide_highlight (glViewObject *view_object);
-extern void gl_view_object_show_dialog (glViewObject *view_object);
+void gl_view_object_show_dialog (glViewObject *view_object);
-extern void gl_view_object_select (glViewObject *view_object);
+void gl_view_object_select (glViewObject *view_object);
G_END_DECLS
{
glViewText *view_text;
GtkMenu *menu;
- GtkWidget *dialog;
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (object && GL_IS_LABEL_TEXT (object));
G_CALLBACK (update_view_text_cb), view_text);
/* Create a dialog for controlling/viewing object properties. */
- dialog = construct_properties_dialog (view_text);
- gl_view_object_set_dialog (GL_VIEW_OBJECT(view_text), dialog);
+ gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_text),
+ GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
gl_debug (DEBUG_VIEW, "END");
GtkJustification just;
glMerge *merge;
GtkSizeGroup *label_size_group;
+ GtkWidget *window;
gl_debug (DEBUG_VIEW, "START");
/*-----------------------------------------------------------------*/
/* Build dialog. */
/*-----------------------------------------------------------------*/
+ window = gtk_widget_get_toplevel (
+ GTK_WIDGET(gl_view_object_get_view(GL_VIEW_OBJECT(view_text))));
dialog = gl_hig_dialog_new_with_buttons ( _("Edit text object properties"),
- NULL,
+ GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET(dialog));
break;
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
default:
+ g_print ("response = %d", response);
g_assert_not_reached();
}