summaryrefslogtreecommitdiffstats
path: root/src/dialogs
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2011-12-11 23:18:05 +0000
committerKris <Kris.De.Gussem@hotmail.com>2011-12-11 23:18:05 +0000
commit7c124c77c3f5db80e46ad23d74dfc92d8f3aa069 (patch)
treebfe0fd1d9b3fe2dc14580eec2ad01a6a12f134f8 /src/dialogs
parentSPAttributeWidget C++ified (diff)
downloadinkscape-7c124c77c3f5db80e46ad23d74dfc92d8f3aa069.tar.gz
inkscape-7c124c77c3f5db80e46ad23d74dfc92d8f3aa069.zip
SPAttributeTable C++ified
(bzr r10766.1.3)
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/item-properties.cpp20
-rw-r--r--src/dialogs/object-attributes.cpp40
2 files changed, 32 insertions, 28 deletions
diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp
index 4ca2b2753..ce8d4e362 100644
--- a/src/dialogs/item-properties.cpp
+++ b/src/dialogs/item-properties.cpp
@@ -356,13 +356,25 @@ static void sp_item_widget_setup( SPWidget *spw, Inkscape::Selection *selection
gtk_container_remove(GTK_CONTAINER(w), int_table);
}
- const gchar* int_labels[10] = {"onclick", "onmouseover", "onmouseout", "onmousedown", "onmouseup", "onmousemove","onfocusin", "onfocusout", "onactivate", "onload"};
-
- int_table = sp_attribute_table_new (obj, 10, int_labels, int_labels);
+ std::vector<Glib::ustring> int_labels;
+ std::vector<Glib::ustring> int_attributes;
+ int_labels.push_back("onclick");
+ int_labels.push_back("onmouseover");
+ int_labels.push_back("onmouseout");
+ int_labels.push_back("onmousedown");
+ int_labels.push_back("onmouseup");
+ int_labels.push_back("onmousemove");
+ int_labels.push_back("onfocusin");
+ int_labels.push_back("onfocusout");
+ int_labels.push_back("onfocusout");
+ int_labels.push_back("onload");
+int_attributes=int_labels;
+ SPAttributeTable* t = new SPAttributeTable (obj, int_labels, int_attributes, GTK_CONTAINER (w));
+ int_table = (GtkWidget*) t->gobj();
gtk_widget_show_all (int_table);
g_object_set_data(G_OBJECT(spw), "interactivity_table", int_table);
- gtk_container_add (GTK_CONTAINER (w), int_table);
+// gtk_container_add (GTK_CONTAINER (w), int_table);
}
diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp
index f83d3ef1f..bdb292622 100644
--- a/src/dialogs/object-attributes.cpp
+++ b/src/dialogs/object-attributes.cpp
@@ -72,7 +72,6 @@ static void object_released( SPObject */*object*/, GtkWidget *widget )
}
-
static void window_destroyed( GtkObject *window, GtkObject */*object*/ )
{
sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection");
@@ -81,26 +80,16 @@ static void window_destroyed( GtkObject *window, GtkObject */*object*/ )
}
-
static void sp_object_attr_show_dialog ( SPObject *object,
const SPAttrDesc *desc,
const gchar *tag )
{
- const gchar **labels, **attrs;
- gint len, i;
+ int len;
+ GtkWidget *w;
+ SPAttributeTable* t;
Glib::ustring title;
- GtkWidget *w, *t;
-
- len = 0;
- while (desc[len].label) len += 1;
-
- labels = (const gchar **) new gchar* [len];
- attrs = (const gchar **) new gchar* [len];
-
- for (i = 0; i < len; i++) {
- labels[i] = desc[i].label;
- attrs[i] = desc[i].attribute;
- }
+ std::vector<Glib::ustring> labels;
+ std::vector<Glib::ustring> attrs;
if (!strcmp (tag, "Link")) {
title = _("Link Properties");
@@ -110,17 +99,21 @@ static void sp_object_attr_show_dialog ( SPObject *object,
title = Glib::ustring::compose(_("%1 Properties"), tag);
}
+ len = 0;
+ while (desc[len].label)
+ {
+ labels.push_back(desc[len].label);
+ attrs.push_back (desc[len].attribute);
+ len += 1;
+ }
+
w = sp_window_new (title.c_str(), TRUE);
-
- t = sp_attribute_table_new (object, len, labels, attrs);
- gtk_widget_show (t);
- gtk_container_add (GTK_CONTAINER (w), t);
- delete labels;
- delete attrs;
+ t = new SPAttributeTable (object, labels, attrs, GTK_CONTAINER (w));
+ t->show();
+ //gtk_container_add (GTK_CONTAINER (w), (GtkWidget*)t->gobj());
g_signal_connect ( G_OBJECT (w), "destroy",
G_CALLBACK (window_destroyed), object );
-
sigc::connection *release_connection = new sigc::connection();
*release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&object_released), w));
g_object_set_data(G_OBJECT(w), "release_connection", release_connection);
@@ -129,7 +122,6 @@ static void sp_object_attr_show_dialog ( SPObject *object,
} // end of sp_object_attr_show_dialog()
-
void sp_object_attributes_dialog (SPObject *object, const gchar *tag)
{
g_return_if_fail (object != NULL);