return ret;
}
+/**
+ * gtk_form_field_get_origin_value:
+ * @field: a #GtkFormField object.
+ *
+ */
+GValue
+*gtk_form_field_get_original_value (GtkFormField *field)
+{
+ GValue *ret;
+
+ ret = NULL;
+
+ if (IS_GTK_FORM_FIELD (field) && GTK_FORM_FIELD_GET_CLASS (field)->get_original_value != NULL)
+ {
+ ret = GTK_FORM_FIELD_GET_CLASS (field)->get_original_value (field);
+ if (G_VALUE_HOLDS_STRING (ret))
+ {
+ g_value_set_string (ret, g_strstrip (g_strdup (g_value_get_string (ret))));
+ }
+ }
+
+ return ret;
+}
+
/**
* gtk_form_field_clear:
* @field: a #GtkFormField object.
return ret;
}
+/**
+ * gtk_form_field_set_value:
+ * @field: a #GtkFormField object.
+ * @gvalue: a #GValue.
+ *
+ */
+gboolean
+gtk_form_field_set_value (GtkFormField *field, GValue *gvalue)
+{
+ gboolean ret = FALSE;
+
+ GtkFormFieldPrivate *priv = GTK_FORM_FIELD_GET_PRIVATE (field);
+
+ if (IS_GTK_FORM_FIELD (field) && GTK_FORM_FIELD_GET_CLASS (field)->set_value != NULL)
+ {
+ ret = GTK_FORM_FIELD_GET_CLASS (field)->set_value (field, gvalue);
+ }
+
+ return ret;
+}
+
/* PRIVATE */
static void
gtk_form_field_set_property (GObject *object,
gchar *(*get_value_stringify) (GtkFormField *field);
GValue *(*get_value) (GtkFormField *field);
gchar *(*get_value_sql) (GtkFormField *field);
+ GValue *(*get_original_value) (GtkFormField *field);
gboolean (*clear) (GtkFormField *field);
gboolean (*is_empty) (GtkFormField *field);
void (*set_as_origin) (GtkFormField *field);
gboolean (*set_from_datamodel) (GtkFormField *field, GdaDataModel *dm, gint row);
gboolean (*set_from_hashtable) (GtkFormField *field, GHashTable *hashtable);
+ gboolean (*set_value) (GtkFormField *field, GValue *gvalue);
};
GType gtk_form_field_get_type (void) G_GNUC_CONST;
gchar *gtk_form_field_get_value_stringify (GtkFormField *field);
GValue *gtk_form_field_get_value (GtkFormField *field);
gchar *gtk_form_field_get_value_sql (GtkFormField *field);
+GValue *gtk_form_field_get_original_value (GtkFormField *field);
gboolean gtk_form_field_clear (GtkFormField *field);
gboolean gtk_form_field_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, gint row);
gboolean gtk_form_field_set_from_hashtable (GtkFormField *field, GHashTable *hashtable);
+gboolean gtk_form_field_set_value (GtkFormField *field, GValue *gvalue);
G_END_DECLS
field_class->get_value_stringify = gtk_form_field_boolean_get_value_stringify;
field_class->get_value = gtk_form_field_boolean_get_value;
field_class->get_value_sql = gtk_form_field_boolean_get_value_sql;
+ field_class->get_original_value = gtk_form_field_boolean_get_original_value;
field_class->clear = gtk_form_field_boolean_clear;
field_class->is_empty = gtk_form_field_boolean_is_empty;
field_class->is_changed = gtk_form_filed_boolean_is_changed;
field_class->set_as_origin = gtk_form_field_boolean_set_as_origin;
field_class->set_from_datamodel = gtk_form_field_boolean_set_from_datamodel;
field_class->set_from_hashtable = gtk_form_field_boolean_set_from_hashtable;
+ field_class->set_value = gtk_form_field_boolean_set_value;
g_object_class_install_property (object_class, PROP_DEFAULT,
g_param_spec_boolean ("default",
return ret;
}
+/**
+ * gtk_form_field_boolean_get_original_value:
+ * @field: a #GtkFormField object.
+ *
+ */
+GValue
+*gtk_form_field_boolean_get_original_value (GtkFormField *field)
+{
+ GValue *ret;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_BOOLEAN (field), NULL);
+
+ GtkFormFieldBooleanPrivate *priv = GTK_FORM_FIELD_BOOLEAN_GET_PRIVATE (field);
+
+ ret = NULL;
+
+ ret = g_malloc0 (sizeof (GValue));
+ g_value_init (ret, G_TYPE_BOOLEAN);
+ g_value_set_boolean (ret, priv->original_value
+ );
+
+ return ret;
+}
+
/**
* gtk_form_field_boolean_clear:
* @field: a #GtkFormField object.
return ret;
}
+/**
+ * gtk_form_field_boolean_set_value:
+ * @field: a #GtkFormField object.
+ * @gvalue: a #GValue.
+ *
+ */
+gboolean
+gtk_form_field_boolean_set_value (GtkFormField *field, GValue *gvalue)
+{
+ gboolean ret = FALSE;
+ GtkFormFieldBooleanPrivate *priv;
+ gchar *value;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_BOOLEAN (field), FALSE);
+ g_return_val_if_fail (G_VALUE_HOLDS_BOOLEAN (gvalue), FALSE);
+
+ priv = GTK_FORM_FIELD_BOOLEAN_GET_PRIVATE (GTK_FORM_FIELD_BOOLEAN (field));
+
+ priv->original_value = g_value_get_boolean (gvalue);
+ if (priv->original_value)
+ {
+ value = g_strdup_printf ("TRUE");
+ }
+ else
+ {
+ value = g_strdup_printf ("FALSE");
+ }
+ ret = gtk_form_field_boolean_set_value_stringify (field, value);
+
+ return ret;
+}
+
/**
* gtk_form_field_boolean_str_to_boolean:
* @value:
gchar *gtk_form_field_boolean_get_value_stringify (GtkFormField *field);
GValue *gtk_form_field_boolean_get_value (GtkFormField *field);
gchar *gtk_form_field_boolean_get_value_sql (GtkFormField *field);
+GValue *gtk_form_field_boolean_get_original_value (GtkFormField *field);
gboolean gtk_form_field_boolean_clear (GtkFormField *field);
gboolean gtk_form_field_boolean_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, gint row);
gboolean gtk_form_field_boolean_set_from_hashtable (GtkFormField *field, GHashTable *hashtable);
+gboolean gtk_form_field_boolean_set_value (GtkFormField *field, GValue *gvalue);
gboolean gtk_form_field_boolean_str_to_boolean (const gchar *value);
field_class->get_value_stringify = gtk_form_field_datetime_get_value_stringify;
field_class->get_value = gtk_form_field_datetime_get_value;
field_class->get_value_sql = gtk_form_field_datetime_get_value_sql;
+ field_class->get_original_value = gtk_form_field_datetime_get_original_value;
field_class->clear = gtk_form_field_datetime_clear;
field_class->is_empty = gtk_form_field_datetime_is_empty;
field_class->is_changed = gtk_form_field_datetime_is_changed;
field_class->set_as_origin = gtk_form_field_datetime_set_as_origin;
field_class->set_from_datamodel = gtk_form_field_datetime_set_from_datamodel;
field_class->set_from_hashtable = gtk_form_field_datetime_set_from_hashtable;
+ field_class->set_value = gtk_form_field_datetime_set_value;
g_object_class_install_property (object_class, PROP_DEFAULT,
g_param_spec_pointer ("default",
return ret;
}
+/**
+ * gtk_form_field_datetime_get_original_value:
+ * @field: a #GtkFormField object.
+ *
+ * Returns: a #GValue of type G_TYPE_POINTER that point to a struct tm.
+ */
+GValue
+*gtk_form_field_datetime_get_original_value (GtkFormField *field)
+{
+ GValue *ret;
+ GtkFormFieldDateTimePrivate *priv;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_DATETIME (field), NULL);
+
+ priv = GTK_FORM_FIELD_DATETIME_GET_PRIVATE (GTK_FORM_FIELD_DATETIME (field));
+
+ ret = NULL;
+
+ ret = g_malloc0 (sizeof (GValue));
+ g_value_init (ret, G_TYPE_POINTER);
+ g_value_set_pointer (ret, g_memdup (priv->original_value, sizeof (struct tm)));
+
+ return ret;
+}
+
/**
* gtk_form_field_datetime_clear:
* @field: a #GtkFormField object.
return ret;
}
+/**
+ * gtk_form_field_datetime_set_value:
+ * @field: a #GtkFormField object.
+ * @value: a #GValue.
+ *
+ */
+gboolean
+gtk_form_field_datetime_set_value (GtkFormField *field, GValue *gvalue)
+{
+ gboolean ret;
+ GtkFormFieldDateTimePrivate *priv;
+ struct tm *datetime;
+ gchar *value;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_DATETIME (field), FALSE);
+ g_return_val_if_fail (G_VALUE_HOLDS_POINTER (gvalue), FALSE);
+
+ ret = FALSE;
+
+ priv = GTK_FORM_FIELD_DATETIME_GET_PRIVATE (GTK_FORM_FIELD_DATETIME (field));
+
+ datetime = (struct tm *)g_value_get_pointer (gvalue);
+ value = gtk_form_field_datetime_get_str_from_tm (datetime, priv->display_format);
+ ret = gtk_form_field_datetime_set_value_stringify (field, value);
+ priv->original_value = g_memdup (datetime, sizeof (struct tm));
+
+ return ret;
+}
+
/**
* gtk_form_field_datetime_get_tm_from_str:
* @str: the #gchar to be parsed.
gchar *gtk_form_field_datetime_get_value_stringify (GtkFormField *field);
GValue *gtk_form_field_datetime_get_value (GtkFormField *field);
gchar *gtk_form_field_datetime_get_value_sql (GtkFormField *field);
+GValue *gtk_form_field_datetime_get_original_value (GtkFormField *field);
gboolean gtk_form_field_datetime_clear (GtkFormField *field);
gboolean gtk_form_field_datetime_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, gint row);
gboolean gtk_form_field_datetime_set_from_hashtable (GtkFormField *field, GHashTable *hashtable);
+gboolean gtk_form_field_datetime_set_value (GtkFormField *field, GValue *gvalue);
struct tm *gtk_form_field_datetime_get_tm_from_str (const gchar *str, const gchar *format);
gchar *gtk_form_field_datetime_get_str_from_tm (struct tm *datetime, const gchar *format);
field_class->get_value_stringify = gtk_form_field_float_get_value_stringify;
field_class->get_value = gtk_form_field_float_get_value;
field_class->get_value_sql = gtk_form_field_float_get_value_sql;
+ field_class->get_original_value = gtk_form_field_float_get_original_value;
field_class->clear = gtk_form_field_float_clear;
field_class->is_empty = gtk_form_field_float_is_empty;
field_class->is_changed = gtk_form_field_float_is_changed;
field_class->set_as_origin = gtk_form_field_float_set_as_origin;
field_class->set_from_datamodel = gtk_form_field_float_set_from_datamodel;
field_class->set_from_hashtable = gtk_form_field_float_set_from_hashtable;
+ field_class->set_value = gtk_form_field_float_set_value;
g_object_class_install_property (object_class, PROP_DEFAULT,
g_param_spec_float ("default",
return ret;
}
+/**
+ * gtk_form_field_float_get_original_value:
+ * @field: a #GtkFormField object.
+ *
+ */
+GValue
+*gtk_form_field_float_get_original_value (GtkFormField *field)
+{
+ GValue *ret;
+
+ ret = NULL;
+
+ GtkFormFieldFloatPrivate *priv = GTK_FORM_FIELD_FLOAT_GET_PRIVATE (field);
+
+ ret = g_malloc0 (sizeof (GValue));
+ g_value_init (ret, G_TYPE_FLOAT);
+ g_value_set_float (ret, priv->original_value);
+
+ return ret;
+}
+
/**
* gtk_form_field_float_clear:
* @field: a #GtkFormField object.
return ret;
}
+/**
+ * gtk_form_field_float_set_value:
+ * @field: a #GtkFormField object.
+ * @value: a #GValue.
+ *
+ */
+gboolean
+gtk_form_field_float_set_value (GtkFormField *field, GValue *gvalue)
+{
+ gboolean ret = FALSE;
+ GtkFormFieldFloatPrivate *priv;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_FLOAT (field), FALSE);
+ g_return_val_if_fail (G_VALUE_HOLDS_FLOAT (gvalue), FALSE);
+
+ priv = GTK_FORM_FIELD_FLOAT_GET_PRIVATE (GTK_FORM_FIELD_FLOAT (field));
+
+ priv->original_value = g_value_get_float (gvalue);
+ setlocale (LC_NUMERIC, "");
+ ret = gtk_form_field_float_set_value_stringify (field, g_strdup_printf ("%f", priv->original_value));
+
+ return ret;
+}
+
/* PRIVATE */
static void
gtk_form_field_float_set_property (GObject *object,
gchar *gtk_form_field_float_get_value_stringify (GtkFormField *field);
GValue *gtk_form_field_float_get_value (GtkFormField *field);
gchar *gtk_form_field_float_get_value_sql (GtkFormField *field);
+GValue *gtk_form_field_float_get_original_value (GtkFormField *field);
gboolean gtk_form_field_float_clear (GtkFormField *field);
gboolean gtk_form_field_float_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, gint row);
gboolean gtk_form_field_float_set_from_hashtable (GtkFormField *field, GHashTable *hashtable);
+gboolean gtk_form_field_float_set_value (GtkFormField *field, GValue *gvalue);
G_END_DECLS
field_class->get_value_stringify = gtk_form_field_integer_get_value_stringify;
field_class->get_value = gtk_form_field_integer_get_value;
field_class->get_value_sql = gtk_form_field_integer_get_value_sql;
+ field_class->get_original_value = gtk_form_field_integer_get_original_value;
field_class->clear = gtk_form_field_integer_clear;
field_class->is_empty = gtk_form_field_integer_is_empty;
field_class->is_changed = gtk_form_field_integer_is_changed;
field_class->set_as_origin = gtk_form_field_integer_set_as_origin;
field_class->set_from_datamodel = gtk_form_field_integer_set_from_datamodel;
field_class->set_from_hashtable = gtk_form_field_integer_set_from_hashtable;
+ field_class->set_value = gtk_form_field_integer_set_value;
g_object_class_install_property (object_class, PROP_DEFAULT,
g_param_spec_int ("default",
{
ret = g_malloc0 (sizeof (GValue));
g_value_init (ret, G_TYPE_INT);
- g_value_set_int (ret, atol (value));
+ g_value_set_int (ret, strtol (value, NULL, 10));
g_free (value);
}
return gtk_form_field_integer_get_value_stringify (field);
}
+/**
+ * gtk_form_field_integer_get_original_value:
+ * @field: a #GtkFormField object.
+ *
+ */
+GValue
+*gtk_form_field_integer_get_original_value (GtkFormField *field)
+{
+ GValue *ret;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_INTEGER (field), NULL);
+
+ GtkFormFieldIntegerPrivate *priv = GTK_FORM_FIELD_INTEGER_GET_PRIVATE (field);
+
+ ret = NULL;
+
+ ret = g_malloc0 (sizeof (GValue));
+ g_value_init (ret, G_TYPE_INT);
+ g_value_set_int (ret, priv->original_value);
+
+ return ret;
+}
+
/**
* gtk_form_field_integer_clear:
* @field: a #GtkFormField object.
return ret;
}
+/**
+ * gtk_form_field_integer_set_value:
+ * @field: a #GtkFormField object.
+ * @gvalue: a #Gvalue.
+ *
+ */
+gboolean
+gtk_form_field_integer_set_value (GtkFormField *field, GValue *gvalue)
+{
+ gboolean ret = FALSE;
+ GtkFormFieldIntegerPrivate *priv;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_INTEGER (field), FALSE);
+ g_return_val_if_fail (G_VALUE_HOLDS_INT (gvalue), FALSE);
+
+ priv = GTK_FORM_FIELD_INTEGER_GET_PRIVATE (GTK_FORM_FIELD_INTEGER (field));
+
+ priv->original_value = g_value_get_int (gvalue);
+ ret = gtk_form_field_integer_set_value_stringify (field, g_strdup_printf ("%d", priv->original_value));
+
+ return ret;
+}
+
/* PRIVATE */
static void
gtk_form_field_integer_set_property (GObject *object,
gchar *gtk_form_field_integer_get_value_stringify (GtkFormField *field);
GValue *gtk_form_field_integer_get_value (GtkFormField *field);
gchar *gtk_form_field_integer_get_value_sql (GtkFormField *field);
+GValue *gtk_form_field_integer_get_original_value (GtkFormField *field);
gboolean gtk_form_field_integer_clear (GtkFormField *field);
gboolean gtk_form_field_integer_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, gint row);
gboolean gtk_form_field_integer_set_from_hashtable (GtkFormField *field, GHashTable *hashtable);
+gboolean gtk_form_field_integer_set_value (GtkFormField *field, GValue *gvalue);
G_END_DECLS
field_class->get_value_stringify = gtk_form_field_text_get_value_stringify;
field_class->get_value = gtk_form_field_text_get_value;
field_class->get_value_sql = gtk_form_field_text_get_value_sql;
+ field_class->get_original_value = gtk_form_field_text_get_original_value;
field_class->clear = gtk_form_field_text_clear;
field_class->is_empty = gtk_form_field_text_is_empty;
field_class->is_changed = gtk_form_field_text_is_changed;
field_class->set_as_origin = gtk_form_field_text_set_as_origin;
field_class->set_from_datamodel = gtk_form_field_text_set_from_datamodel;
field_class->set_from_hashtable = gtk_form_field_text_set_from_hashtable;
+ field_class->set_value = gtk_form_field_text_set_value;
g_object_class_install_property (object_class, PROP_DEFAULT,
g_param_spec_string ("default",
return ret;
}
+/**
+ * gtk_form_field_text_get_original_value:
+ * @field: a #GtkFormField object.
+ *
+ */
+GValue
+*gtk_form_field_text_get_original_value (GtkFormField *field)
+{
+ GValue *ret;
+
+ GtkFormFieldTextPrivate *priv = GTK_FORM_FIELD_TEXT_GET_PRIVATE (field);
+
+ ret = NULL;
+
+ ret = g_malloc0 (sizeof (GValue));
+ g_value_init (ret, G_TYPE_STRING);
+ g_value_set_string (ret, priv->original_value);
+
+ return ret;
+}
+
/**
* gtk_form_field_text_clear:
* @field: a #GtkFormField object.
return ret;
}
+/**
+ * gtk_form_field_text_set_value:
+ * @field: a #GtkFormField object.
+ * @gvalue: a #GValue.
+ *
+ */
+gboolean
+gtk_form_field_text_set_value (GtkFormField *field, GValue *gvalue)
+{
+ gboolean ret = FALSE;
+ GtkFormFieldTextPrivate *priv;
+
+ g_return_val_if_fail (IS_GTK_FORM_FIELD_TEXT (field), FALSE);
+ g_return_val_if_fail (G_VALUE_HOLDS_STRING (gvalue), FALSE);
+
+ priv = GTK_FORM_FIELD_TEXT_GET_PRIVATE (GTK_FORM_FIELD_TEXT (field));
+
+ ret = gtk_form_field_text_set_value_stringify (field, g_value_get_string (gvalue));
+ priv->original_value = gtk_form_field_text_get_value_stringify (field);
+
+ return ret;
+}
+
/* PRIVATE */
static void
gtk_form_field_text_set_property (GObject *object,
gchar *gtk_form_field_text_get_value_stringify (GtkFormField *field);
GValue *gtk_form_field_text_get_value (GtkFormField *field);
gchar *gtk_form_field_text_get_value_sql (GtkFormField *field);
+GValue *gtk_form_field_text_get_original_value (GtkFormField *field);
gboolean gtk_form_field_text_clear (GtkFormField *field);
gboolean gtk_form_field_text_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, gint row);
gboolean gtk_form_field_text_set_from_hashtable (GtkFormField *field, GHashTable *hashtable);
+gboolean gtk_form_field_text_set_value (GtkFormField *field, GValue *gvalue);
G_END_DECLS
return ret;
}
+/**
+ * gtk_form_reset:
+ * @form:
+ *
+ */
+gboolean
+gtk_form_reset (GtkForm *form)
+{
+ GtkFormPrivate *priv;
+ GSList *fields;
+ gboolean ret = TRUE;
+ GtkFormField *field;
+ GtkFormWidget *widget;
+ GValue *gval;
+
+ g_return_val_if_fail (IS_GTK_FORM (form), FALSE);
+
+ priv = GTK_FORM_GET_PRIVATE (form);
+
+ fields = priv->fields;
+
+ while (fields != NULL)
+ {
+ field = (GtkFormField *)fields->data;
+
+ gval = gtk_form_field_get_original_value (field);
+ gtk_form_field_set_value (field, gval);
+
+ fields = g_slist_next (fields);
+ }
+
+ return ret;
+}
+
/**
* gtk_form_get_values_as_hashtable:
* @form: a #GtkForm object.
return ht;
}
+/**
+ * gtk_form_get_original_values_as_hashtable:
+ * @form:
+ *
+ */
+GHashTable
+*gtk_form_get_original_values_as_hashtable (GtkForm *form)
+{
+ GtkFormPrivate *priv;
+ GSList *fields;
+ GtkFormField *field;
+ gchar *field_name;
+ GValue *gval;
+ GHashTable *ht;
+
+ g_return_val_if_fail (IS_GTK_FORM (form), NULL);
+
+ priv = GTK_FORM_GET_PRIVATE (form);
+
+ fields = priv->fields;
+
+ if (fields != NULL)
+ {
+ ht = g_hash_table_new (g_str_hash, g_str_equal);
+ }
+
+ while (fields != NULL)
+ {
+ field = (GtkFormField *)fields->data;
+
+ field_name = gtk_form_field_get_field_name (field);
+
+ gval = gtk_form_field_get_original_value (field);
+ if (gval != NULL)
+ {
+ /* TODO check if the field already exists */
+ g_hash_table_insert (ht, field_name, gval);
+ }
+
+ fields = g_slist_next (fields);
+ }
+
+ return ht;
+}
+
/**
* gtk_form_fill_from_hashtable:
* @form: a #GtkForm object.
gboolean gtk_form_fill_from_datamodel (GtkForm *form, GdaDataModel *dm, gint row);
gboolean gtk_form_fill_from_table (GtkForm *form);
+gboolean gtk_form_reset (GtkForm *form);
+
GHashTable *gtk_form_get_values_as_hashtable (GtkForm *form);
+GHashTable *gtk_form_get_original_values_as_hashtable (GtkForm *form);
gboolean gtk_form_fill_from_hashtable (GtkForm *form, GHashTable *hashtable);
gboolean gtk_form_add_group (GtkForm *form, GtkFormGroup *group);
/*
- * Copyright (C) 2005-2009 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2005-2010 Andrea Zagli <azagli@libero.it>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
GtkWidget *btn_delete;
GtkWidget *cb_customers;
GtkWidget *btn_open;
+GtkWidget *btn_cancel;
GtkListStore *lstore_customers;
current_id = id;
}
+G_MODULE_EXPORT void
+on_btn_cancel_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ gtk_form_reset (form);
+}
+
void
fill_cb_customers (void)
{
btn_delete = GTK_WIDGET (gtk_builder_get_object (gtkbuilder, "btn_delete"));
cb_customers = GTK_WIDGET (gtk_builder_get_object (gtkbuilder, "cb_customers"));
btn_open = GTK_WIDGET (gtk_builder_get_object (gtkbuilder, "btn_open"));
+ btn_cancel = GTK_WIDGET (gtk_builder_get_object (gtkbuilder, "btn_cancel"));
lstore_customers = GTK_LIST_STORE (gtk_builder_get_object (gtkbuilder, "lstore_customers"));
<property name="position">4</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="btn_cancel">
+ <property name="label">gtk-undo</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_btn_cancel_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>