<field type="text" name="cap" />
</widget>
- <widget type="entry" name="entry16">
- <field type="text" name="provincia">
- <to-load>f</to-load>
- <to-save>f</to-save>
- </field>
- </widget>
-
- <widget type="label" name="label38" label="label37">
- <on-change what="update" when="after">
- <widget-name>entry16</widget-name>
- <sql>
- SELECT nome FROM province WHERE id = ##label38::gint
- </sql>
- </on-change>
- <field type="integer" name="id_province">
- <obligatory>t</obligatory>
- </field>
- </widget>
-
<widget type="checkbox" name="checkbutton2" label="label52">
<field type="boolean" name="capoluogo" />
</widget>
<field type="text" name="sigla" />
</widget>
- <widget type="entry" name="entry15">
- <field type="text" name="regione">
- <to-load>f</to-load>
- <to-save>f</to-save>
- </field>
- </widget>
-
- <widget type="label" name="label36" label="label35">
- <on-change what="update" when="after">
- <widget-name>entry15</widget-name>
- <sql>
- SELECT nome FROM regioni WHERE id = ##label36::gint
- </sql>
- </on-change>
- <field type="integer" name="id_regioni">
- <obligatory>t</obligatory>
- </field>
- </widget>
-
</gtkform>
</field>
</widget>
- <widget type="entry" name="entry22">
- <field type="text" name="provincia">
- </field>
- </widget>
-
- <widget type="label" name="label48" label="label47">
- <on-change what="update" when="after">
- <widget-name>entry22</widget-name>
- <sql>
- SELECT nome FROM province WHERE id = ##label48::gint
- </sql>
- </on-change>
- <field type="integer" name="id_province" />
- </widget>
-
</gtkform>
</field>
</widget>
- <widget type="entry" name="entry23">
- <field type="text" name="regione">
- </field>
- </widget>
-
- <widget type="label" name="label60" label="label59">
- <on-change what="update" when="after">
- <widget-name>entry23</widget-name>
- <sql>
- SELECT nome FROM regioni WHERE id = ##label60::gint
- </sql>
- </on-change>
- <field type="integer" name="id_regioni" />
- </widget>
-
</gtkform>
</field>
</widget>
- <widget type="entry" name="entry25">
- <field type="text" name="comune">
- </field>
- </widget>
-
- <widget type="label" name="label51" label="label50">
- <on-change what="update" when="after">
- <widget-name>entry25</widget-name>
- <sql>
- SELECT nome FROM comuni WHERE id = ##label51::gint
- </sql>
- </on-change>
- <field type="integer" name="id_comuni" />
- </widget>
-
</gtkform>
<field type="text" name="cap" />
</widget>
- <widget type="entry" name="entry20">
- <field type="text" name="comune">
- <to-load>f</to-load>
- <to-save>f</to-save>
- </field>
- </widget>
-
- <widget type="label" name="label46" label="label45">
- <on-change what="update" when="after">
- <widget-name>entry20</widget-name>
- <sql>
- SELECT nome FROM comuni WHERE id = ##label46::gint
- </sql>
- </on-change>
- <field type="integer" name="id_comuni">
- <obligatory>t</obligatory>
- </field>
- </widget>
-
</gtkform>
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <object class="GtkEntry" id="entry15">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button43">
- <property name="label" translatable="yes">...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label36">
- <property name="label" translatable="yes">lbl_id_regioni</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
+ <placeholder/>
</child>
</object>
<packing>
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <object class="GtkEntry" id="entry16">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button44">
- <property name="label" translatable="yes">...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label38">
- <property name="label" translatable="yes">lbl_id_province</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
+ <placeholder/>
</child>
</object>
<packing>
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <object class="GtkEntry" id="entry20">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button50">
- <property name="label" translatable="yes">...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label46">
- <property name="label" translatable="yes">lbl_id_comuni</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
+ <placeholder/>
</child>
</object>
<packing>
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <object class="GtkEntry" id="entry23">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button69">
- <property name="label" translatable="yes">...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label60">
- <property name="label" translatable="yes">lbl_id_regioni</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
+ <placeholder/>
</child>
</object>
<packing>
<child>
<object class="GtkTable" id="table8">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<object class="GtkLabel" id="label47">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Provincia</property>
+ <property name="label" translatable="yes">Regione</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <object class="GtkEntry" id="entry22">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button54">
- <property name="label" translatable="yes">...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label48">
- <property name="label" translatable="yes">lbl_id_province</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
+ <placeholder/>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label46">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Provincia</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table10">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<object class="GtkLabel" id="label50">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Comune</property>
+ <property name="label" translatable="yes">Regione</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <object class="GtkEntry" id="entry25">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button59">
- <property name="label" translatable="yes">...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label51">
- <property name="label" translatable="yes">lbl_id_comuni</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
+ <placeholder/>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label36">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Provincia</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label38">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Comune</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
AM_CPPFLAGS = $(TERRITORIO_CFLAGS) \
-DGUIDIR=\""$(guidir)"\" \
- -DFORMDIR=\""$(formdir)"\"
+ -DFORMDIR=\""$(formdir)"\" \
+ -DG_LOG_DOMAIN=\"Territorio\"
LIBS = $(TERRITORIO_LIBS) \
-export-dynamic
#include <libautoz/autoz.h>
#include "comune.h"
-#include "province.h"
+#include "widget.h"
static void territorio_comune_class_init (TerritorioComuneClass *klass);
static void territorio_comune_init (TerritorioComune *territorio_comune);
GValue *value,
GParamSpec *pspec);
-static void territorio_comune_on_provincia_selezionato (gpointer instance, guint id, gpointer user_data);
-
static gboolean territorio_comune_on_w_comune_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
-static void territorio_comune_on_btn_provincia_clicked (GtkButton *button,
- gpointer user_data);
-
static void territorio_comune_on_btn_annulla_clicked (GtkButton *button,
gpointer user_data);
static void territorio_comune_on_btn_salva_clicked (GtkButton *button,
{
GError *error;
AutozIResource *ires1;
+ GtkWidget *twidget;
TerritorioComune *a = TERRITORIO_COMUNE (g_object_new (territorio_comune_get_type (), NULL));
"label22",
NULL);
+ twidget = territorio_widget_new (priv->commons);
+ g_object_set (G_OBJECT (twidget),
+ "show-stato", FALSE,
+ "show-regione", FALSE,
+ "show-provincia-label", FALSE,
+ "show-provincia-clean", FALSE,
+ "show-comune", FALSE,
+ "show-via", FALSE,
+ NULL);
+
+ territorio_widget_add_to_gtkform (TERRITORIO_WIDGET (twidget), priv->form,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE,
+ "id_province",
+ TRUE,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE);
+
+ gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "hbox2")),
+ twidget, TRUE, TRUE, 0);
+ gtk_widget_show_all (twidget);
+
g_signal_connect (priv->w,
"delete-event", G_CALLBACK (territorio_comune_on_w_comune_delete_event), (gpointer *)a);
- g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button44"),
- "clicked", G_CALLBACK (territorio_comune_on_btn_provincia_clicked), (gpointer *)a);
-
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button27"),
"clicked", G_CALLBACK (territorio_comune_on_btn_annulla_clicked), (gpointer *)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button28"),
}
/* CALLBACK */
-static void
-territorio_comune_on_provincia_selezionato (gpointer instance, guint id, gpointer user_data)
-{
- TerritorioComune *f = (TerritorioComune *)user_data;
- TerritorioComunePrivate *priv = TERRITORIO_COMUNE_GET_PRIVATE (f);
-
- gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label38"), g_strdup_printf ("%d", id));
-}
-
static gboolean
territorio_comune_on_w_comune_delete_event (GtkWidget *widget,
GdkEvent *event,
return !territorio_comune_conferma_chiusura ((TerritorioComune *)user_data);
}
-static void
-territorio_comune_on_btn_provincia_clicked (GtkButton *button,
- gpointer user_data)
-{
- GtkWidget *w;
-
- TerritorioComune *rf = (TerritorioComune *)user_data;
-
- TerritorioComunePrivate *priv = TERRITORIO_COMUNE_GET_PRIVATE (rf);
-
- TerritorioProvince *c = territorio_province_new (priv->commons, TRUE);
-
- g_signal_connect (G_OBJECT (c), "selezionato",
- G_CALLBACK (territorio_comune_on_provincia_selezionato), user_data);
-
- w = territorio_province_get_widget (c);
- gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
- gtk_widget_show (w);
-}
-
static void
territorio_comune_on_btn_annulla_clicked (GtkButton *button,
gpointer user_data)
"%'",
NULL);
}
+ ival = g_value_get_int ((GValue *)g_hash_table_lookup (priv->parametri_ricerca, "id_regioni"));
+ if (ival > 0)
+ {
+ sql_where = g_strconcat (sql_where, " AND p.id_regioni = ",
+ g_strdup_printf ("%d", ival),
+ NULL);
+ }
}
ival = 0;
#include <libautoz/autoz.h>
#include "provincia.h"
-#include "regioni.h"
+#include "widget.h"
static void territorio_provincia_class_init (TerritorioProvinciaClass *klass);
static void territorio_provincia_init (TerritorioProvincia *territorio_provincia);
GValue *value,
GParamSpec *pspec);
-static void territorio_provincia_on_regione_selezionato (gpointer instance, guint id, gpointer user_data);
-
static gboolean territorio_provincia_on_w_provincia_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
-static void territorio_provincia_on_btn_regione_clicked (GtkButton *button,
- gpointer user_data);
-
static void territorio_provincia_on_btn_annulla_clicked (GtkButton *button,
gpointer user_data);
static void territorio_provincia_on_btn_salva_clicked (GtkButton *button,
{
GError *error;
AutozIResource *ires1;
+ GtkWidget *twidget;
TerritorioProvincia *a = TERRITORIO_PROVINCIA (g_object_new (territorio_provincia_get_type (), NULL));
"label16",
NULL);
+ twidget = territorio_widget_new (priv->commons);
+ g_object_set (G_OBJECT (twidget),
+ "show-stato", FALSE,
+ "show-regione-label", FALSE,
+ "show-regione-clean", FALSE,
+ "show-provincia", FALSE,
+ "show-comune", FALSE,
+ "show-via", FALSE,
+ NULL);
+
+ territorio_widget_add_to_gtkform (TERRITORIO_WIDGET (twidget), priv->form,
+ NULL,
+ FALSE,
+ "id_regioni",
+ TRUE,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE);
+
+ gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "hbox1")),
+ twidget, TRUE, TRUE, 0);
+ gtk_widget_show_all (twidget);
+
g_signal_connect (priv->w,
"delete-event", G_CALLBACK (territorio_provincia_on_w_provincia_delete_event), (gpointer *)a);
- g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button43"),
- "clicked", G_CALLBACK (territorio_provincia_on_btn_regione_clicked), (gpointer *)a);
-
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button20"),
"clicked", G_CALLBACK (territorio_provincia_on_btn_annulla_clicked), (gpointer *)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button21"),
}
/* CALLBACK */
-static void
-territorio_provincia_on_regione_selezionato (gpointer instance, guint id, gpointer user_data)
-{
- TerritorioProvincia *f = (TerritorioProvincia *)user_data;
- TerritorioProvinciaPrivate *priv = TERRITORIO_PROVINCIA_GET_PRIVATE (f);
-
- gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label36"), g_strdup_printf ("%d", id));
-}
-
static gboolean
territorio_provincia_on_w_provincia_delete_event (GtkWidget *widget,
GdkEvent *event,
return !territorio_provincia_conferma_chiusura ((TerritorioProvincia *)user_data);
}
-static void
-territorio_provincia_on_btn_regione_clicked (GtkButton *button,
- gpointer user_data)
-{
- GtkWidget *w;
-
- TerritorioProvincia *rf = (TerritorioProvincia *)user_data;
-
- TerritorioProvinciaPrivate *priv = TERRITORIO_PROVINCIA_GET_PRIVATE (rf);
-
- TerritorioRegioni *c = territorio_regioni_new (priv->commons, TRUE);
-
- g_signal_connect (G_OBJECT (c), "selezionato",
- G_CALLBACK (territorio_provincia_on_regione_selezionato), user_data);
-
- w = territorio_regioni_get_widget (c);
- gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
- gtk_widget_show (w);
-}
-
static void
territorio_provincia_on_btn_annulla_clicked (GtkButton *button,
gpointer user_data)
#include <libgtkform/form.h>
#include "ricercacomuni.h"
-#include "province.h"
+#include "widget.h"
static void territorio_ricerca_comuni_class_init (TerritorioRicercaComuniClass *klass);
static void territorio_ricerca_comuni_init (TerritorioRicercaComuni *territorio_ricerca_comuni);
GValue *value,
GParamSpec *pspec);
-static void territorio_ricerca_comuni_on_provincia_selezionato (gpointer instance, guint id, gpointer user_data);
-
-static void territorio_ricerca_comuni_on_btn_provincia_clicked (GtkButton *button,
- gpointer user_data);
-
static void territorio_ricerca_comuni_on_btn_pulisci_clicked (GtkButton *button,
gpointer user_data);
static void territorio_ricerca_comuni_on_btn_annulla_clicked (GtkButton *button,
TerritorioRicercaComuni
*territorio_ricerca_comuni_new (TerritorioCommons *commons, GHashTable *values)
{
+ GtkWidget *twidget;
GError *error;
TerritorioRicercaComuni *a = TERRITORIO_RICERCA_COMUNI (g_object_new (territorio_ricerca_comuni_get_type (), NULL));
g_object_set (G_OBJECT (priv->form), "gdaex", priv->commons->gdaex, NULL);
gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "ricerca_comuni.form", NULL), priv->commons->gtkbuilder);
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ricerca_comuni"));
+
priv->objects = gtk_form_get_objects_by_name (priv->form,
NULL);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ricerca_comuni"));
-
- g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button54"),
- "clicked", G_CALLBACK (territorio_ricerca_comuni_on_btn_provincia_clicked), (gpointer *)a);
+ twidget = territorio_widget_new (priv->commons);
+ g_object_set (G_OBJECT (twidget),
+ "show-stato", FALSE,
+ "show-regione-label", FALSE,
+ "show-provincia-label", FALSE,
+ "show-comune", FALSE,
+ "show-via", FALSE,
+ NULL);
+
+ territorio_widget_add_to_gtkform (TERRITORIO_WIDGET (twidget), priv->form,
+ NULL,
+ FALSE,
+ "id_regioni",
+ FALSE,
+ "id_province",
+ FALSE,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE);
+
+ gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "hbox4")),
+ twidget, TRUE, TRUE, 0);
+ gtk_widget_show_all (twidget);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button55"),
"clicked", G_CALLBACK (territorio_ricerca_comuni_on_btn_pulisci_clicked), (gpointer *)a);
}
/* CALLBACK */
-static void
-territorio_ricerca_comuni_on_regione_selezionato (gpointer instance, guint id, gpointer user_data)
-{
- TerritorioRicercaComuni *f = (TerritorioRicercaComuni *)user_data;
- TerritorioRicercaComuniPrivate *priv = TERRITORIO_RICERCA_COMUNI_GET_PRIVATE (f);
-
- gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label48"), g_strdup_printf ("%d", id));
-}
-
-static void
-territorio_ricerca_comuni_on_btn_provincia_clicked (GtkButton *button,
- gpointer user_data)
-{
- GtkWidget *w;
-
- TerritorioRicercaComuni *rf = (TerritorioRicercaComuni *)user_data;
-
- TerritorioRicercaComuniPrivate *priv = TERRITORIO_RICERCA_COMUNI_GET_PRIVATE (rf);
-
- TerritorioProvince *c = territorio_province_new (priv->commons, TRUE);
-
- g_signal_connect (G_OBJECT (c), "selezionato",
- G_CALLBACK (territorio_ricerca_comuni_on_regione_selezionato), user_data);
-
- w = territorio_province_get_widget (c);
- gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
- gtk_widget_show (w);
-}
-
static void
territorio_ricerca_comuni_on_btn_pulisci_clicked (GtkButton *button,
gpointer user_data)
/*
- * Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <libgtkform/form.h>
#include "ricercaprovince.h"
-#include "regioni.h"
+#include "widget.h"
static void territorio_ricerca_province_class_init (TerritorioRicercaProvinceClass *klass);
static void territorio_ricerca_province_init (TerritorioRicercaProvince *territorio_ricerca_province);
GValue *value,
GParamSpec *pspec);
-static void territorio_ricerca_province_on_regione_selezionato (gpointer instance, guint id, gpointer user_data);
-
-static void territorio_ricerca_province_on_btn_regione_clicked (GtkButton *button,
- gpointer user_data);
-
static void territorio_ricerca_province_on_btn_pulisci_clicked (GtkButton *button,
gpointer user_data);
static void territorio_ricerca_province_on_btn_annulla_clicked (GtkButton *button,
TerritorioRicercaProvince
*territorio_ricerca_province_new (TerritorioCommons *commons, GHashTable *values)
{
+ GtkWidget *twidget;
GError *error;
TerritorioRicercaProvince *a = TERRITORIO_RICERCA_PROVINCE (g_object_new (territorio_ricerca_province_get_type (), NULL));
g_object_set (G_OBJECT (priv->form), "gdaex", priv->commons->gdaex, NULL);
gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "ricerca_province.form", NULL), priv->commons->gtkbuilder);
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ricerca_province"));
+
priv->objects = gtk_form_get_objects_by_name (priv->form,
NULL);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ricerca_province"));
-
- g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button69"),
- "clicked", G_CALLBACK (territorio_ricerca_province_on_btn_regione_clicked), (gpointer *)a);
+ twidget = territorio_widget_new (priv->commons);
+ g_object_set (G_OBJECT (twidget),
+ "show-stato", FALSE,
+ "show-regione-label", FALSE,
+ "show-provincia", FALSE,
+ "show-comune", FALSE,
+ "show-via", FALSE,
+ NULL);
+
+ territorio_widget_add_to_gtkform (TERRITORIO_WIDGET (twidget), priv->form,
+ NULL,
+ FALSE,
+ "id_regioni",
+ FALSE,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE);
+
+ gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "hbox10")),
+ twidget, TRUE, TRUE, 0);
+ gtk_widget_show_all (twidget);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button70"),
"clicked", G_CALLBACK (territorio_ricerca_province_on_btn_pulisci_clicked), (gpointer *)a);
}
/* CALLBACK */
-static void
-territorio_ricerca_province_on_regione_selezionato (gpointer instance, guint id, gpointer user_data)
-{
- TerritorioRicercaProvince *f = (TerritorioRicercaProvince *)user_data;
- TerritorioRicercaProvincePrivate *priv = TERRITORIO_RICERCA_PROVINCE_GET_PRIVATE (f);
-
- gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label60"), g_strdup_printf ("%d", id));
-}
-
-static void
-territorio_ricerca_province_on_btn_regione_clicked (GtkButton *button,
- gpointer user_data)
-{
- GtkWidget *w;
-
- TerritorioRicercaProvince *rf = (TerritorioRicercaProvince *)user_data;
-
- TerritorioRicercaProvincePrivate *priv = TERRITORIO_RICERCA_PROVINCE_GET_PRIVATE (rf);
-
- TerritorioRegioni *c = territorio_regioni_new (priv->commons, TRUE);
-
- g_signal_connect (G_OBJECT (c), "selezionato",
- G_CALLBACK (territorio_ricerca_province_on_regione_selezionato), user_data);
-
- w = territorio_regioni_get_widget (c);
- gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
- gtk_widget_show (w);
-}
-
static void
territorio_ricerca_province_on_btn_pulisci_clicked (GtkButton *button,
gpointer user_data)
#include <libgtkform/form.h>
#include "ricercavie.h"
-#include "comuni.h"
+#include "widget.h"
static void territorio_ricerca_vie_class_init (TerritorioRicercaVieClass *klass);
static void territorio_ricerca_vie_init (TerritorioRicercaVie *territorio_ricerca_vie);
GValue *value,
GParamSpec *pspec);
-static void territorio_ricerca_vie_on_comune_selezionato (gpointer instance, guint id, gpointer user_data);
-
-static void territorio_ricerca_vie_on_btn_comune_clicked (GtkButton *button,
- gpointer user_data);
-
static void territorio_ricerca_vie_on_btn_pulisci_clicked (GtkButton *button,
gpointer user_data);
static void territorio_ricerca_vie_on_btn_annulla_clicked (GtkButton *button,
*territorio_ricerca_vie_new (TerritorioCommons *commons, GHashTable *values)
{
GError *error;
+ GtkWidget *twidget;
TerritorioRicercaVie *a = TERRITORIO_RICERCA_VIE (g_object_new (territorio_ricerca_vie_get_type (), NULL));
g_object_set (G_OBJECT (priv->form), "gdaex", priv->commons->gdaex, NULL);
gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "ricerca_vie.form", NULL), priv->commons->gtkbuilder);
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ricerca_vie"));
+
priv->objects = gtk_form_get_objects_by_name (priv->form,
NULL);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ricerca_vie"));
-
- g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button59"),
- "clicked", G_CALLBACK (territorio_ricerca_vie_on_btn_comune_clicked), (gpointer *)a);
+ twidget = territorio_widget_new (priv->commons);
+ g_object_set (G_OBJECT (twidget),
+ "show-stato", FALSE,
+ "show-regione-label", FALSE,
+ "show-provincia-label", FALSE,
+ "show-comune-label", FALSE,
+ "show-via", FALSE,
+ NULL);
+
+ territorio_widget_add_to_gtkform (TERRITORIO_WIDGET (twidget), priv->form,
+ NULL,
+ FALSE,
+ "id_regioni",
+ FALSE,
+ "id_province",
+ FALSE,
+ "id_comuni",
+ FALSE,
+ NULL,
+ FALSE);
+
+ gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "hbox5")),
+ twidget, TRUE, TRUE, 0);
+ gtk_widget_show_all (twidget);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button60"),
"clicked", G_CALLBACK (territorio_ricerca_vie_on_btn_pulisci_clicked), (gpointer *)a);
territorio_ricerca_vie_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
TerritorioRicercaVie *territorio_ricerca_vie = TERRITORIO_RICERCA_VIE (object);
-
TerritorioRicercaViePrivate *priv = TERRITORIO_RICERCA_VIE_GET_PRIVATE (territorio_ricerca_vie);
switch (property_id)
territorio_ricerca_vie_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
TerritorioRicercaVie *territorio_ricerca_vie = TERRITORIO_RICERCA_VIE (object);
-
TerritorioRicercaViePrivate *priv = TERRITORIO_RICERCA_VIE_GET_PRIVATE (territorio_ricerca_vie);
switch (property_id)
}
/* CALLBACK */
-static void
-territorio_ricerca_vie_on_comune_selezionato (gpointer instance, guint id, gpointer user_data)
-{
- TerritorioRicercaVie *f = (TerritorioRicercaVie *)user_data;
- TerritorioRicercaViePrivate *priv = TERRITORIO_RICERCA_VIE_GET_PRIVATE (f);
-
- gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label51"), g_strdup_printf ("%d", id));
-}
-
-static void
-territorio_ricerca_vie_on_btn_comune_clicked (GtkButton *button,
- gpointer user_data)
-{
- GtkWidget *w;
-
- TerritorioRicercaVie *rf = (TerritorioRicercaVie *)user_data;
-
- TerritorioRicercaViePrivate *priv = TERRITORIO_RICERCA_VIE_GET_PRIVATE (rf);
-
- TerritorioComuni *c = territorio_comuni_new (priv->commons, TRUE);
-
- g_signal_connect (G_OBJECT (c), "selezionato",
- G_CALLBACK (territorio_ricerca_vie_on_comune_selezionato), user_data);
-
- w = territorio_comuni_get_widget (c);
- gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
- gtk_widget_show (w);
-}
-
static void
territorio_ricerca_vie_on_btn_pulisci_clicked (GtkButton *button,
gpointer user_data)
#include <libautoz/autoz.h>
#include "via.h"
-#include "comuni.h"
+#include "widget.h"
static void territorio_via_class_init (TerritorioViaClass *klass);
static void territorio_via_init (TerritorioVia *territorio_via);
{
GError *error;
AutozIResource *ires1;
+ GtkWidget *twidget;
TerritorioVia *a = TERRITORIO_VIA (g_object_new (territorio_via_get_type (), NULL));
"label41",
NULL);
+ twidget = territorio_widget_new (priv->commons);
+ g_object_set (G_OBJECT (twidget),
+ "show-stato", FALSE,
+ "show-regione", FALSE,
+ "show-provincia", FALSE,
+ "show-comune-label", FALSE,
+ "show-comune-clean", FALSE,
+ "show-via", FALSE,
+ NULL);
+
+ territorio_widget_add_to_gtkform (TERRITORIO_WIDGET (twidget), priv->form,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE,
+ NULL,
+ FALSE,
+ "id_comuni",
+ TRUE,
+ NULL,
+ FALSE);
+
+ gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "hbox3")),
+ twidget, TRUE, TRUE, 0);
+ gtk_widget_show_all (twidget);
+
g_signal_connect (priv->w,
"delete-event", G_CALLBACK (territorio_via_on_w_via_delete_event), (gpointer *)a);
- g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button50"),
- "clicked", G_CALLBACK (territorio_via_on_btn_comune_clicked), (gpointer *)a);
-
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button51"),
"clicked", G_CALLBACK (territorio_via_on_btn_annulla_clicked), (gpointer *)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button52"),
}
/* CALLBACK */
-static void
-territorio_via_on_comune_selezionato (gpointer instance, guint id, gpointer user_data)
-{
- TerritorioVia *f = (TerritorioVia *)user_data;
- TerritorioViaPrivate *priv = TERRITORIO_VIA_GET_PRIVATE (f);
-
- gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label46"), g_strdup_printf ("%d", id));
-}
-
static gboolean
territorio_via_on_w_via_delete_event (GtkWidget *widget,
GdkEvent *event,
return !territorio_via_conferma_chiusura ((TerritorioVia *)user_data);
}
-static void
-territorio_via_on_btn_comune_clicked (GtkButton *button,
- gpointer user_data)
-{
- GtkWidget *w;
-
- TerritorioVia *rf = (TerritorioVia *)user_data;
-
- TerritorioViaPrivate *priv = TERRITORIO_VIA_GET_PRIVATE (rf);
-
- TerritorioComuni *c = territorio_comuni_new (priv->commons, TRUE);
-
- g_signal_connect (G_OBJECT (c), "selezionato",
- G_CALLBACK (territorio_via_on_comune_selezionato), user_data);
-
- w = territorio_comuni_get_widget (c);
- gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
- gtk_widget_show (w);
-}
-
static void
territorio_via_on_btn_annulla_clicked (GtkButton *button,
gpointer user_data)
"%'",
NULL);
}
+ ival = g_value_get_int ((GValue *)g_hash_table_lookup (priv->parametri_ricerca, "id_regioni"));
+ if (ival > 0)
+ {
+ sql_where = g_strconcat (sql_where, " AND p.id_regioni = ",
+ g_strdup_printf ("%d", ival),
+ NULL);
+ }
+ ival = g_value_get_int ((GValue *)g_hash_table_lookup (priv->parametri_ricerca, "id_province"));
+ if (ival > 0)
+ {
+ sql_where = g_strconcat (sql_where, " AND c.id_province = ",
+ g_strdup_printf ("%d", ival),
+ NULL);
+ }
}
ival = 0;
*
*/
-#include <libgtkform/form.h>
+#include <libgtkform/fieldinteger.h>
#include <libgtkformui/gtkformdecoder.h>
+#include <libgtkformui/gtkformwidgetdecoder.h>
#include "widget.h"
#include "stati.h"
{
PROP_0,
PROP_SHOW_STATO,
+ PROP_SHOW_STATO_LABEL,
PROP_SHOW_STATO_CLEAN,
PROP_SHOW_STATO_OPEN,
PROP_SHOW_STATO_BROWSE,
PROP_SHOW_REGIONE,
+ PROP_SHOW_REGIONE_LABEL,
PROP_SHOW_REGIONE_CLEAN,
PROP_SHOW_REGIONE_OPEN,
PROP_SHOW_REGIONE_BROWSE,
PROP_SHOW_PROVINCIA,
+ PROP_SHOW_PROVINCIA_LABEL,
PROP_SHOW_PROVINCIA_CLEAN,
PROP_SHOW_PROVINCIA_OPEN,
PROP_SHOW_PROVINCIA_BROWSE,
PROP_SHOW_COMUNE,
+ PROP_SHOW_COMUNE_LABEL,
PROP_SHOW_COMUNE_CLEAN,
PROP_SHOW_COMUNE_OPEN,
PROP_SHOW_COMUNE_BROWSE,
PROP_SHOW_VIA,
+ PROP_SHOW_VIA_LABEL,
PROP_SHOW_VIA_CLEAN,
PROP_SHOW_VIA_OPEN,
PROP_SHOW_VIA_BROWSE
TRUE,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_STATO_LABEL,
+ g_param_spec_boolean ("show-stato-label",
+ "Visualizza etichetta stato",
+ "Se l'etichetta dello stato è visibile",
+ TRUE,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (object_class, PROP_SHOW_STATO_CLEAN,
g_param_spec_boolean ("show-stato-clean",
"Visualizza pulitura stato",
TRUE,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_REGIONE_LABEL,
+ g_param_spec_boolean ("show-regione-label",
+ "Visualizza etichetta regione",
+ "Se l'etichetta della regione è visibile",
+ TRUE,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (object_class, PROP_SHOW_REGIONE_CLEAN,
g_param_spec_boolean ("show-regione-clean",
"Visualizza pulitura regione",
TRUE,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_PROVINCIA_LABEL,
+ g_param_spec_boolean ("show-provincia-label",
+ "Visualizza etichetta provincia",
+ "Se l'etichetta della provincia è visibile",
+ TRUE,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (object_class, PROP_SHOW_PROVINCIA,
g_param_spec_boolean ("show-provincia",
"Visualizza scelta provincia",
TRUE,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_COMUNE_LABEL,
+ g_param_spec_boolean ("show-comune-label",
+ "Visualizza etichetta comune",
+ "Se l'etichetta del comune è visibile",
+ TRUE,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (object_class, PROP_SHOW_COMUNE_CLEAN,
g_param_spec_boolean ("show-comune-clean",
"Visualizza pulitura comune",
TRUE,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_SHOW_VIA_LABEL,
+ g_param_spec_boolean ("show-via-label",
+ "Visualizza etichetta via",
+ "Se l'etichetta della via è visibile",
+ TRUE,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (object_class, PROP_SHOW_VIA_CLEAN,
g_param_spec_boolean ("show-via-clean",
"Visualizza pulitura via",
return priv->transient;
}
+void
+territorio_widget_add_to_gtkform (TerritorioWidget *widget,
+ GtkForm *form,
+ const gchar *stato_field,
+ gboolean stato_obligatory,
+ const gchar *regione_field,
+ gboolean regione_obligatory,
+ const gchar *provincia_field,
+ gboolean provincia_obligatory,
+ const gchar *comune_field,
+ gboolean comune_obligatory,
+ const gchar *via_field,
+ gboolean via_obligatory)
+{
+ TerritorioWidgetPrivate *priv;
+
+ GtkFormWidget *fwidget;
+ GtkFormField *fint;
+
+ g_return_if_fail (IS_TERRITORIO_WIDGET (widget));
+ g_return_if_fail (IS_GTK_FORM (form));
+
+ priv = TERRITORIO_WIDGET_GET_PRIVATE (widget);
+
+ if (gtk_widget_get_visible (priv->dec_stato) && stato_field != NULL)
+ {
+ gchar *_stato_field = g_strstrip (g_strdup (stato_field));
+ g_return_if_fail (g_strcmp0 (_stato_field, "") != 0);
+
+ fwidget = gtk_form_widget_decoder_new ();
+ g_object_set (G_OBJECT (fwidget),
+ "widget", priv->dec_stato,
+ "label", priv->lbl_stato,
+ NULL);
+ fint = gtk_form_field_integer_new ();
+ g_object_set (G_OBJECT (fint),
+ "field", _stato_field,
+ "form-widget", fwidget,
+ "obligatory", stato_obligatory,
+ NULL);
+ gtk_form_add_field (form, fint);
+
+ g_free (_stato_field);
+ }
+
+ if (gtk_widget_get_visible (priv->dec_regione) && regione_field != NULL)
+ {
+ gchar *_regione_field = g_strstrip (g_strdup (regione_field));
+ g_return_if_fail (g_strcmp0 (_regione_field, "") != 0);
+
+ fwidget = gtk_form_widget_decoder_new ();
+ g_object_set (G_OBJECT (fwidget),
+ "widget", priv->dec_regione,
+ "label", priv->lbl_regione,
+ NULL);
+ fint = gtk_form_field_integer_new ();
+ g_object_set (G_OBJECT (fint),
+ "field", _regione_field,
+ "form-widget", fwidget,
+ "obligatory", regione_obligatory,
+ NULL);
+ gtk_form_add_field (form, fint);
+
+ g_free (_regione_field);
+ }
+
+ if (gtk_widget_get_visible (priv->dec_provincia) && provincia_field != NULL)
+ {
+ gchar *_provincia_field = g_strstrip (g_strdup (provincia_field));
+ g_return_if_fail (g_strcmp0 (_provincia_field, "") != 0);
+
+ fwidget = gtk_form_widget_decoder_new ();
+ g_object_set (G_OBJECT (fwidget),
+ "widget", priv->dec_provincia,
+ "label", priv->lbl_provincia,
+ NULL);
+ fint = gtk_form_field_integer_new ();
+ g_object_set (G_OBJECT (fint),
+ "field", _provincia_field,
+ "form-widget", fwidget,
+ "obligatory", provincia_obligatory,
+ NULL);
+ gtk_form_add_field (form, fint);
+
+ g_free (_provincia_field);
+ }
+
+ if (gtk_widget_get_visible (priv->dec_comune) && comune_field != NULL)
+ {
+ gchar *_comune_field = g_strstrip (g_strdup (comune_field));
+ g_return_if_fail (g_strcmp0 (_comune_field, "") != 0);
+
+ fwidget = gtk_form_widget_decoder_new ();
+ g_object_set (G_OBJECT (fwidget),
+ "widget", priv->dec_comune,
+ "label", priv->lbl_comune,
+ NULL);
+ fint = gtk_form_field_integer_new ();
+ g_object_set (G_OBJECT (fint),
+ "field", _comune_field,
+ "form-widget", fwidget,
+ "obligatory", comune_obligatory,
+ NULL);
+ gtk_form_add_field (form, fint);
+
+ g_free (_comune_field);
+ }
+
+ if (gtk_widget_get_visible (priv->dec_via) && via_field != NULL)
+ {
+ gchar *_via_field = g_strstrip (g_strdup (via_field));
+ g_return_if_fail (g_strcmp0 (_via_field, "") != 0);
+
+ fwidget = gtk_form_widget_decoder_new ();
+ g_object_set (G_OBJECT (fwidget),
+ "widget", priv->dec_via,
+ "label", priv->lbl_via,
+ NULL);
+ fint = gtk_form_field_integer_new ();
+ g_object_set (G_OBJECT (fint),
+ "field", _via_field,
+ "form-widget", fwidget,
+ "obligatory", via_obligatory,
+ NULL);
+ gtk_form_add_field (form, fint);
+
+ g_free (_via_field);
+ }
+}
+
/* PRIVATE */
static void
territorio_widget_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
case PROP_SHOW_STATO:
gtk_widget_set_visible (priv->lbl_stato, g_value_get_boolean (value));
gtk_widget_set_visible (priv->dec_stato, g_value_get_boolean (value));
+ gtk_table_set_row_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 0, g_value_get_boolean (value) ? 5 : 0);
+ break;
+
+ case PROP_SHOW_STATO_LABEL:
+ gtk_widget_set_visible (priv->lbl_stato, g_value_get_boolean (value));
+ gtk_table_set_col_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 0, g_value_get_boolean (value) ? 5 : 0);
break;
case PROP_SHOW_STATO_CLEAN:
case PROP_SHOW_REGIONE:
gtk_widget_set_visible (priv->lbl_regione, g_value_get_boolean (value));
gtk_widget_set_visible (priv->dec_regione, g_value_get_boolean (value));
+ gtk_table_set_row_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 1, g_value_get_boolean (value) ? 5 : 0);
+ break;
+
+ case PROP_SHOW_REGIONE_LABEL:
+ gtk_widget_set_visible (priv->lbl_regione, g_value_get_boolean (value));
+ gtk_table_set_col_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 0, g_value_get_boolean (value) ? 5 : 0);
break;
case PROP_SHOW_REGIONE_CLEAN:
case PROP_SHOW_PROVINCIA:
gtk_widget_set_visible (priv->lbl_provincia, g_value_get_boolean (value));
gtk_widget_set_visible (priv->dec_provincia, g_value_get_boolean (value));
+ gtk_table_set_row_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 2, g_value_get_boolean (value) ? 5 : 0);
+ break;
+
+ case PROP_SHOW_PROVINCIA_LABEL:
+ gtk_widget_set_visible (priv->lbl_provincia, g_value_get_boolean (value));
+ gtk_table_set_col_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 0, g_value_get_boolean (value) ? 5 : 0);
break;
case PROP_SHOW_PROVINCIA_CLEAN:
case PROP_SHOW_COMUNE:
gtk_widget_set_visible (priv->lbl_comune, g_value_get_boolean (value));
gtk_widget_set_visible (priv->dec_comune, g_value_get_boolean (value));
+ gtk_table_set_row_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 3, g_value_get_boolean (value) ? 5 : 0);
+ break;
+
+ case PROP_SHOW_COMUNE_LABEL:
+ gtk_widget_set_visible (priv->lbl_comune, g_value_get_boolean (value));
+ gtk_table_set_col_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 0, g_value_get_boolean (value) ? 5 : 0);
break;
case PROP_SHOW_COMUNE_CLEAN:
case PROP_SHOW_VIA:
gtk_widget_set_visible (priv->lbl_via, g_value_get_boolean (value));
gtk_widget_set_visible (priv->dec_via, g_value_get_boolean (value));
+ gtk_table_set_row_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 4, g_value_get_boolean (value) ? 5 : 0);
+ break;
+
+ case PROP_SHOW_VIA_LABEL:
+ gtk_widget_set_visible (priv->lbl_via, g_value_get_boolean (value));
+ gtk_table_set_col_spacing (GTK_TABLE (gtk_builder_get_object (priv->commons->gtkbuilder, "table11")),
+ 0, g_value_get_boolean (value) ? 5 : 0);
break;
case PROP_SHOW_VIA_CLEAN:
g_value_set_boolean (value, gtk_widget_get_visible (priv->dec_stato));
break;
+ case PROP_SHOW_STATO_LABEL:
+ g_value_set_boolean (value, gtk_widget_get_visible (priv->lbl_stato));
+ break;
+
case PROP_SHOW_STATO_CLEAN:
g_value_set_boolean (value, gtk_form_decoder_btn_clean_is_visible (GTK_FORM_DECODER (priv->dec_stato)));
break;
g_value_set_boolean (value, gtk_widget_get_visible (priv->dec_regione));
break;
+ case PROP_SHOW_REGIONE_LABEL:
+ g_value_set_boolean (value, gtk_widget_get_visible (priv->lbl_regione));
+ break;
+
case PROP_SHOW_REGIONE_CLEAN:
g_value_set_boolean (value, gtk_form_decoder_btn_clean_is_visible (GTK_FORM_DECODER (priv->dec_regione)));
break;
g_value_set_boolean (value, gtk_widget_get_visible (priv->dec_provincia));
break;
+ case PROP_SHOW_PROVINCIA_LABEL:
+ g_value_set_boolean (value, gtk_widget_get_visible (priv->lbl_provincia));
+ break;
+
case PROP_SHOW_PROVINCIA_CLEAN:
g_value_set_boolean (value, gtk_form_decoder_btn_clean_is_visible (GTK_FORM_DECODER (priv->dec_provincia)));
break;
g_value_set_boolean (value, gtk_widget_get_visible (priv->dec_comune));
break;
+ case PROP_SHOW_COMUNE_LABEL:
+ g_value_set_boolean (value, gtk_widget_get_visible (priv->lbl_comune));
+ break;
+
case PROP_SHOW_COMUNE_CLEAN:
g_value_set_boolean (value, gtk_form_decoder_btn_clean_is_visible (GTK_FORM_DECODER (priv->dec_comune)));
break;
g_value_set_boolean (value, gtk_widget_get_visible (priv->dec_via));
break;
+ case PROP_SHOW_VIA_LABEL:
+ g_value_set_boolean (value, gtk_widget_get_visible (priv->lbl_via));
+ break;
+
case PROP_SHOW_VIA_CLEAN:
g_value_set_boolean (value, gtk_form_decoder_btn_clean_is_visible (GTK_FORM_DECODER (priv->dec_via)));
break;
#include <gtk/gtk.h>
+#include <libgtkform/form.h>
+
#include "commons.h"
G_BEGIN_DECLS
GtkWidget *territorio_widget_new (TerritorioCommons *commons);
+GtkWidget *territorio_widget_get_widget (TerritorioWidget *widget);
+
+void territorio_widget_add_to_gtkform (TerritorioWidget *widget,
+ GtkForm *form,
+ const gchar *stato_field,
+ gboolean stato_obligatory,
+ const gchar *regione_field,
+ gboolean regione_obligatory,
+ const gchar *provincia_field,
+ gboolean provincia_obligatory,
+ const gchar *comune_field,
+ gboolean comune_obligatory,
+ const gchar *via_field,
+ gboolean via_obligatory);
+
G_END_DECLS