]> saetta.ns0.it Git - zakform/tests/commitdiff
First test of FormElementArray.
authorAndrea Zagli <azagli@libero.it>
Mon, 12 Jun 2017 20:11:40 +0000 (22:11 +0200)
committerAndrea Zagli <azagli@libero.it>
Mon, 12 Jun 2017 20:11:40 +0000 (22:11 +0200)
data/zakformtests/gui/main.ui
data/zakformtests/xml/main.xml
src/gtk_gdaex.c

index 0afde1cbfa8c4b869843921772249d6881990f0c..90ad75198144a7e4c9f10faca3eb1534660f131a 100644 (file)
                 <property name="top_attach">11</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="label12">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Array</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">12</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkCheckButton" id="checkbutton1">
+                    <property name="label" translatable="yes">One</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="checkbutton2">
+                    <property name="label" translatable="yes">Two</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="checkbutton3">
+                    <property name="label" translatable="yes">Three</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="checkbutton4">
+                    <property name="label" translatable="yes">Four</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="checkbutton5">
+                    <property name="label" translatable="yes">Five</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">4</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">12</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
index b53419ccd46a254ee22e46df9b716de2e876fe41..abab397a458a24de147888bf4df8b7835f06a9e0 100644 (file)
@@ -139,6 +139,43 @@ and                                         some            tabs
        <label>label33</label>
   </element>
 
+  <element type="zak_form_element_array">
+       <name>array</name>
+       <type>string</type>
+       <signal-element-added>array_signal_element_added</signal-element-added>
+
+       <element type="zak_form_gtk_form_element_check">
+         <name>one</name>
+         <type>boolean</type>
+         <widget>checkbutton1</widget>
+         <label>label12</label>
+       </element>
+       <element type="zak_form_gtk_form_element_check">
+         <name>two</name>
+         <type>boolean</type>
+         <widget>checkbutton2</widget>
+         <label>label12</label>
+       </element>
+       <element type="zak_form_gtk_form_element_check">
+         <name>three</name>
+         <type>boolean</type>
+         <widget>checkbutton3</widget>
+         <label>label12</label>
+       </element>
+       <element type="zak_form_gtk_form_element_check">
+         <name>four</name>
+         <type>boolean</type>
+         <widget>checkbutton4</widget>
+         <label>label12</label>
+       </element>
+       <element type="zak_form_gtk_form_element_check">
+         <name>five</name>
+         <type>boolean</type>
+         <widget>checkbutton5</widget>
+         <label>label12</label>
+       </element>
+  </element>
+
   <validator type="zak_form_validator_compare_date" type_comp="lt" element1="date_from" format1="%d/%m/%Y" element2="date_to" format2="%d/%m/%Y"></validator>
 
   <validator type="zak_form_validator_composite">
index 0a03dd38c2cc992527673a572a7a6f47206e5361..9590623b1a2f1c9d5230763bcd9957d8ba49b13f 100644 (file)
@@ -30,6 +30,8 @@ GtkWidget *textview;
 ZakFormGtkForm *form;
 ZakFormGdaexProvider *provider;
 
+GtkBuilder *builder;
+
 void
 load_clicked (GtkButton *button,
               gpointer   user_data)
@@ -92,11 +94,15 @@ is_changed_clicked (GtkButton *button,
                }
 }
 
+G_MODULE_EXPORT void
+array_signal_element_added (gpointer instance, GObject *element_added, gpointer user_data)
+{
+       zak_form_gtk_form_element_set_gtkbuilder ((ZakFormGtkFormElement *)element_added, builder);
+}
+
 int
 main (int argc, char *argv[])
 {
-       GtkBuilder *builder;
-
        GdaEx *gdaex;
 
        gtk_init (&argc, &argv);