Commit e725eccc authored by Tristan Van Berkom's avatar Tristan Van Berkom

glade_editor_property_new_from_widget() added "packing" argument.


	* gladeui/glade-editor-property.[ch]: glade_editor_property_new_from_widget() added
	  "packing" argument.

	* gladeui/glade-base-editor.[ch]: Fixed va_start() without va_end() in
	  glade_base_editor_add_properties(), also added "packing" argument to
	  glade_base_editor_add_properties().

	* plugins/gtk+/glade-gtk.c: Added "expand" and "homogeneous" packing properties
	  to toolbar children in the toolbar editor (bug 429409).


svn path=/trunk/; revision=1539
parent 0a346340
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
* configure.ac: Removed bogus output about python bindings. * configure.ac: Removed bogus output about python bindings.
* gladeui/glade-editor-property.[ch]: glade_editor_property_new_from_widget() added
"packing" argument.
* gladeui/glade-base-editor.[ch]: Fixed va_start() without va_end() in
glade_base_editor_add_properties(), also added "packing" argument to
glade_base_editor_add_properties().
* plugins/gtk+/glade-gtk.c: Added "expand" and "homogeneous" packing properties
to toolbar children in the toolbar editor (bug 429409).
2006-08-06 Tristan Van Berkom <tvb@gnome.org> 2006-08-06 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/gtk+.xml.in: Disabled the "submenu" property of GtkMenuItem * plugins/gtk+/gtk+.xml.in: Disabled the "submenu" property of GtkMenuItem
......
...@@ -1634,6 +1634,7 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor, ...@@ -1634,6 +1634,7 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor,
* glade_base_editor_add_properties: * glade_base_editor_add_properties:
* @editor: a #GladeBaseEditor * @editor: a #GladeBaseEditor
* @gchild: a #GladeWidget * @gchild: a #GladeWidget
* @packing: whether we are adding packing properties or not
* @...: A NULL terminated list of properties names. * @...: A NULL terminated list of properties names.
* *
* Add @gchild properties to @editor * Add @gchild properties to @editor
...@@ -1642,7 +1643,8 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor, ...@@ -1642,7 +1643,8 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor,
*/ */
void void
glade_base_editor_add_properties (GladeBaseEditor *editor, glade_base_editor_add_properties (GladeBaseEditor *editor,
GladeWidget *gchild, GladeWidget *gchild,
gboolean packing,
...) ...)
{ {
GladeEditorProperty *eprop; GladeEditorProperty *eprop;
...@@ -1652,18 +1654,19 @@ glade_base_editor_add_properties (GladeBaseEditor *editor, ...@@ -1652,18 +1654,19 @@ glade_base_editor_add_properties (GladeBaseEditor *editor,
g_return_if_fail (GLADE_IS_BASE_EDITOR (editor)); g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
g_return_if_fail (GLADE_IS_WIDGET (gchild)); g_return_if_fail (GLADE_IS_WIDGET (gchild));
va_start (args, gchild); va_start (args, packing);
property = va_arg (args, gchar *); property = va_arg (args, gchar *);
while (property) while (property)
{ {
eprop = glade_editor_property_new_from_widget (gchild, property, TRUE); eprop = glade_editor_property_new_from_widget (gchild, property, packing, TRUE);
if (eprop) if (eprop)
glade_base_editor_table_attach (editor, glade_base_editor_table_attach (editor,
GLADE_EDITOR_PROPERTY (eprop)->eventbox, GLADE_EDITOR_PROPERTY (eprop)->eventbox,
GTK_WIDGET (eprop)); GTK_WIDGET (eprop));
property = va_arg (args, gchar *); property = va_arg (args, gchar *);
} }
va_end (args);
} }
/** /**
......
...@@ -71,6 +71,7 @@ void glade_base_editor_add_default_properties (GladeBaseEditor * ...@@ -71,6 +71,7 @@ void glade_base_editor_add_default_properties (GladeBaseEditor *
void glade_base_editor_add_properties (GladeBaseEditor *editor, void glade_base_editor_add_properties (GladeBaseEditor *editor,
GladeWidget *gchild, GladeWidget *gchild,
gboolean packing,
...); ...);
void glade_base_editor_add_label (GladeBaseEditor *editor, void glade_base_editor_add_label (GladeBaseEditor *editor,
......
...@@ -3764,6 +3764,7 @@ glade_editor_property_new (GladePropertyClass *klass, ...@@ -3764,6 +3764,7 @@ glade_editor_property_new (GladePropertyClass *klass,
* glade_editor_property_new_from_widget: * glade_editor_property_new_from_widget:
* @widget: A #GladeWidget * @widget: A #GladeWidget
* @property: The widget's property * @property: The widget's property
* @packing: whether @property indicates a packing property or not.
* @use_command: Whether the undo/redo stack applies here. * @use_command: Whether the undo/redo stack applies here.
* *
* This is a convenience function to create a GladeEditorProperty corresponding * This is a convenience function to create a GladeEditorProperty corresponding
...@@ -3774,12 +3775,16 @@ glade_editor_property_new (GladePropertyClass *klass, ...@@ -3774,12 +3775,16 @@ glade_editor_property_new (GladePropertyClass *klass,
GladeEditorProperty * GladeEditorProperty *
glade_editor_property_new_from_widget (GladeWidget *widget, glade_editor_property_new_from_widget (GladeWidget *widget,
const gchar *property, const gchar *property,
gboolean use_command) gboolean packing,
gboolean use_command)
{ {
GladeEditorProperty *eprop; GladeEditorProperty *eprop;
GladeProperty *p; GladeProperty *p;
p = glade_widget_get_property (widget, property); if (packing)
p = glade_widget_get_pack_property (widget, property);
else
p = glade_widget_get_property (widget, property);
g_return_val_if_fail (GLADE_IS_PROPERTY (p), NULL); g_return_val_if_fail (GLADE_IS_PROPERTY (p), NULL);
eprop = glade_editor_property_new (p->klass, use_command); eprop = glade_editor_property_new (p->klass, use_command);
......
...@@ -87,6 +87,7 @@ GladeEditorProperty *glade_editor_property_new (GladePropertyClass * ...@@ -87,6 +87,7 @@ GladeEditorProperty *glade_editor_property_new (GladePropertyClass *
GladeEditorProperty *glade_editor_property_new_from_widget (GladeWidget *widget, GladeEditorProperty *glade_editor_property_new_from_widget (GladeWidget *widget,
const gchar *property, const gchar *property,
gboolean packing,
gboolean use_command); gboolean use_command);
void glade_editor_property_load (GladeEditorProperty *eprop, void glade_editor_property_load (GladeEditorProperty *eprop,
......
...@@ -4755,14 +4755,14 @@ glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor, ...@@ -4755,14 +4755,14 @@ glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor,
glade_base_editor_add_label (editor, "Properties"); glade_base_editor_add_label (editor, "Properties");
glade_base_editor_add_properties (editor, gchild, "label", "tooltip", NULL); glade_base_editor_add_properties (editor, gchild, FALSE, "label", "tooltip", NULL);
if (type == GTK_TYPE_IMAGE_MENU_ITEM) if (type == GTK_TYPE_IMAGE_MENU_ITEM)
{ {
GtkWidget *image; GtkWidget *image;
GladeWidget *internal; GladeWidget *internal;
glade_base_editor_add_properties (editor, gchild, "stock", NULL); glade_base_editor_add_properties (editor, gchild, FALSE, "stock", NULL);
if ((image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (child)))) if ((image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (child))))
{ {
...@@ -4772,17 +4772,17 @@ glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor, ...@@ -4772,17 +4772,17 @@ glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor,
glade_base_editor_add_label glade_base_editor_add_label
(editor, "Internal Image Properties"); (editor, "Internal Image Properties");
glade_base_editor_add_properties glade_base_editor_add_properties
(editor, internal, "glade-type", "pixbuf", (editor, internal, FALSE, "glade-type", "pixbuf",
"glade-stock", "icon-name", NULL); "glade-stock", "icon-name", NULL);
} }
} }
} }
else if (type == GTK_TYPE_CHECK_MENU_ITEM) else if (type == GTK_TYPE_CHECK_MENU_ITEM)
glade_base_editor_add_properties (editor, gchild, glade_base_editor_add_properties (editor, gchild, FALSE,
"active", "draw-as-radio", "active", "draw-as-radio",
"inconsistent", NULL); "inconsistent", NULL);
else if (type == GTK_TYPE_RADIO_MENU_ITEM) else if (type == GTK_TYPE_RADIO_MENU_ITEM)
glade_base_editor_add_properties (editor, gchild, glade_base_editor_add_properties (editor, gchild, FALSE,
"active", "group", NULL); "active", "group", NULL);
} }
...@@ -5607,7 +5607,7 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor, ...@@ -5607,7 +5607,7 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor,
glade_base_editor_add_label (editor, "Properties"); glade_base_editor_add_label (editor, "Properties");
glade_base_editor_add_properties (editor, gchild, glade_base_editor_add_properties (editor, gchild, FALSE,
"visible-horizontal", "visible-horizontal",
"visible-vertical", "visible-vertical",
NULL); NULL);
...@@ -5615,7 +5615,7 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor, ...@@ -5615,7 +5615,7 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor,
if (type == GTK_TYPE_SEPARATOR_TOOL_ITEM) return; if (type == GTK_TYPE_SEPARATOR_TOOL_ITEM) return;
if (GTK_IS_TOOL_BUTTON (child)) if (GTK_IS_TOOL_BUTTON (child))
glade_base_editor_add_properties (editor, gchild, glade_base_editor_add_properties (editor, gchild, FALSE,
"label", "label",
"glade-type", "glade-type",
"icon", "icon",
...@@ -5624,8 +5624,13 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor, ...@@ -5624,8 +5624,13 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor,
NULL); NULL);
if (type == GTK_TYPE_RADIO_TOOL_BUTTON) if (type == GTK_TYPE_RADIO_TOOL_BUTTON)
glade_base_editor_add_properties (editor, gchild, glade_base_editor_add_properties (editor, gchild, FALSE,
"group", "active", NULL); "group", "active", NULL);
glade_base_editor_add_label (editor, "Packing");
glade_base_editor_add_properties (editor, gchild, TRUE,
"expand", "homogeneous", NULL);
} }
static void static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment