</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">6</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">6</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">7</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">7</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">8</property>
</packing>
</child>
<child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">ID to load</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
</object>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkButtonBox" id="buttonbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">5</property>
+ <property name="layout_style">start</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label" translatable="yes">Select</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="textview1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
</child>
<?xml version="1.0"?>
<zakform>
+ <element type="zak_form_gtk_form_element_entry">
+ <name>id</name>
+ <type>integer</type>
+ <is-key>TRUE</is-key>
+ <to-load>FALSE</to-load>
+ <to-save>FALSE</to-save>
+ <widget>entry1</widget>
+ <label>label2</label>
+ </element>
+
<element type="zak_form_gtk_form_element_label">
+ <name>id</name>
+ <type>integer</type>
<default-value>999</default-value>
<widget>lbl_id</widget>
<label>label8</label>
</element>
<element type="zak_form_gtk_form_element_entry">
+ <name>name</name>
+ <type>string</type>
<default-value>John Doe</default-value>
<widget>txt_name</widget>
<label>label1</label>
</element>
<element type="zak_form_gtk_form_element_spin">
+ <name>age</name>
+ <type>integer</type>
<default-value>33</default-value>
<widget>spn_age</widget>
<label>label4</label>
</element>
<element type="zak_form_gtk_form_element_check">
+ <name>married</name>
+ <type>boolean</type>
<default-value>TRUE</default-value>
<widget>chk_married</widget>
<label>label9</label>
</element>
<element type="zak_form_gtk_form_element_textview">
+ <name>description</name>
+ <type>string</type>
<default-value>dafault value for textview
with line break
and some tabs
</element>
<element type="zak_form_gtk_form_element_entry">
+ <name>birthday</name>
+ <type>datetime</type>
<widget>txt_birthday</widget>
<label>label11</label>
</element>
<element type="zak_form_gtk_form_element_radio">
+ <name>sex</name>
+ <type>string</type>
<default-value>M</default-value>
<widget>rbtnNone</widget>
<label>label3</label>
</element>
<element type="zak_form_gtk_form_element_radio">
+ <name>sex</name>
+ <type>string</type>
<default-value>M</default-value>
<widget>rbtnMale</widget>
<label>label3</label>
</element>
<element type="zak_form_gtk_form_element_radio">
+ <name>sex</name>
+ <type>string</type>
<default-value>M</default-value>
<widget>rbtnFemale</widget>
<label>label3</label>
</element>
<element type="zak_form_gtk_form_element_entry">
+ <name>income</name>
+ <type>float</type>
<widget>txt_income</widget>
<label>label5</label>
</element>
#include <libzakformgtk/libzakformgtk.h>
#include <libzakformgdaex/libzakformgdaex.h>
+ZakFormGtkForm *form;
+ZakFormGdaexProvider *provider;
+
+void
+select_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ zak_form_form_load (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (provider));
+}
+
int
main (int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *w;
- ZakFormGtkForm *form;
+ GdaEx *gdaex;
gtk_init (&argc, &argv);
g_signal_connect (w, "delete-event",
gtk_main_quit, NULL);
+ g_signal_connect (gtk_builder_get_object (builder, "button1"), "clicked",
+ G_CALLBACK (select_clicked), NULL);
+
form = zak_form_gtk_form_new ();
zak_form_gtk_form_set_gtkbuilder (form, builder);
zak_form_form_load_from_file (ZAK_FORM_FORM (form), XMLDIR "/main.xml");
zak_form_form_clear (ZAK_FORM_FORM (form));
+ gdaex = gdaex_new_from_string ("SQLite://DB_DIR=" DBDIR ";DB_NAME=main.db;");
+ provider = zak_form_gdaex_provider_new (gdaex, "clients");
+
gtk_widget_show_all (w);
gtk_main ();