]> saetta.ns0.it Git - zakform/libzakform/commitdiff
Added property visible to ZakFormElement.
authorAndrea Zagli <azagli@libero.it>
Sun, 22 Nov 2015 15:14:42 +0000 (16:14 +0100)
committerAndrea Zagli <azagli@libero.it>
Sun, 22 Nov 2015 15:14:42 +0000 (16:14 +0100)
docs/notes.txt
src/formelement.c
src/formelement.h

index f111d71dddc399a6d395141ba91962d135c2e4fc..c3ad23da3c931124eceb5ef8b1e01066b09ffd1f 100644 (file)
@@ -15,8 +15,11 @@ ELEMENT
 - implement html and gtk
 - properties:
        - default (OK did it)
+       - is editable
+       - is visible
        - to-load
        - to-save
+       - original value
 - each element must parse own definition from xml
 - each element is bounded to a db field
 - each element could have specifics properties/methods
@@ -29,8 +32,9 @@ ELEMENT VALIDATOR
 - to be transformed from interface to abstract (OK did it)
 
 
-FIELD/DB
+FIELD/DB (LOADERS AND SAVERS)
 - boolean, integer, float, string, datetime
+- load from xml
 
 
 GROUP OF ELEMENTS ???
index 98f2909f5c07cdb48fb95795bd23f762502e574b..06287753888b8570972075656285f93784699fa9 100644 (file)
@@ -26,7 +26,8 @@ enum
 {
        PROP_0,
        PROP_VALUE,
-       PROP_DEFAULT_VALUE
+       PROP_DEFAULT_VALUE,
+       PROP_VISIBLE
 };
 
 static void zak_form_element_class_init (ZakFormElementClass *class);
@@ -54,6 +55,7 @@ typedef struct
        {
                gchar *value;
                gchar *default_value;
+               gboolean visible;
                GPtrArray *pa_filters;
                GPtrArray *pa_validators;
                GPtrArray *pa_messages;
@@ -86,6 +88,13 @@ zak_form_element_class_init (ZakFormElementClass *class)
                                                              "Default value",
                                                              "",
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+       g_object_class_install_property (object_class, PROP_DEFAULT_VALUE,
+                                        g_param_spec_boolean ("visible",
+                                                              "Visible",
+                                                              "Visible",
+                                                              TRUE,
+                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
 }
 
 static void
@@ -223,6 +232,37 @@ gchar
        return g_strdup (priv->default_value);
 }
 
+/**
+ * zak_form_element_set_visible:
+ * @element:
+ * @visible:
+ *
+ */
+void
+zak_form_element_set_visible (ZakFormElement *element, gboolean visible)
+{
+       ZakFormElementPrivate *priv;
+
+       priv = zak_form_element_get_instance_private (element);
+
+       priv->visible = visible;
+}
+
+/**
+ * zak_form_element_get_visible:
+ * @element:
+ *
+ */
+gboolean
+zak_form_element_get_visible (ZakFormElement *element)
+{
+       ZakFormElementPrivate *priv;
+
+       priv = zak_form_element_get_instance_private (element);
+
+       return priv->visible;
+}
+
 /**
  * zak_form_element_clear:
  * @element:
index 4acc22802ed74ea2a5aee91510717d009dd2812b..41b63d0106a743ce2f0a5d22f10eff0745875da2 100644 (file)
@@ -46,6 +46,9 @@ gchar *zak_form_element_get_value (ZakFormElement *element);
 void zak_form_element_set_default_value (ZakFormElement *element, const gchar *value);
 gchar *zak_form_element_get_default_value (ZakFormElement *element);
 
+void zak_form_element_set_visible (ZakFormElement *element, gboolean visible);
+gboolean zak_form_element_get_visible (ZakFormElement *element);
+
 void zak_form_element_clear (ZakFormElement *element);
 
 void zak_form_element_add_filter (ZakFormElement *element, ZakFormElementFilter *filter);