From 969b96504f6bb33e3d84a04cf99942774ee08fe2 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sun, 1 Aug 2010 12:05:31 +0200 Subject: [PATCH] Added and managed tag trim to GtkFormField. Updated gtk-doc. Updated it.po. --- configure.ac | 2 +- data/gtkform.dtd | 3 +- docs/reference/libgtkform-docs.sgml | 4 +- docs/reference/libgtkform-sections.txt | 157 ++++++++-- docs/reference/libgtkform-undeclared.txt | 3 - docs/reference/libgtkform-undocumented.txt | 53 +++- docs/reference/libgtkform-unused.txt | 99 ------- docs/reference/libgtkform.args | 24 +- docs/reference/libgtkform.hierarchy | 1 + docs/reference/libgtkform.types | 2 +- docs/reference/tmpl/field.sgml | 84 ++++++ docs/reference/tmpl/fieldboolean.sgml | 43 +++ docs/reference/tmpl/fielddatetime.sgml | 72 +++++ docs/reference/tmpl/fieldfloat.sgml | 34 +++ docs/reference/tmpl/fieldinteger.sgml | 34 +++ docs/reference/tmpl/fieldtext.sgml | 34 +++ docs/reference/tmpl/form.sgml | 328 +++++++++++++++++++++ docs/reference/tmpl/group.sgml | 164 +++++++++++ docs/reference/tmpl/key.sgml | 7 + docs/reference/tmpl/widget.sgml | 62 ++++ docs/reference/tmpl/widgetcheck.sgml | 7 + docs/reference/tmpl/widgetcombobox.sgml | 28 ++ docs/reference/tmpl/widgetentry.sgml | 7 + docs/reference/tmpl/widgetlabel.sgml | 7 + docs/reference/tmpl/widgetradio.sgml | 151 ++++++++++ docs/reference/tmpl/widgetspin.sgml | 7 + docs/reference/tmpl/widgettextview.sgml | 7 + po/it.po | 65 +++- src/field.c | 33 ++- src/fieldtext.c | 24 +- src/form.c | 6 + 31 files changed, 1399 insertions(+), 153 deletions(-) create mode 100644 docs/reference/tmpl/group.sgml create mode 100644 docs/reference/tmpl/widgetradio.sgml diff --git a/configure.ac b/configure.ac index f9198e7..8815ef9 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([libgtkform], [0.1.3], [azagli@libero.it]) +AC_INIT([libgtkform], [0.1.4], [azagli@libero.it]) AC_CONFIG_SRCDIR([src/form.c]) AC_CONFIG_HEADER([config.h]) diff --git a/data/gtkform.dtd b/data/gtkform.dtd index 3fe147f..157e82e 100644 --- a/data/gtkform.dtd +++ b/data/gtkform.dtd @@ -31,7 +31,7 @@ - + + diff --git a/docs/reference/libgtkform-docs.sgml b/docs/reference/libgtkform-docs.sgml index adbad4d..e794210 100644 --- a/docs/reference/libgtkform-docs.sgml +++ b/docs/reference/libgtkform-docs.sgml @@ -8,7 +8,7 @@ libgtkform Reference Manual - for libgtkform [VERSION] + for libgtkform [VERSION]. The latest version of this documentation can be found on-line at http://[SERVER]/libgtkform/. @@ -18,6 +18,7 @@ [Insert title here] + @@ -30,6 +31,7 @@ + diff --git a/docs/reference/libgtkform-sections.txt b/docs/reference/libgtkform-sections.txt index dfbd617..4e24d68 100644 --- a/docs/reference/libgtkform-sections.txt +++ b/docs/reference/libgtkform-sections.txt @@ -1,13 +1,14 @@
widgetspin +GtkFormWidgetSpin TYPE_GTK_FORM_WIDGET_SPIN GTK_FORM_WIDGET_SPIN GTK_FORM_WIDGET_SPIN_CLASS IS_GTK_FORM_WIDGET_SPIN IS_GTK_FORM_WIDGET_SPIN_CLASS GTK_FORM_WIDGET_SPIN_GET_CLASS -GtkFormWidgetSpin GtkFormWidgetSpin +GtkFormWidgetSpinClass gtk_form_widget_spin_get_type gtk_form_widget_spin_new gtk_form_widget_spin_get_value_stringify @@ -17,14 +18,15 @@ gtk_form_widget_spin_set_editable
widgetcheck +GtkFormWidgetCheck TYPE_GTK_FORM_WIDGET_CHECK GTK_FORM_WIDGET_CHECK GTK_FORM_WIDGET_CHECK_CLASS IS_GTK_FORM_WIDGET_CHECK IS_GTK_FORM_WIDGET_CHECK_CLASS GTK_FORM_WIDGET_CHECK_GET_CLASS -GtkFormWidgetCheck GtkFormWidgetCheck +GtkFormWidgetCheckClass gtk_form_widget_check_get_type gtk_form_widget_check_new gtk_form_widget_check_get_value_stringify @@ -32,16 +34,38 @@ gtk_form_widget_check_set_value_stringify gtk_form_widget_check_set_editable
+
+group +GtkFormGroup +TYPE_GTK_FORM_GROUP +GTK_FORM_GROUP +GTK_FORM_GROUP_CLASS +IS_GTK_FORM_GROUP +IS_GTK_FORM_GROUP_CLASS +GTK_FORM_GROUP_GET_CLASS +GtkFormGroup +GtkFormGroupClass +gtk_form_group_get_type +gtk_form_group_new +gtk_form_group_get_name +gtk_form_group_add_widget +gtk_form_group_add_field +gtk_form_group_clear +gtk_form_group_set_from_datamodel +gtk_form_group_set_from_hashtable +
+
fieldboolean +GtkFormFieldBoolean TYPE_GTK_FORM_FIELD_BOOLEAN GTK_FORM_FIELD_BOOLEAN GTK_FORM_FIELD_BOOLEAN_CLASS IS_GTK_FORM_FIELD_BOOLEAN IS_GTK_FORM_FIELD_BOOLEAN_CLASS GTK_FORM_FIELD_BOOLEAN_GET_CLASS -GtkFormFieldBoolean GtkFormFieldBoolean +GtkFormFieldBooleanClass gtk_form_field_boolean_get_type gtk_form_field_boolean_new gtk_form_field_boolean_get_value_stringify @@ -49,39 +73,51 @@ gtk_form_field_boolean_get_value gtk_form_field_boolean_get_value_sql gtk_form_field_boolean_clear gtk_form_field_boolean_is_empty +gtk_form_filed_boolean_is_changed +gtk_form_field_boolean_set_as_origin gtk_form_field_boolean_set_from_datamodel +gtk_form_field_boolean_set_from_hashtable +gtk_form_field_boolean_str_to_boolean
widget +GtkFormWidget TYPE_GTK_FORM_WIDGET GTK_FORM_WIDGET GTK_FORM_WIDGET_CLASS IS_GTK_FORM_WIDGET IS_GTK_FORM_WIDGET_CLASS GTK_FORM_WIDGET_GET_CLASS -GtkFormWidget GtkFormWidget +GtkFormWidgetClass gtk_form_widget_get_type gtk_form_widget_new gtk_form_widget_set_from_gtkbuilder gtk_form_widget_get_widget gtk_form_widget_get_widget_name +gtk_form_widget_get_label +gtk_form_widget_set_label gtk_form_widget_get_value_stringify gtk_form_widget_set_value_stringify gtk_form_widget_set_editable +gtk_form_widget_set_visible +GtkFormWidgetOnChangeOpType +GtkFormWidgetOnChangeOpUpdateWhen +gtk_form_widget_add_on_change_op
fieldtext +GtkFormFieldText TYPE_GTK_FORM_FIELD_TEXT GTK_FORM_FIELD_TEXT GTK_FORM_FIELD_TEXT_CLASS IS_GTK_FORM_FIELD_TEXT IS_GTK_FORM_FIELD_TEXT_CLASS GTK_FORM_FIELD_TEXT_GET_CLASS -GtkFormFieldText GtkFormFieldText +GtkFormFieldTextClass gtk_form_field_text_get_type gtk_form_field_text_new gtk_form_field_text_get_value_stringify @@ -89,19 +125,23 @@ gtk_form_field_text_get_value gtk_form_field_text_get_value_sql gtk_form_field_text_clear gtk_form_field_text_is_empty +gtk_form_field_text_is_changed +gtk_form_field_text_set_as_origin gtk_form_field_text_set_from_datamodel +gtk_form_field_text_set_from_hashtable
fielddatetime +GtkFormFieldDateTime TYPE_GTK_FORM_FIELD_DATETIME GTK_FORM_FIELD_DATETIME GTK_FORM_FIELD_DATETIME_CLASS IS_GTK_FORM_FIELD_DATETIME IS_GTK_FORM_FIELD_DATETIME_CLASS GTK_FORM_FIELD_DATETIME_GET_CLASS -GtkFormFieldDateTime GtkFormFieldDateTime +GtkFormFieldDateTimeClass gtk_form_field_datetime_get_type gtk_form_field_datetime_new gtk_form_field_datetime_get_value_stringify @@ -109,19 +149,27 @@ gtk_form_field_datetime_get_value gtk_form_field_datetime_get_value_sql gtk_form_field_datetime_clear gtk_form_field_datetime_is_empty +gtk_form_field_datetime_is_changed +gtk_form_field_datetime_set_as_origin gtk_form_field_datetime_set_from_datamodel +gtk_form_field_datetime_set_from_hashtable +gtk_form_field_datetime_get_tm_from_str +gtk_form_field_datetime_get_str_from_tm +gtk_form_field_datetime_get_gdate_from_tm +gtk_form_field_datetime_get_now
widgetlabel +GtkFormWidgetLabel TYPE_GTK_FORM_WIDGET_LABEL GTK_FORM_WIDGET_LABEL GTK_FORM_WIDGET_LABEL_CLASS IS_GTK_FORM_WIDGET_LABEL IS_GTK_FORM_WIDGET_LABEL_CLASS GTK_FORM_WIDGET_LABEL_GET_CLASS -GtkFormWidgetLabel GtkFormWidgetLabel +GtkFormWidgetLabelClass gtk_form_widget_label_get_type gtk_form_widget_label_new gtk_form_widget_label_get_value_stringify @@ -130,14 +178,15 @@ gtk_form_widget_label_set_value_stringify
fieldfloat +GtkFormFieldFloat TYPE_GTK_FORM_FIELD_FLOAT GTK_FORM_FIELD_FLOAT GTK_FORM_FIELD_FLOAT_CLASS IS_GTK_FORM_FIELD_FLOAT IS_GTK_FORM_FIELD_FLOAT_CLASS GTK_FORM_FIELD_FLOAT_GET_CLASS -GtkFormFieldFloat GtkFormFieldFloat +GtkFormFieldFloatClass gtk_form_field_float_get_type gtk_form_field_float_new gtk_form_field_float_get_value_stringify @@ -145,19 +194,23 @@ gtk_form_field_float_get_value gtk_form_field_float_get_value_sql gtk_form_field_float_clear gtk_form_field_float_is_empty +gtk_form_field_float_is_changed +gtk_form_field_float_set_as_origin gtk_form_field_float_set_from_datamodel +gtk_form_field_float_set_from_hashtable
key +GtkFormKey TYPE_GTK_FORM_KEY GTK_FORM_KEY GTK_FORM_KEY_CLASS IS_GTK_FORM_KEY IS_GTK_FORM_KEY_CLASS GTK_FORM_KEY_GET_CLASS -GtkFormKey GtkFormKey +GtkFormKeyClass gtk_form_key_get_type gtk_form_key_new gtk_form_key_add_field @@ -170,14 +223,15 @@ gtk_form_key_field_is_key
widgettextview +GtkFormWidgetTextview TYPE_GTK_FORM_WIDGET_TEXTVIEW GTK_FORM_WIDGET_TEXTVIEW GTK_FORM_WIDGET_TEXTVIEW_CLASS IS_GTK_FORM_WIDGET_TEXTVIEW IS_GTK_FORM_WIDGET_TEXTVIEW_CLASS GTK_FORM_WIDGET_TEXTVIEW_GET_CLASS -GtkFormWidgetTextview GtkFormWidgetTextview +GtkFormWidgetTextviewClass gtk_form_widget_textview_get_type gtk_form_widget_textview_new gtk_form_widget_textview_get_value_stringify @@ -187,80 +241,123 @@ gtk_form_widget_textview_set_editable
field +GtkFormField TYPE_GTK_FORM_FIELD GTK_FORM_FIELD GTK_FORM_FIELD_CLASS IS_GTK_FORM_FIELD IS_GTK_FORM_FIELD_CLASS GTK_FORM_FIELD_GET_CLASS -GtkFormField GtkFormField +GtkFormFieldClass gtk_form_field_get_type gtk_form_field_new gtk_form_field_new_from_gtk_form_widget gtk_form_field_get_field_name -gtk_form_field_get_gtk_form_widget +gtk_form_field_get_form_widget gtk_form_field_get_value_stringify gtk_form_field_get_value gtk_form_field_get_value_sql gtk_form_field_clear +gtk_form_field_is_to_load +gtk_form_field_is_to_save +gtk_form_field_is_auto_increment gtk_form_field_is_empty +gtk_form_field_is_changed +gtk_form_field_set_as_origin gtk_form_field_set_from_datamodel +gtk_form_field_set_from_hashtable
form +GtkForm TYPE_GTK_FORM GTK_FORM GTK_FORM_CLASS IS_GTK_FORM IS_GTK_FORM_CLASS GTK_FORM_GET_CLASS -GtkForm GtkForm +GtkFormClass gtk_form_get_type gtk_form_new +gtk_form_new_from_xml +gtk_form_new_from_file +gtk_form_load_from_xml +gtk_form_load_from_file +gtk_form_get_gtkbuilder +gtk_form_get_table +gtk_form_set_table +gtk_form_get_key +gtk_form_set_key gtk_form_add_field gtk_form_remove_field gtk_form_add_fields -gtk_form_get_field_from_name -gtk_form_get_widget_from_name +gtk_form_get_form_field_from_name +gtk_form_get_form_widget_from_name +gtk_form_get_widget_from_form_field_name +gtk_form_get_widget_from_form_widget_name +gtk_form_get_form_field_from_widget +gtk_form_get_form_widget_from_widget +gtk_form_get_widgets +gtk_form_get_objects_by_name gtk_form_clear gtk_form_check +gtk_form_is_changed +gtk_form_set_as_origin gtk_form_set_sensitive +gtk_form_set_sensitive_by_name gtk_form_set_editable +gtk_form_set_visible_by_name +gtk_form_set_form_widget_visible_by_name +gtk_form_get_form_field_value_by_name +gtk_form_get_form_widget_value_by_name +gtk_form_get_form_field_value_stringify_by_name +gtk_form_get_form_widget_value_stringify_by_name +gtk_form_get_form_field_value_sql_by_name +gtk_form_get_form_widget_value_sql_by_name GtkFormSqlType gtk_form_get_sql gtk_form_fill_from_datamodel +gtk_form_fill_from_table +gtk_form_get_values_as_hashtable +gtk_form_fill_from_hashtable +gtk_form_add_group +gtk_form_get_group_by_name
widgetcombobox +GtkFormWidgetComboBox TYPE_GTK_FORM_WIDGET_COMBO_BOX GTK_FORM_WIDGET_COMBO_BOX GTK_FORM_WIDGET_COMBO_BOX_CLASS IS_GTK_FORM_WIDGET_COMBO_BOX IS_GTK_FORM_WIDGET_COMBO_BOX_CLASS GTK_FORM_WIDGET_COMBO_BOX_GET_CLASS -GtkFormWidgetComboBox GtkFormWidgetComboBox +GtkFormWidgetComboBoxClass gtk_form_widget_combo_box_get_type gtk_form_widget_combo_box_new gtk_form_widget_combo_box_get_value_stringify gtk_form_widget_combo_box_set_value_stringify gtk_form_widget_combo_box_set_editable +gtk_form_widget_combo_box_fill_from_datamodel +gtk_form_widget_combo_box_fill_from_sql
widgetentry +GtkFormWidgetEntry TYPE_GTK_FORM_WIDGET_ENTRY GTK_FORM_WIDGET_ENTRY GTK_FORM_WIDGET_ENTRY_CLASS IS_GTK_FORM_WIDGET_ENTRY IS_GTK_FORM_WIDGET_ENTRY_CLASS GTK_FORM_WIDGET_ENTRY_GET_CLASS -GtkFormWidgetEntry GtkFormWidgetEntry +GtkFormWidgetEntryClass gtk_form_widget_entry_get_type gtk_form_widget_entry_new gtk_form_widget_entry_get_value_stringify @@ -268,16 +365,37 @@ gtk_form_widget_entry_set_value_stringify gtk_form_widget_entry_set_editable
+
+widgetradio +GtkFormWidgetRadio +TYPE_GTK_FORM_WIDGET_RADIO +GTK_FORM_WIDGET_RADIO +GTK_FORM_WIDGET_RADIO_CLASS +IS_GTK_FORM_WIDGET_RADIO +IS_GTK_FORM_WIDGET_RADIO_CLASS +GTK_FORM_WIDGET_RADIO_GET_CLASS +GtkFormWidgetRadio +GtkFormWidgetRadioClass +gtk_form_widget_radio_get_type +gtk_form_widget_radio_new +gtk_form_widget_radio_get_value_stringify +gtk_form_widget_radio_set_value_stringify +gtk_form_widget_radio_set_editable +gtk_form_widget_radio_set_return_value +gtk_form_widget_radio_get_return_value +
+
fieldinteger +GtkFormFieldInteger TYPE_GTK_FORM_FIELD_INTEGER GTK_FORM_FIELD_INTEGER GTK_FORM_FIELD_INTEGER_CLASS IS_GTK_FORM_FIELD_INTEGER IS_GTK_FORM_FIELD_INTEGER_CLASS GTK_FORM_FIELD_INTEGER_GET_CLASS -GtkFormFieldInteger GtkFormFieldInteger +GtkFormFieldIntegerClass gtk_form_field_integer_get_type gtk_form_field_integer_new gtk_form_field_integer_get_value_stringify @@ -285,6 +403,9 @@ gtk_form_field_integer_get_value gtk_form_field_integer_get_value_sql gtk_form_field_integer_clear gtk_form_field_integer_is_empty +gtk_form_field_integer_is_changed +gtk_form_field_integer_set_as_origin gtk_form_field_integer_set_from_datamodel +gtk_form_field_integer_set_from_hashtable
diff --git a/docs/reference/libgtkform-undeclared.txt b/docs/reference/libgtkform-undeclared.txt index fe0d0b1..e69de29 100644 --- a/docs/reference/libgtkform-undeclared.txt +++ b/docs/reference/libgtkform-undeclared.txt @@ -1,3 +0,0 @@ -gtk_form_field_get_gtk_form_widget -gtk_form_get_field_from_name -gtk_form_get_widget_from_name diff --git a/docs/reference/libgtkform-undocumented.txt b/docs/reference/libgtkform-undocumented.txt index 48f1965..7f87570 100644 --- a/docs/reference/libgtkform-undocumented.txt +++ b/docs/reference/libgtkform-undocumented.txt @@ -1,7 +1,7 @@ 8% symbol docs coverage. -28 symbols documented. -2 symbols incomplete. -321 not documented. +31 symbols documented. +22 symbols incomplete. +359 not documented. GTK_FORM @@ -25,6 +25,9 @@ GTK_FORM_FIELD_TEXT GTK_FORM_FIELD_TEXT_CLASS GTK_FORM_FIELD_TEXT_GET_CLASS GTK_FORM_GET_CLASS +GTK_FORM_GROUP +GTK_FORM_GROUP_CLASS +GTK_FORM_GROUP_GET_CLASS GTK_FORM_KEY GTK_FORM_KEY_CLASS GTK_FORM_KEY_GET_CLASS @@ -43,6 +46,9 @@ GTK_FORM_WIDGET_GET_CLASS GTK_FORM_WIDGET_LABEL GTK_FORM_WIDGET_LABEL_CLASS GTK_FORM_WIDGET_LABEL_GET_CLASS +GTK_FORM_WIDGET_RADIO +GTK_FORM_WIDGET_RADIO_CLASS +GTK_FORM_WIDGET_RADIO_GET_CLASS GTK_FORM_WIDGET_SPIN GTK_FORM_WIDGET_SPIN_CLASS GTK_FORM_WIDGET_SPIN_GET_CLASS @@ -50,21 +56,42 @@ GTK_FORM_WIDGET_TEXTVIEW GTK_FORM_WIDGET_TEXTVIEW_CLASS GTK_FORM_WIDGET_TEXTVIEW_GET_CLASS GtkForm +GtkFormClass () GtkFormField GtkFormFieldBoolean +GtkFormFieldBooleanClass () +GtkFormFieldClass () GtkFormFieldDateTime +GtkFormFieldDateTimeClass () GtkFormFieldFloat +GtkFormFieldFloatClass () GtkFormFieldInteger +GtkFormFieldIntegerClass () GtkFormFieldText +GtkFormFieldTextClass () +GtkFormGroup +GtkFormGroupClass () GtkFormKey +GtkFormKeyClass () GtkFormSqlType () GtkFormWidget GtkFormWidgetCheck +GtkFormWidgetCheckClass () +GtkFormWidgetClass () GtkFormWidgetComboBox +GtkFormWidgetComboBoxClass () GtkFormWidgetEntry +GtkFormWidgetEntryClass () GtkFormWidgetLabel +GtkFormWidgetLabelClass () +GtkFormWidgetOnChangeOpType () +GtkFormWidgetOnChangeOpUpdateWhen () +GtkFormWidgetRadio +GtkFormWidgetRadioClass () GtkFormWidgetSpin +GtkFormWidgetSpinClass () GtkFormWidgetTextview +GtkFormWidgetTextviewClass () IS_GTK_FORM IS_GTK_FORM_CLASS IS_GTK_FORM_FIELD @@ -79,6 +106,8 @@ IS_GTK_FORM_FIELD_INTEGER IS_GTK_FORM_FIELD_INTEGER_CLASS IS_GTK_FORM_FIELD_TEXT IS_GTK_FORM_FIELD_TEXT_CLASS +IS_GTK_FORM_GROUP +IS_GTK_FORM_GROUP_CLASS IS_GTK_FORM_KEY IS_GTK_FORM_KEY_CLASS IS_GTK_FORM_WIDGET @@ -91,6 +120,8 @@ IS_GTK_FORM_WIDGET_ENTRY IS_GTK_FORM_WIDGET_ENTRY_CLASS IS_GTK_FORM_WIDGET_LABEL IS_GTK_FORM_WIDGET_LABEL_CLASS +IS_GTK_FORM_WIDGET_RADIO +IS_GTK_FORM_WIDGET_RADIO_CLASS IS_GTK_FORM_WIDGET_SPIN IS_GTK_FORM_WIDGET_SPIN_CLASS IS_GTK_FORM_WIDGET_TEXTVIEW @@ -102,12 +133,14 @@ TYPE_GTK_FORM_FIELD_DATETIME TYPE_GTK_FORM_FIELD_FLOAT TYPE_GTK_FORM_FIELD_INTEGER TYPE_GTK_FORM_FIELD_TEXT +TYPE_GTK_FORM_GROUP TYPE_GTK_FORM_KEY TYPE_GTK_FORM_WIDGET TYPE_GTK_FORM_WIDGET_CHECK TYPE_GTK_FORM_WIDGET_COMBO_BOX TYPE_GTK_FORM_WIDGET_ENTRY TYPE_GTK_FORM_WIDGET_LABEL +TYPE_GTK_FORM_WIDGET_RADIO TYPE_GTK_FORM_WIDGET_SPIN TYPE_GTK_FORM_WIDGET_TEXTVIEW gtk_form_add_field @@ -125,7 +158,7 @@ gtk_form_field_boolean_new gtk_form_field_boolean_set_as_origin gtk_form_field_boolean_set_from_datamodel gtk_form_field_boolean_set_from_hashtable -gtk_form_field_boolean_str_to_boolean (value) +gtk_form_field_boolean_str_to_boolean (value, value) gtk_form_field_clear gtk_form_field_datetime_clear gtk_form_field_datetime_get_gdate_from_tm @@ -156,7 +189,7 @@ gtk_form_field_float_set_as_origin gtk_form_field_float_set_from_datamodel gtk_form_field_float_set_from_hashtable gtk_form_field_get_field_name -gtk_form_field_get_gtk_form_widget +gtk_form_field_get_form_widget (Returns) gtk_form_field_get_type gtk_form_field_get_value gtk_form_field_get_value_sql @@ -196,7 +229,6 @@ gtk_form_filed_boolean_is_changed gtk_form_fill_from_datamodel gtk_form_fill_from_hashtable gtk_form_fill_from_table -gtk_form_get_field_from_name gtk_form_get_form_field_from_name gtk_form_get_form_field_from_widget gtk_form_get_form_field_value_by_name @@ -218,11 +250,12 @@ gtk_form_get_type gtk_form_get_values_as_hashtable gtk_form_get_widget_from_form_field_name gtk_form_get_widget_from_form_widget_name -gtk_form_get_widget_from_name +gtk_form_get_widgets gtk_form_group_add_field gtk_form_group_add_widget gtk_form_group_clear gtk_form_group_get_name +gtk_form_group_get_type gtk_form_group_new gtk_form_group_set_from_datamodel gtk_form_group_set_from_hashtable @@ -242,6 +275,7 @@ gtk_form_new_from_file gtk_form_new_from_xml gtk_form_remove_field gtk_form_set_editable +gtk_form_set_form_widget_visible_by_name gtk_form_set_form_widgets_visible_by_name gtk_form_set_key gtk_form_set_sensitive @@ -277,6 +311,7 @@ gtk_form_widget_label_new gtk_form_widget_label_set_value_stringify gtk_form_widget_new gtk_form_widget_radio_get_return_value +gtk_form_widget_radio_get_type gtk_form_widget_radio_get_value_stringify gtk_form_widget_radio_new gtk_form_widget_radio_set_editable @@ -312,6 +347,8 @@ fieldtext:Long_Description fieldtext:Short_Description form:Long_Description form:Short_Description +group:Long_Description +group:Short_Description key:Long_Description key:Short_Description widget:Long_Description @@ -324,6 +361,8 @@ widgetentry:Long_Description widgetentry:Short_Description widgetlabel:Long_Description widgetlabel:Short_Description +widgetradio:Long_Description +widgetradio:Short_Description widgetspin:Long_Description widgetspin:Short_Description widgettextview:Long_Description diff --git a/docs/reference/libgtkform-unused.txt b/docs/reference/libgtkform-unused.txt index 7755fe5..e69de29 100644 --- a/docs/reference/libgtkform-unused.txt +++ b/docs/reference/libgtkform-unused.txt @@ -1,99 +0,0 @@ -GTK_FORM_GROUP -GTK_FORM_GROUP_CLASS -GTK_FORM_GROUP_GET_CLASS -GTK_FORM_WIDGET_RADIO -GTK_FORM_WIDGET_RADIO_CLASS -GTK_FORM_WIDGET_RADIO_GET_CLASS -GtkFormGroup -GtkFormGroupClass -GtkFormWidgetOnChangeOpType -GtkFormWidgetOnChangeOpUpdateWhen -GtkFormWidgetRadio -GtkFormWidgetRadioClass -IS_GTK_FORM_GROUP -IS_GTK_FORM_GROUP_CLASS -IS_GTK_FORM_WIDGET_RADIO -IS_GTK_FORM_WIDGET_RADIO_CLASS -TYPE_GTK_FORM_GROUP -TYPE_GTK_FORM_WIDGET_RADIO -gtk_form_add_group -gtk_form_field_boolean_set_as_origin -gtk_form_field_boolean_set_from_hashtable -gtk_form_field_boolean_str_to_boolean -gtk_form_field_datetime_get_gdate_from_tm -gtk_form_field_datetime_get_now -gtk_form_field_datetime_get_str_from_tm -gtk_form_field_datetime_get_tm_from_str -gtk_form_field_datetime_is_changed -gtk_form_field_datetime_set_as_origin -gtk_form_field_datetime_set_from_hashtable -gtk_form_field_float_is_changed -gtk_form_field_float_set_as_origin -gtk_form_field_float_set_from_hashtable -gtk_form_field_get_form_widget -gtk_form_field_integer_is_changed -gtk_form_field_integer_set_as_origin -gtk_form_field_integer_set_from_hashtable -gtk_form_field_is_auto_increment -gtk_form_field_is_changed -gtk_form_field_is_to_load -gtk_form_field_is_to_save -gtk_form_field_set_as_origin -gtk_form_field_set_from_hashtable -gtk_form_field_text_is_changed -gtk_form_field_text_set_as_origin -gtk_form_field_text_set_from_hashtable -gtk_form_filed_boolean_is_changed -gtk_form_fill_from_hashtable -gtk_form_fill_from_table -gtk_form_get_form_field_from_name -gtk_form_get_form_field_from_widget -gtk_form_get_form_field_value_by_name -gtk_form_get_form_field_value_sql_by_name -gtk_form_get_form_field_value_stringify_by_name -gtk_form_get_form_widget_from_name -gtk_form_get_form_widget_from_widget -gtk_form_get_form_widget_value_by_name -gtk_form_get_form_widget_value_sql_by_name -gtk_form_get_form_widget_value_stringify_by_name -gtk_form_get_group_by_name -gtk_form_get_gtkbuilder -gtk_form_get_key -gtk_form_get_objects_by_name -gtk_form_get_table -gtk_form_get_values_as_hashtable -gtk_form_get_widget_from_form_field_name -gtk_form_get_widget_from_form_widget_name -gtk_form_get_widgets -gtk_form_group_add_field -gtk_form_group_add_widget -gtk_form_group_clear -gtk_form_group_get_name -gtk_form_group_get_type -gtk_form_group_new -gtk_form_group_set_from_datamodel -gtk_form_group_set_from_hashtable -gtk_form_is_changed -gtk_form_load_from_file -gtk_form_load_from_xml -gtk_form_new_from_file -gtk_form_new_from_xml -gtk_form_set_as_origin -gtk_form_set_form_widget_visible_by_name -gtk_form_set_key -gtk_form_set_sensitive_by_name -gtk_form_set_table -gtk_form_set_visible_by_name -gtk_form_widget_add_on_change_op -gtk_form_widget_combo_box_fill_from_datamodel -gtk_form_widget_combo_box_fill_from_sql -gtk_form_widget_get_label -gtk_form_widget_radio_get_return_value -gtk_form_widget_radio_get_type -gtk_form_widget_radio_get_value_stringify -gtk_form_widget_radio_new -gtk_form_widget_radio_set_editable -gtk_form_widget_radio_set_return_value -gtk_form_widget_radio_set_value_stringify -gtk_form_widget_set_label -gtk_form_widget_set_visible diff --git a/docs/reference/libgtkform.args b/docs/reference/libgtkform.args index fa1ddc6..091277f 100644 --- a/docs/reference/libgtkform.args +++ b/docs/reference/libgtkform.args @@ -42,7 +42,7 @@ GtkFormField::auto-increment gboolean -rw +rwx Auto increment Whether the field auto increments (works only on numeric fields). FALSE @@ -72,7 +72,7 @@ GtkFormField::obligatory gboolean -rw +rwx Obligatory Whether the field could be empty. FALSE @@ -98,6 +98,16 @@ TRUE + +GtkFormField::trim +gboolean + +rwx +Trim stringify value +Whether to trim the field's stringify value. +FALSE + + GtkFormFieldBoolean::default gboolean @@ -238,3 +248,13 @@ 0 + +GtkFormGroup::name +gchar* + +rw +Group's name' +Group's name. +"" + + diff --git a/docs/reference/libgtkform.hierarchy b/docs/reference/libgtkform.hierarchy index 75f08f8..ec3e4ce 100644 --- a/docs/reference/libgtkform.hierarchy +++ b/docs/reference/libgtkform.hierarchy @@ -15,6 +15,7 @@ GObject GtkFormWidgetSpin GtkFormWidgetTextview GtkFormWidgetComboBox + GtkFormGroup GInitiallyUnowned GtkObject GtkWidget diff --git a/docs/reference/libgtkform.types b/docs/reference/libgtkform.types index 9d91c41..257bf85 100644 --- a/docs/reference/libgtkform.types +++ b/docs/reference/libgtkform.types @@ -14,4 +14,4 @@ gtk_form_widget_radio_get_type gtk_form_widget_spin_get_type gtk_form_widget_textview_get_type gtk_form_widget_combo_box_get_type - +gtk_form_group_get_type diff --git a/docs/reference/tmpl/field.sgml b/docs/reference/tmpl/field.sgml index 4a092f7..4781c99 100644 --- a/docs/reference/tmpl/field.sgml +++ b/docs/reference/tmpl/field.sgml @@ -103,6 +103,27 @@ FormField + + + + + + + + + + +@parent_class: +@get_value_stringify: +@get_value: +@get_value_sql: +@clear: +@is_empty: +@is_changed: +@set_as_origin: +@set_from_datamodel: +@set_from_hashtable: + @@ -139,6 +160,15 @@ FormField @Returns: + + + + + +@field: +@Returns: + + @@ -175,6 +205,33 @@ FormField @Returns: + + + + + +@field: +@Returns: + + + + + + + +@field: +@Returns: + + + + + + + +@field: +@Returns: + + @@ -184,6 +241,23 @@ FormField @Returns: + + + + + +@field: +@Returns: + + + + + + + +@field: + + @@ -195,3 +269,13 @@ FormField @Returns: + + + + + +@field: +@hashtable: +@Returns: + + diff --git a/docs/reference/tmpl/fieldboolean.sgml b/docs/reference/tmpl/fieldboolean.sgml index 5174f1e..fe57b94 100644 --- a/docs/reference/tmpl/fieldboolean.sgml +++ b/docs/reference/tmpl/fieldboolean.sgml @@ -78,6 +78,13 @@ FormFieldBoolean + + + + + +@parent_class: + @@ -141,6 +148,23 @@ FormFieldBoolean @Returns: + + + + + +@field: +@Returns: + + + + + + + +@field: + + @@ -152,3 +176,22 @@ FormFieldBoolean @Returns: + + + + + +@field: +@hashtable: +@Returns: + + + + + + + +@value: +@Returns: + + diff --git a/docs/reference/tmpl/fielddatetime.sgml b/docs/reference/tmpl/fielddatetime.sgml index b2cf491..50c85af 100644 --- a/docs/reference/tmpl/fielddatetime.sgml +++ b/docs/reference/tmpl/fielddatetime.sgml @@ -88,6 +88,13 @@ FormFieldDateTime + + + + + +@parent_class: + @@ -151,6 +158,23 @@ FormFieldDateTime @Returns: + + + + + +@field: +@Returns: + + + + + + + +@field: + + @@ -162,3 +186,51 @@ FormFieldDateTime @Returns: + + + + + +@field: +@hashtable: +@Returns: + + + + + + + +@str: +@format: +@Returns: + + + + + + + +@datetime: +@format: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@void: +@Returns: + + diff --git a/docs/reference/tmpl/fieldfloat.sgml b/docs/reference/tmpl/fieldfloat.sgml index cd64917..3cb9b97 100644 --- a/docs/reference/tmpl/fieldfloat.sgml +++ b/docs/reference/tmpl/fieldfloat.sgml @@ -78,6 +78,13 @@ FormFieldFloat + + + + + +@parent_class: + @@ -141,6 +148,23 @@ FormFieldFloat @Returns: + + + + + +@field: +@Returns: + + + + + + + +@field: + + @@ -152,3 +176,13 @@ FormFieldFloat @Returns: + + + + + +@field: +@hashtable: +@Returns: + + diff --git a/docs/reference/tmpl/fieldinteger.sgml b/docs/reference/tmpl/fieldinteger.sgml index 09103e5..9a3e2b1 100644 --- a/docs/reference/tmpl/fieldinteger.sgml +++ b/docs/reference/tmpl/fieldinteger.sgml @@ -78,6 +78,13 @@ FormFieldInteger + + + + + +@parent_class: + @@ -141,6 +148,23 @@ FormFieldInteger @Returns: + + + + + +@field: +@Returns: + + + + + + + +@field: + + @@ -152,3 +176,13 @@ FormFieldInteger @Returns: + + + + + +@field: +@hashtable: +@Returns: + + diff --git a/docs/reference/tmpl/fieldtext.sgml b/docs/reference/tmpl/fieldtext.sgml index 6b0033a..afa7620 100644 --- a/docs/reference/tmpl/fieldtext.sgml +++ b/docs/reference/tmpl/fieldtext.sgml @@ -78,6 +78,13 @@ FormFieldText + + + + + +@parent_class: + @@ -141,6 +148,23 @@ FormFieldText @Returns: + + + + + +@field: +@Returns: + + + + + + + +@field: + + @@ -152,3 +176,13 @@ FormFieldText @Returns: + + + + + +@field: +@hashtable: +@Returns: + + diff --git a/docs/reference/tmpl/form.sgml b/docs/reference/tmpl/form.sgml index 55712cb..576eed6 100644 --- a/docs/reference/tmpl/form.sgml +++ b/docs/reference/tmpl/form.sgml @@ -93,6 +93,13 @@ Form + + + + + +@parent_class: + @@ -111,6 +118,93 @@ Form @Returns: + + + + + +@xmldoc: +@gtkbuilder: +@Returns: + + + + + + + +@filename: +@gtkbuilder: +@Returns: + + + + + + + +@form: +@xmldoc: +@gtkbuilder: +@Returns: + + + + + + + +@form: +@filename: +@gtkbuilder: +@Returns: + + + + + + + +@form: +@Returns: + + + + + + + +@form: +@Returns: + + + + + + + +@form: +@table: + + + + + + + +@form: +@Returns: + + + + + + + +@form: +@key: + + @@ -141,6 +235,85 @@ Form @Returns: + + + + + +@form: +@field_name: +@Returns: + + + + + + + +@form: +@widget_name: +@Returns: + + + + + + + +@form: +@field_name: +@Returns: + + + + + + + +@form: +@widget_name: +@Returns: + + + + + + + +@form: +@widget: +@Returns: + + + + + + + +@form: +@widget: +@Returns: + + + + + + + +@form: +@Returns: + + + + + + + +@form: +@Varargs: +@Returns: + + @@ -164,6 +337,23 @@ Form @Returns: + + + + + +@form: +@Returns: + + + + + + + +@form: + + @@ -173,6 +363,16 @@ Form @sensitive: + + + + + +@form: +@sensitive: +@Varargs: + + @@ -182,6 +382,86 @@ Form @editable: + + + + + +@form: +@visible: +@Varargs: + + + + + + + +@form: +@visible: +@Varargs: + + + + + + + +@form: +@field_name: +@Returns: + + + + + + + +@form: +@widget_name: +@Returns: + + + + + + + +@form: +@field_name: +@Returns: + + + + + + + +@form: +@widget_name: +@Returns: + + + + + + + +@form: +@field_name: +@Returns: + + + + + + + +@form: +@widget_name: +@Returns: + + @@ -213,3 +493,51 @@ Form @Returns: + + + + + +@form: +@Returns: + + + + + + + +@form: +@Returns: + + + + + + + +@form: +@hashtable: +@Returns: + + + + + + + +@form: +@group: +@Returns: + + + + + + + +@form: +@group_name: +@Returns: + + diff --git a/docs/reference/tmpl/group.sgml b/docs/reference/tmpl/group.sgml new file mode 100644 index 0000000..bf5db6b --- /dev/null +++ b/docs/reference/tmpl/group.sgml @@ -0,0 +1,164 @@ + +GtkFormGroup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@obj: + + + + + + + +@klass: + + + + + + + +@obj: + + + + + + + +@klass: + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + +@parent_class: + + + + + + +@void: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@group: +@Returns: + + + + + + + +@group: +@fwidget: +@Returns: + + + + + + + +@group: +@field: +@Returns: + + + + + + + +@group: +@Returns: + + + + + + + +@group: +@dm: +@row: +@Returns: + + + + + + + +@group: +@hashtable: +@Returns: + + diff --git a/docs/reference/tmpl/key.sgml b/docs/reference/tmpl/key.sgml index 26472d6..e6596e8 100644 --- a/docs/reference/tmpl/key.sgml +++ b/docs/reference/tmpl/key.sgml @@ -73,6 +73,13 @@ FormKey + + + + + +@parent_class: + diff --git a/docs/reference/tmpl/widget.sgml b/docs/reference/tmpl/widget.sgml index 53f8169..3d6e171 100644 --- a/docs/reference/tmpl/widget.sgml +++ b/docs/reference/tmpl/widget.sgml @@ -98,6 +98,16 @@ FormWidget + + + + + +@parent_class: +@get_value_stringify: +@set_value_stringify: +@set_editable: + @@ -145,6 +155,24 @@ FormWidget @Returns: + + + + + +@fwidget: +@Returns: + + + + + + + +@fwidget: +@label: + + @@ -173,3 +201,37 @@ FormWidget @editable: + + + + + +@fwidget: +@visible: + + + + + + + +@GTK_FORM_WIDGET_ON_CHANGE_OP_UPDATE: + + + + + + +@GTK_FORM_WIDGET_ON_CHANGE_OP_UPDATE_BEFORE: +@GTK_FORM_WIDGET_ON_CHANGE_OP_UPDATE_AFTER: +@GTK_FORM_WIDGET_ON_CHANGE_OP_UPDATE_BOTH: + + + + + + +@fwidget: +@op: + + diff --git a/docs/reference/tmpl/widgetcheck.sgml b/docs/reference/tmpl/widgetcheck.sgml index 9fc8b12..e7d4ad6 100644 --- a/docs/reference/tmpl/widgetcheck.sgml +++ b/docs/reference/tmpl/widgetcheck.sgml @@ -73,6 +73,13 @@ FormWidgetCheck + + + + + +@parent_class: + diff --git a/docs/reference/tmpl/widgetcombobox.sgml b/docs/reference/tmpl/widgetcombobox.sgml index 6a3e491..5c14f3e 100644 --- a/docs/reference/tmpl/widgetcombobox.sgml +++ b/docs/reference/tmpl/widgetcombobox.sgml @@ -78,6 +78,13 @@ GtkFormWidgetComboBox + + + + + +@parent_class: + @@ -124,3 +131,24 @@ GtkFormWidgetComboBox @editable: + + + + + +@fwidget: +@dm: +@with_empty_entry: + + + + + + + +@fwidget: +@gdaex: +@sql: +@with_empty_entry: + + diff --git a/docs/reference/tmpl/widgetentry.sgml b/docs/reference/tmpl/widgetentry.sgml index ec2fd50..d1cdde8 100644 --- a/docs/reference/tmpl/widgetentry.sgml +++ b/docs/reference/tmpl/widgetentry.sgml @@ -73,6 +73,13 @@ FormWidgetEntry + + + + + +@parent_class: + diff --git a/docs/reference/tmpl/widgetlabel.sgml b/docs/reference/tmpl/widgetlabel.sgml index ad1ee83..abcd371 100644 --- a/docs/reference/tmpl/widgetlabel.sgml +++ b/docs/reference/tmpl/widgetlabel.sgml @@ -73,6 +73,13 @@ FormWidgetLabel + + + + + +@parent_class: + diff --git a/docs/reference/tmpl/widgetradio.sgml b/docs/reference/tmpl/widgetradio.sgml new file mode 100644 index 0000000..557661c --- /dev/null +++ b/docs/reference/tmpl/widgetradio.sgml @@ -0,0 +1,151 @@ + +GtkFormWidgetRadio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@obj: + + + + + + + +@klass: + + + + + + + +@obj: + + + + + + + +@klass: + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + +@parent_class: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@widget: +@Returns: + + + + + + + +@fwidget: +@value: +@Returns: + + + + + + + +@fwidget: +@editable: + + + + + + + +@fwidget: +@value: + + + + + + + +@fwidget: +@Returns: + + diff --git a/docs/reference/tmpl/widgetspin.sgml b/docs/reference/tmpl/widgetspin.sgml index d64099f..36d38c0 100644 --- a/docs/reference/tmpl/widgetspin.sgml +++ b/docs/reference/tmpl/widgetspin.sgml @@ -73,6 +73,13 @@ FormWidgetSpin + + + + + +@parent_class: + diff --git a/docs/reference/tmpl/widgettextview.sgml b/docs/reference/tmpl/widgettextview.sgml index aa78d6d..b59345e 100644 --- a/docs/reference/tmpl/widgettextview.sgml +++ b/docs/reference/tmpl/widgettextview.sgml @@ -73,6 +73,13 @@ FormWidgetTextview + + + + + +@parent_class: + diff --git a/po/it.po b/po/it.po index b96cc5f..88ab4a6 100644 --- a/po/it.po +++ b/po/it.po @@ -1,60 +1,97 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# Andrea Zagli , 2009 +# Andrea Zagli , 2009, 2010. # msgid "" msgstr "" "Project-Id-Version: 0.1.0\n" "Report-Msgid-Bugs-To: Andrea Zagli \n" -"POT-Creation-Date: 2009-10-19 16:12+0200\n" -"PO-Revision-Date: 2009-10-19 16:15+0200\n" +"POT-Creation-Date: 2010-08-01 11:50+0200\n" +"PO-Revision-Date: 2010-08-01 11:52+0200\n" "Last-Translator: Andrea Zagli \n" -"Language-Team: Italian \n" +"Language-Team: Italian <>\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" -#: ../src/fielddatetime.c:391 +#: ../src/fieldboolean.c:315 ../src/fieldboolean.c:369 +#: ../src/fielddatetime.c:401 ../src/fielddatetime.c:456 +#: ../src/fieldfloat.c:365 msgid "GtkFormField hasn't a field name." msgstr "GtkFormField non ha un nome di campo." -#: ../src/form.c:214 +#: ../src/fielddatetime.c:779 +#, c-format +msgid "GtkFormFieldDateTimeType not supported: %d." +msgstr "GtkFormFieldDateTimeType non supportato: %d." + +#: ../src/form.c:395 #, c-format msgid "Error on loading GtkBuilder file: %s\n" msgstr "Errore durante il caricamento del file GtkBuilder: %s\n" -#: ../src/form.c:277 +#: ../src/form.c:444 +#, c-format +msgid "Unknown type «%s»." +msgstr "Tipo «%s» sconosciuto." + +#: ../src/form.c:474 #, c-format msgid "Label «%s» not found." msgstr "Etichetta «%s» non trovata." -#: ../src/form.c:429 +#: ../src/form.c:657 #, c-format msgid "Field of type «%s» not found." msgstr "Campo di tipo «%s» non trovato." -#: ../src/form.c:438 +#: ../src/form.c:666 #, c-format msgid "Widget of type «%s» not found." msgstr "Widget di tipo «%s» non trovato." #. TO DO -#: ../src/form.c:448 +#: ../src/form.c:680 msgid "The file is not a valid gtkform definition file." msgstr "Il file non è un file di definizione di gtkform valido." -#: ../src/form.c:810 ../src/form.c:1077 +#: ../src/form.c:1177 ../src/form.c:1449 ../src/form.c:1525 ../src/form.c:1566 #, c-format msgid "Object «%s» not found." msgstr "Oggetto «%s» non trovato." -#: ../src/form.c:1343 +#: ../src/form.c:2164 #, c-format msgid "The field «%s» is obligatory." msgstr "Il campo «%s» è obbligatorio." -#: ../src/widget.c:140 +#: ../src/widget.c:183 #, c-format msgid "Widget «%s» not found." msgstr "Widget «%s» non trovato." + +#: ../src/widget.c:322 +#, c-format +msgid "" +"Error on parsing sql string: %s\n" +"%s" +msgstr "" +"Errore nell'analisi della stringa sql: %s\n" +"%s" + +#: ../src/widget.c:342 +#, c-format +msgid "Error on setting holder's value: %s" +msgstr "Errore nell'impostazione del valore dell'holder: %s" + +#: ../src/widget.c:357 +#, c-format +msgid "Error on executing GtkFormWidgetOnChangeOp: %s" +msgstr "Errore nell'esecuzione di GtkFormWidgetOnChangeOp: %s" + +#: ../src/widget.c:373 +msgid "No GdaEx object inside GtkFormWidget." +msgstr "Nessun oggetto GdaEx all'interno di GtkFormWidget." diff --git a/src/field.c b/src/field.c index 92daa51..449bdfd 100644 --- a/src/field.c +++ b/src/field.c @@ -28,7 +28,8 @@ enum PROP_OBLIGATORY, PROP_AUTO_INCREMENT, PROP_DATAMODEL, - PROP_WIDGET + PROP_WIDGET, + PROP_TRIM }; static void gtk_form_field_class_init (GtkFormFieldClass *klass); @@ -54,6 +55,7 @@ struct _GtkFormFieldPrivate gboolean to_save; gboolean obligatory; gboolean auto_increment; + gboolean trim; GdaDataModel *dm; @@ -101,14 +103,21 @@ gtk_form_field_class_init (GtkFormFieldClass *klass) "Obligatory", "Whether the field could be empty", FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE|G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_AUTO_INCREMENT, g_param_spec_boolean ("auto-increment", "Auto increment", "Whether the field auto increments (works only on numeric fields)", FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE|G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, PROP_TRIM, + g_param_spec_boolean ("trim", + "Trim stringify value", + "Whether to trim the field's stringify value", + FALSE, + G_PARAM_READWRITE|G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_WIDGET, g_param_spec_object ("form-widget", @@ -190,6 +199,8 @@ GtkFormWidget gchar *gtk_form_field_get_value_stringify (GtkFormField *field) { + GtkFormFieldPrivate *priv = GTK_FORM_FIELD_GET_PRIVATE (field); + gchar *ret; ret = g_strdup (""); @@ -197,6 +208,10 @@ gchar if (IS_GTK_FORM_FIELD (field) && GTK_FORM_FIELD_GET_CLASS (field)->get_value_stringify != NULL) { ret = GTK_FORM_FIELD_GET_CLASS (field)->get_value_stringify (field); + if (priv->trim) + { + ret = g_strstrip (ret); + } } return ret; @@ -217,6 +232,10 @@ GValue if (IS_GTK_FORM_FIELD (field) && GTK_FORM_FIELD_GET_CLASS (field)->get_value != NULL) { ret = GTK_FORM_FIELD_GET_CLASS (field)->get_value (field); + if (G_VALUE_HOLDS_STRING (ret)) + { + g_value_set_string (ret, g_strstrip (g_strdup (g_value_get_string (ret)))); + } } return ret; @@ -457,6 +476,10 @@ gtk_form_field_set_property (GObject *object, g_object_set (G_OBJECT (priv->widget), "field", field, NULL); break; + case PROP_TRIM: + priv->trim = g_value_get_boolean (value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -503,6 +526,10 @@ gtk_form_field_get_property (GObject *object, g_value_set_object (value, priv->widget); break; + case PROP_TRIM: + g_value_set_boolean (value, priv->trim); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; diff --git a/src/fieldtext.c b/src/fieldtext.c index c3b03f2..daa9ed0 100644 --- a/src/fieldtext.c +++ b/src/fieldtext.c @@ -175,6 +175,14 @@ gchar if (value != NULL) { + gboolean trim; + + g_object_get (G_OBJECT (field), "trim", &trim, NULL); + if (trim) + { + value = g_strstrip (value); + } + ret = g_strconcat ("'", gdaex_strescape (value, NULL), "'", NULL); g_free (value); @@ -302,7 +310,7 @@ gtk_form_field_text_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, g } ret = gtk_form_field_text_set_value_stringify (field, strret); - priv->original_value = g_strdup (strret); + priv->original_value = gtk_form_field_text_get_value_stringify (field); g_free (field_name); g_free (strret); @@ -340,8 +348,8 @@ gtk_form_field_text_set_from_hashtable (GtkFormField *field, GHashTable *hashtab } else { - priv->original_value = g_strdup (g_value_get_string (gval)); ret = gtk_form_field_text_set_value_stringify (field, priv->original_value); + priv->original_value = gtk_form_field_text_get_value_stringify (field); } g_free (field_name); } @@ -399,12 +407,22 @@ gtk_form_field_text_set_value_stringify (GtkFormField *field, const gchar *value { gboolean ret = FALSE; GtkFormWidget *fw; + gboolean trim; + gchar *newval; g_object_get (field, "form-widget", &fw, + "trim", &trim, NULL); - ret = gtk_form_widget_set_value_stringify (fw, value); + newval = g_strdup (value); + + if (trim) + { + newval = g_strstrip (newval); + } + + ret = gtk_form_widget_set_value_stringify (fw, newval); return ret; } diff --git a/src/form.c b/src/form.c index cf4cd16..f2e3ea3 100644 --- a/src/form.c +++ b/src/form.c @@ -648,6 +648,12 @@ gtk_form_load_from_xml (GtkForm *form, xmlDoc *xmldoc, GtkBuilder *gtkbuilder) g_object_set (G_OBJECT (field), "display-format", prop, NULL); } } + else if (xmlStrcmp (node_field->name, (const xmlChar *)"trim") == 0) + { + g_object_set (G_OBJECT (field), + "trim", gtk_form_field_boolean_str_to_boolean (prop), + NULL); + } node_field = node_field->next; } -- 2.49.0