]> saetta.ns0.it Git - zakform/libzakform/commitdiff
Added member function ZakFormForm::element_added.
authorAndrea Zagli <azagli@libero.it>
Thu, 26 Nov 2015 19:57:30 +0000 (20:57 +0100)
committerAndrea Zagli <azagli@libero.it>
Thu, 26 Nov 2015 19:57:30 +0000 (20:57 +0100)
src/form.c
src/form.h
src/formelement.c

index 7fe02ffd4f7007610b504b5177896804124d4134..71bbfc578f08a6f2a322c7096df5f78511f87c60 100644 (file)
@@ -377,6 +377,11 @@ zak_form_form_add_element (ZakFormForm *zakform, ZakFormElement *element)
        g_ptr_array_add (priv->ar_elements, g_object_ref (element));
        ret = TRUE;
 
+       if (ZAK_FORM_FORM_GET_CLASS (zakform)->element_added != NULL)
+               {
+                       ZAK_FORM_FORM_GET_CLASS (zakform)->element_added (zakform, element);
+               }
+
        return ret;
 }
 
index 0bb4bdc2b80953f08ef0ccd75172c5faabde5b92..e1b3ef70f208cafdb4cbbbaba073c8d102679c22 100644 (file)
@@ -38,6 +38,8 @@ struct _ZakFormFormClass
        GObjectClass parent_class;
 
        GPtrArray *(*get_elements) (ZakFormForm *zakform);
+
+       void (*element_added) (ZakFormForm *zakform, ZakFormElement *element);
 };
 
 
index acf47095076d08c28b6ade3b53f0e4a84d693aa3..855c5df94f2d1cc2f61bf419db2cec3e4677c6f9 100644 (file)
@@ -84,7 +84,7 @@ zak_form_element_class_init (ZakFormElementClass *class)
                                                              "Value",
                                                              "Value",
                                                              "",
-                                                             G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+                                                             G_PARAM_READWRITE));
 
        g_object_class_install_property (object_class, PROP_DEFAULT_VALUE,
                                         g_param_spec_string ("default-value",
@@ -105,14 +105,14 @@ zak_form_element_class_init (ZakFormElementClass *class)
                                                               "Visible",
                                                               "Visible",
                                                               TRUE,
-                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+                                                              G_PARAM_READWRITE));
 
        g_object_class_install_property (object_class, PROP_EDITABLE,
                                         g_param_spec_boolean ("editable",
                                                               "Editable",
                                                               "Editable",
                                                               TRUE,
-                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+                                                              G_PARAM_READWRITE));
 }
 
 static void
@@ -120,6 +120,9 @@ zak_form_element_init (ZakFormElement *zak_form_element)
 {
        ZakFormElementPrivate *priv = zak_form_element_get_instance_private (zak_form_element);
 
+       priv->value = g_strdup ("");
+       priv->visible = TRUE;
+       priv->editable = TRUE;
        priv->pa_filters = NULL;
        priv->pa_validators = NULL;
        priv->pa_messages = NULL;