From: Andrea Zagli Date: Sun, 14 Jan 2007 16:07:27 +0000 (+0000) Subject: Added functions form_set_sensitive and form_set_editable. X-Git-Tag: 0.1.0~43 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=e6c3cf7229d8cf1aba6ae952fdf22f8d50978dd5;p=libgtkform Added functions form_set_sensitive and form_set_editable. --- diff --git a/ChangeLog b/ChangeLog index f0e58a8..840a9df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-01-14 Andrea Zagli + + * autogen.sh: added + +2007-01-06 Andrea Zagli + + * libform.h: + * form.c: added functions form_set_sensitive and form_set_editable + * libformwidget.h: + * formwidget.c: added function form_widget_set_editable + 2006-12-23 Andrea Zagli * widget.c: diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..dcc1ee3 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,98 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir +PROJECT=libform +TEST_TYPE=-f +FILE=configure.ac + +DIE=0 + +have_libtool=false +if libtoolize --version < /dev/null > /dev/null 2>&1 ; then + libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + case $libtool_version in + 1.4*|1.5*) + have_libtool=true + ;; + esac +fi +if $have_libtool ; then : ; else + echo + echo "You must have libtool 1.4 installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" + DIE=1 +fi + +(gtkdocize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have gtk-doc installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/" + DIE=1 +} + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" + DIE=1 +} + +if automake --version < /dev/null > /dev/null 2>&1 ; then + AUTOMAKE=automake + ACLOCAL=aclocal +else + echo + echo "You must have automake 1.7.x installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" + DIE=1 +fi + +if test "$DIE" -eq 1; then + exit 1 +fi + +test $TEST_TYPE $FILE || { + echo "You must run this script in the top-level $PROJECT directory" + exit 1 +} + +if test -z "$AUTOGEN_SUBDIR_MODE"; then + if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." + fi +fi + +rm -rf autom4te.cache + +# README and INSTALL are required by automake, but may be deleted by clean +# up rules. to get automake to work, simply touch these here, they will be +# regenerated from their corresponding *.in files by ./configure anyway. +touch README INSTALL + +$ACLOCAL || exit $? + +libtoolize --force || exit $? +gtkdocize || exit $? + +autoheader || exit $? + +$AUTOMAKE --add-missing || exit $? +autoconf || exit $? +cd $ORIGDIR || exit $? + +if test -z "$AUTOGEN_SUBDIR_MODE"; then + $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $? + + echo + echo "Now type 'make' to compile $PROJECT." +fi diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index 094ba4c..4b7e20d 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -55,7 +55,7 @@ HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files= +content_files = version.xml.in # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files diff --git a/docs/reference/libform-docs.sgml b/docs/reference/libform-docs.sgml index 19501bb..695912a 100644 --- a/docs/reference/libform-docs.sgml +++ b/docs/reference/libform-docs.sgml @@ -13,18 +13,19 @@ LibForm API Reference - - - - + + + + + + + + + - - - - diff --git a/docs/reference/libform-sections.txt b/docs/reference/libform-sections.txt index badafd9..f722561 100644 --- a/docs/reference/libform-sections.txt +++ b/docs/reference/libform-sections.txt @@ -1,37 +1,38 @@
libform -TYPE_FORM -FORM -FORM_CLASS -IS_FORM -IS_FORM_CLASS -FORM_GET_CLASS Form Form -form_get_type form_new form_add_field form_remove_field +form_add_fields form_clear form_check FormSqlType form_get_sql form_fill_from_datamodel +form_get_field_from_name +form_get_widget_from_name +form_set_editable +form_set_sensitive + +TYPE_FORM +FORM +FORM_CLASS +IS_FORM +IS_FORM_CLASS +FORM_GET_CLASS + +form_get_type
libformfield -TYPE_FORM_FIELD -FORM_FIELD -FORM_FIELD_CLASS -IS_FORM_FIELD -IS_FORM_FIELD_CLASS -FORM_FIELD_GET_CLASS FormField FormField -form_field_get_type form_field_new form_field_new_from_form_widget +form_field_get_form_widget form_field_get_field_name form_field_get_value_stringify form_field_get_value @@ -39,53 +40,61 @@ form_field_get_value_sql form_field_clear form_field_is_empty form_field_set_from_datamodel + +TYPE_FORM_FIELD +FORM_FIELD +FORM_FIELD_CLASS +IS_FORM_FIELD +IS_FORM_FIELD_CLASS +FORM_FIELD_GET_CLASS + +form_field_get_type
libformwidget -TYPE_FORM_WIDGET -FORM_WIDGET -FORM_WIDGET_CLASS -IS_FORM_WIDGET -IS_FORM_WIDGET_CLASS -FORM_WIDGET_GET_CLASS FormWidget FormWidget -form_widget_get_type form_widget_new form_widget_set_from_glade form_widget_get_widget +form_widget_get_widget_name form_widget_get_value_stringify form_widget_set_value_stringify +form_widget_set_editable + +TYPE_FORM_WIDGET +FORM_WIDGET +FORM_WIDGET_CLASS +IS_FORM_WIDGET +IS_FORM_WIDGET_CLASS +FORM_WIDGET_GET_CLASS + +form_widget_get_type
libformwidgetlabel +FormWidgetLabel +FormWidgetLabel +form_widget_label_new +form_widget_label_get_value_stringify +form_widget_label_set_value_stringify + TYPE_FORM_WIDGET_LABEL FORM_WIDGET_LABEL FORM_WIDGET_LABEL_CLASS IS_FORM_WIDGET_LABEL IS_FORM_WIDGET_LABEL_CLASS FORM_WIDGET_LABEL_GET_CLASS -FormWidgetLabel -FormWidgetLabel + form_widget_label_get_type -form_widget_label_new -form_widget_label_get_value_stringify -form_widget_label_set_value_stringify
libformfieldtext -TYPE_FORM_FIELD_TEXT -FORM_FIELD_TEXT -FORM_FIELD_TEXT_CLASS -IS_FORM_FIELD_TEXT -IS_FORM_FIELD_TEXT_CLASS -FORM_FIELD_TEXT_GET_CLASS FormFieldText FormFieldText -form_field_text_get_type form_field_text_new form_field_text_get_value_stringify form_field_text_get_value @@ -93,38 +102,43 @@ form_field_text_get_value_sql form_field_text_clear form_field_text_is_empty form_field_text_set_from_datamodel + +TYPE_FORM_FIELD_TEXT +FORM_FIELD_TEXT +FORM_FIELD_TEXT_CLASS +IS_FORM_FIELD_TEXT +IS_FORM_FIELD_TEXT_CLASS +FORM_FIELD_TEXT_GET_CLASS + +form_field_text_get_type
libformkey -TYPE_FORM_KEY -FORM_KEY -FORM_KEY_CLASS -IS_FORM_KEY -IS_FORM_KEY_CLASS -FORM_KEY_GET_CLASS FormKey FormKey -form_key_get_type form_key_new form_key_add_field +form_key_add_fields form_key_remove_field form_key_check form_key_get_sql form_key_field_is_key + +TYPE_FORM_KEY +FORM_KEY +FORM_KEY_CLASS +IS_FORM_KEY +IS_FORM_KEY_CLASS +FORM_KEY_GET_CLASS + +form_key_get_type
libformfielddatetime -TYPE_FORM_FIELD_DATETIME -FORM_FIELD_DATETIME -FORM_FIELD_DATETIME_CLASS -IS_FORM_FIELD_DATETIME -IS_FORM_FIELD_DATETIME_CLASS -FORM_FIELD_DATETIME_GET_CLASS FormFieldDateTime FormFieldDateTime -form_field_datetime_get_type form_field_datetime_new form_field_datetime_get_value_stringify form_field_datetime_get_value @@ -132,19 +146,21 @@ form_field_datetime_get_value_sql form_field_datetime_clear form_field_datetime_is_empty form_field_datetime_set_from_datamodel + +TYPE_FORM_FIELD_DATETIME +FORM_FIELD_DATETIME +FORM_FIELD_DATETIME_CLASS +IS_FORM_FIELD_DATETIME +IS_FORM_FIELD_DATETIME_CLASS +FORM_FIELD_DATETIME_GET_CLASS + +form_field_datetime_get_type
libformfieldinteger -TYPE_FORM_FIELD_INTEGER -FORM_FIELD_INTEGER -FORM_FIELD_INTEGER_CLASS -IS_FORM_FIELD_INTEGER -IS_FORM_FIELD_INTEGER_CLASS -FORM_FIELD_INTEGER_GET_CLASS FormFieldInteger FormFieldInteger -form_field_integer_get_type form_field_integer_new form_field_integer_get_value_stringify form_field_integer_get_value @@ -152,51 +168,59 @@ form_field_integer_get_value_sql form_field_integer_clear form_field_integer_is_empty form_field_integer_set_from_datamodel + +TYPE_FORM_FIELD_INTEGER +FORM_FIELD_INTEGER +FORM_FIELD_INTEGER_CLASS +IS_FORM_FIELD_INTEGER +IS_FORM_FIELD_INTEGER_CLASS +FORM_FIELD_INTEGER_GET_CLASS + +form_field_integer_get_type
libformwidgetentry +FormWidgetEntry +FormWidgetEntry +form_widget_entry_new +form_widget_entry_get_value_stringify +form_widget_entry_set_value_stringify +form_widget_entry_set_editable + TYPE_FORM_WIDGET_ENTRY FORM_WIDGET_ENTRY FORM_WIDGET_ENTRY_CLASS IS_FORM_WIDGET_ENTRY IS_FORM_WIDGET_ENTRY_CLASS FORM_WIDGET_ENTRY_GET_CLASS -FormWidgetEntry -FormWidgetEntry + form_widget_entry_get_type -form_widget_entry_new -form_widget_entry_get_value_stringify -form_widget_entry_set_value_stringify
libformwidgetspin +FormWidgetSpin +FormWidgetSpin +form_widget_spin_new +form_widget_spin_get_value_stringify +form_widget_spin_set_value_stringify +form_widget_spin_set_editable + TYPE_FORM_WIDGET_SPIN FORM_WIDGET_SPIN FORM_WIDGET_SPIN_CLASS IS_FORM_WIDGET_SPIN IS_FORM_WIDGET_SPIN_CLASS FORM_WIDGET_SPIN_GET_CLASS -FormWidgetSpin -FormWidgetSpin + form_widget_spin_get_type -form_widget_spin_new -form_widget_spin_get_value_stringify -form_widget_spin_set_value_stringify
libformfieldboolean -TYPE_FORM_FIELD_BOOLEAN -FORM_FIELD_BOOLEAN -FORM_FIELD_BOOLEAN_CLASS -IS_FORM_FIELD_BOOLEAN -IS_FORM_FIELD_BOOLEAN_CLASS -FORM_FIELD_BOOLEAN_GET_CLASS FormFieldBoolean FormFieldBoolean -form_field_boolean_get_type form_field_boolean_new form_field_boolean_get_value_stringify form_field_boolean_get_value @@ -204,19 +228,21 @@ form_field_boolean_get_value_sql form_field_boolean_clear form_field_boolean_is_empty form_field_boolean_set_from_datamodel + +TYPE_FORM_FIELD_BOOLEAN +FORM_FIELD_BOOLEAN +FORM_FIELD_BOOLEAN_CLASS +IS_FORM_FIELD_BOOLEAN +IS_FORM_FIELD_BOOLEAN_CLASS +FORM_FIELD_BOOLEAN_GET_CLASS + +form_field_boolean_get_type
libformfieldfloat -TYPE_FORM_FIELD_FLOAT -FORM_FIELD_FLOAT -FORM_FIELD_FLOAT_CLASS -IS_FORM_FIELD_FLOAT -IS_FORM_FIELD_FLOAT_CLASS -FORM_FIELD_FLOAT_GET_CLASS FormFieldFloat FormFieldFloat -form_field_float_get_type form_field_float_new form_field_float_get_value_stringify form_field_float_get_value @@ -224,36 +250,89 @@ form_field_float_get_value_sql form_field_float_clear form_field_float_is_empty form_field_float_set_from_datamodel + +TYPE_FORM_FIELD_FLOAT +FORM_FIELD_FLOAT +FORM_FIELD_FLOAT_CLASS +IS_FORM_FIELD_FLOAT +IS_FORM_FIELD_FLOAT_CLASS +FORM_FIELD_FLOAT_GET_CLASS + +form_field_float_get_type
libformwidgetcheck +FormWidgetCheck +FormWidgetCheck +form_widget_check_new +form_widget_check_get_value_stringify +form_widget_check_set_value_stringify +form_widget_check_set_editable + TYPE_FORM_WIDGET_CHECK FORM_WIDGET_CHECK FORM_WIDGET_CHECK_CLASS IS_FORM_WIDGET_CHECK IS_FORM_WIDGET_CHECK_CLASS FORM_WIDGET_CHECK_GET_CLASS -FormWidgetCheck -FormWidgetCheck + form_widget_check_get_type -form_widget_check_new -form_widget_check_get_value_stringify -form_widget_check_set_value_stringify
libformwidgettextview +FormWidgetTextview +FormWidgetTextview +form_widget_textview_new +form_widget_textview_get_value_stringify +form_widget_textview_set_value_stringify +form_widget_textview_set_editable + TYPE_FORM_WIDGET_TEXTVIEW FORM_WIDGET_TEXTVIEW FORM_WIDGET_TEXTVIEW_CLASS IS_FORM_WIDGET_TEXTVIEW IS_FORM_WIDGET_TEXTVIEW_CLASS FORM_WIDGET_TEXTVIEW_GET_CLASS -FormWidgetTextview -FormWidgetTextview + form_widget_textview_get_type -form_widget_textview_new -form_widget_textview_get_value_stringify -form_widget_textview_set_value_stringify +
+ +
+libformwidgetdateentry +FormWidgetDateEntry +FormWidgetDateEntry +form_widget_date_entry_new +form_widget_date_entry_get_value_stringify +form_widget_date_entry_set_value_stringify +form_widget_date_entry_set_editable + +TYPE_FORM_WIDGET_DATE_ENTRY +FORM_WIDGET_DATE_ENTRY +FORM_WIDGET_DATE_ENTRY_CLASS +IS_FORM_WIDGET_DATE_ENTRY +IS_FORM_WIDGET_DATE_ENTRY_CLASS +FORM_WIDGET_DATE_ENTRY_GET_CLASS + +form_widget_date_entry_get_type +
+ +
+libformwidgetcombobox +FormWidgetComboBox +FormWidgetComboBox +form_widget_combo_box_new +form_widget_combo_box_get_value_stringify +form_widget_combo_box_set_value_stringify +form_widget_combo_box_set_editable + +TYPE_FORM_WIDGET_COMBO_BOX +FORM_WIDGET_COMBO_BOX +FORM_WIDGET_COMBO_BOX_CLASS +IS_FORM_WIDGET_COMBO_BOX +IS_FORM_WIDGET_COMBO_BOX_CLASS +FORM_WIDGET_COMBO_BOX_GET_CLASS + +form_widget_combo_box_get_type
diff --git a/docs/reference/libform-undocumented.txt b/docs/reference/libform-undocumented.txt index e78c3cb..161e230 100644 --- a/docs/reference/libform-undocumented.txt +++ b/docs/reference/libform-undocumented.txt @@ -1,51 +1,9 @@ -5% symbol docs coverage. -12 symbols documented. -0 symbols incomplete. -217 not documented. +11% symbol docs coverage. +18 symbols documented. +1 symbols incomplete. +145 not documented. -FORM -FORM_CLASS -FORM_FIELD -FORM_FIELD_BOOLEAN -FORM_FIELD_BOOLEAN_CLASS -FORM_FIELD_BOOLEAN_GET_CLASS -FORM_FIELD_CLASS -FORM_FIELD_DATETIME -FORM_FIELD_DATETIME_CLASS -FORM_FIELD_DATETIME_GET_CLASS -FORM_FIELD_FLOAT -FORM_FIELD_FLOAT_CLASS -FORM_FIELD_FLOAT_GET_CLASS -FORM_FIELD_GET_CLASS -FORM_FIELD_INTEGER -FORM_FIELD_INTEGER_CLASS -FORM_FIELD_INTEGER_GET_CLASS -FORM_FIELD_TEXT -FORM_FIELD_TEXT_CLASS -FORM_FIELD_TEXT_GET_CLASS -FORM_GET_CLASS -FORM_KEY -FORM_KEY_CLASS -FORM_KEY_GET_CLASS -FORM_WIDGET -FORM_WIDGET_CHECK -FORM_WIDGET_CHECK_CLASS -FORM_WIDGET_CHECK_GET_CLASS -FORM_WIDGET_CLASS -FORM_WIDGET_ENTRY -FORM_WIDGET_ENTRY_CLASS -FORM_WIDGET_ENTRY_GET_CLASS -FORM_WIDGET_GET_CLASS -FORM_WIDGET_LABEL -FORM_WIDGET_LABEL_CLASS -FORM_WIDGET_LABEL_GET_CLASS -FORM_WIDGET_SPIN -FORM_WIDGET_SPIN_CLASS -FORM_WIDGET_SPIN_GET_CLASS -FORM_WIDGET_TEXTVIEW -FORM_WIDGET_TEXTVIEW_CLASS -FORM_WIDGET_TEXTVIEW_GET_CLASS Form FormField FormFieldBoolean @@ -57,57 +15,17 @@ FormKey FormSqlType FormWidget FormWidgetCheck +FormWidgetComboBox +FormWidgetDateEntry FormWidgetEntry FormWidgetLabel FormWidgetSpin FormWidgetTextview -IS_FORM -IS_FORM_CLASS -IS_FORM_FIELD -IS_FORM_FIELD_BOOLEAN -IS_FORM_FIELD_BOOLEAN_CLASS -IS_FORM_FIELD_CLASS -IS_FORM_FIELD_DATETIME -IS_FORM_FIELD_DATETIME_CLASS -IS_FORM_FIELD_FLOAT -IS_FORM_FIELD_FLOAT_CLASS -IS_FORM_FIELD_INTEGER -IS_FORM_FIELD_INTEGER_CLASS -IS_FORM_FIELD_TEXT -IS_FORM_FIELD_TEXT_CLASS -IS_FORM_KEY -IS_FORM_KEY_CLASS -IS_FORM_WIDGET -IS_FORM_WIDGET_CHECK -IS_FORM_WIDGET_CHECK_CLASS -IS_FORM_WIDGET_CLASS -IS_FORM_WIDGET_ENTRY -IS_FORM_WIDGET_ENTRY_CLASS -IS_FORM_WIDGET_LABEL -IS_FORM_WIDGET_LABEL_CLASS -IS_FORM_WIDGET_SPIN -IS_FORM_WIDGET_SPIN_CLASS -IS_FORM_WIDGET_TEXTVIEW -IS_FORM_WIDGET_TEXTVIEW_CLASS -TYPE_FORM -TYPE_FORM_FIELD -TYPE_FORM_FIELD_BOOLEAN -TYPE_FORM_FIELD_DATETIME -TYPE_FORM_FIELD_FLOAT -TYPE_FORM_FIELD_INTEGER -TYPE_FORM_FIELD_TEXT -TYPE_FORM_KEY -TYPE_FORM_WIDGET -TYPE_FORM_WIDGET_CHECK -TYPE_FORM_WIDGET_ENTRY -TYPE_FORM_WIDGET_LABEL -TYPE_FORM_WIDGET_SPIN -TYPE_FORM_WIDGET_TEXTVIEW form_add_field +form_add_fields form_check form_clear form_field_boolean_clear -form_field_boolean_get_type form_field_boolean_get_value form_field_boolean_get_value_sql form_field_boolean_get_value_stringify @@ -116,7 +34,6 @@ form_field_boolean_new form_field_boolean_set_from_datamodel form_field_clear form_field_datetime_clear -form_field_datetime_get_type form_field_datetime_get_value form_field_datetime_get_value_sql form_field_datetime_get_value_stringify @@ -124,7 +41,6 @@ form_field_datetime_is_empty form_field_datetime_new form_field_datetime_set_from_datamodel form_field_float_clear -form_field_float_get_type form_field_float_get_value form_field_float_get_value_sql form_field_float_get_value_stringify @@ -132,12 +48,11 @@ form_field_float_is_empty form_field_float_new form_field_float_set_from_datamodel form_field_get_field_name -form_field_get_type +form_field_get_form_widget (field, Returns) form_field_get_value form_field_get_value_sql form_field_get_value_stringify form_field_integer_clear -form_field_integer_get_type form_field_integer_get_value form_field_integer_get_value_sql form_field_integer_get_value_stringify @@ -149,7 +64,6 @@ form_field_new form_field_new_from_form_widget form_field_set_from_datamodel form_field_text_clear -form_field_text_get_type form_field_text_get_value form_field_text_get_value_sql form_field_text_get_value_stringify @@ -157,42 +71,53 @@ form_field_text_is_empty form_field_text_new form_field_text_set_from_datamodel form_fill_from_datamodel +form_get_field_from_name form_get_sql -form_get_type +form_get_widget_from_name form_key_add_field +form_key_add_fields form_key_check form_key_field_is_key form_key_get_sql -form_key_get_type form_key_new form_key_remove_field form_new form_remove_field -form_widget_check_get_type +form_set_editable +form_set_sensitive form_widget_check_get_value_stringify form_widget_check_new +form_widget_check_set_editable form_widget_check_set_value_stringify -form_widget_entry_get_type +form_widget_combo_box_get_value_stringify +form_widget_combo_box_new +form_widget_combo_box_set_editable +form_widget_combo_box_set_value_stringify +form_widget_date_entry_get_value_stringify +form_widget_date_entry_new +form_widget_date_entry_set_editable +form_widget_date_entry_set_value_stringify form_widget_entry_get_value_stringify form_widget_entry_new +form_widget_entry_set_editable form_widget_entry_set_value_stringify -form_widget_get_type form_widget_get_value_stringify form_widget_get_widget -form_widget_label_get_type +form_widget_get_widget_name form_widget_label_get_value_stringify form_widget_label_new form_widget_label_set_value_stringify form_widget_new +form_widget_set_editable form_widget_set_from_glade form_widget_set_value_stringify -form_widget_spin_get_type form_widget_spin_get_value_stringify form_widget_spin_new +form_widget_spin_set_editable form_widget_spin_set_value_stringify -form_widget_textview_get_type form_widget_textview_get_value_stringify form_widget_textview_new +form_widget_textview_set_editable form_widget_textview_set_value_stringify @@ -216,10 +141,14 @@ libformwidget:Long_Description libformwidget:Short_Description libformwidgetcheck:Long_Description libformwidgetcheck:Short_Description +libformwidgetcombobox:Short_Description +libformwidgetdateentry:Long_Description +libformwidgetdateentry:Short_Description libformwidgetentry:Long_Description libformwidgetentry:Short_Description libformwidgetlabel:Long_Description libformwidgetlabel:Short_Description libformwidgetspin:Long_Description libformwidgetspin:Short_Description +libformwidgettextview:Long_Description libformwidgettextview:Short_Description diff --git a/docs/reference/libform.types b/docs/reference/libform.types index b9b0f95..caf278f 100644 --- a/docs/reference/libform.types +++ b/docs/reference/libform.types @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -17,6 +18,7 @@ form_get_type form_field_get_type form_field_boolean_get_type +form_field_datetime_get_type form_field_float_get_type form_field_integer_get_type form_field_text_get_type diff --git a/docs/reference/tmpl/libform-unused.sgml b/docs/reference/tmpl/libform-unused.sgml index ba4290b..53e0208 100644 --- a/docs/reference/tmpl/libform-unused.sgml +++ b/docs/reference/tmpl/libform-unused.sgml @@ -1,3 +1,598 @@ + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + +@obj: + + + + + + +@klass: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + @@ -8,6 +603,41 @@ @value: @Returns: + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + @@ -17,3 +647,59 @@ @glade: @Returns: + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + diff --git a/docs/reference/tmpl/libform.sgml b/docs/reference/tmpl/libform.sgml index bcdedbb..da0f667 100644 --- a/docs/reference/tmpl/libform.sgml +++ b/docs/reference/tmpl/libform.sgml @@ -17,151 +17,144 @@ Form - + - - + -@obj: - - - + -@klass: - - - + -@obj: +@Returns: - + -@klass: +@form: +@field: +@Returns: - + -@obj: +@form: +@field: +@Returns: - + +@form: +@Varargs: +@Returns: - + + - - +@form: +@Returns: - - + +@form: @Returns: - + -@Returns: - +@FORM_SQL_SELECT: +@FORM_SQL_INSERT: +@FORM_SQL_UPDATE: +@FORM_SQL_DELETE: - + @form: -@field: +@type: @Returns: - + @form: -@field: +@dm: +@row: @Returns: - + @form: +@field_name: @Returns: - + @form: +@widget_name: @Returns: - - - - - -@FORM_SQL_SELECT: -@FORM_SQL_INSERT: -@FORM_SQL_UPDATE: -@FORM_SQL_DELETE: - - + @form: -@type: -@Returns: +@editable: - + @form: -@dm: -@row: -@Returns: +@sensitive: diff --git a/docs/reference/tmpl/libformfield.sgml b/docs/reference/tmpl/libformfield.sgml index 4845e18..0c2a493 100644 --- a/docs/reference/tmpl/libformfield.sgml +++ b/docs/reference/tmpl/libformfield.sgml @@ -17,53 +17,6 @@ FormField - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - @@ -85,7 +38,7 @@ FormField - + @@ -93,20 +46,21 @@ FormField @Returns: - + +@fwidget: @Returns: - + -@fwidget: +@field: @Returns: diff --git a/docs/reference/tmpl/libformfieldboolean.sgml b/docs/reference/tmpl/libformfieldboolean.sgml index 96a81c4..e4c29f4 100644 --- a/docs/reference/tmpl/libformfieldboolean.sgml +++ b/docs/reference/tmpl/libformfieldboolean.sgml @@ -17,53 +17,6 @@ FormFieldBoolean - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - @@ -75,14 +28,6 @@ FormFieldBoolean - - - - - -@Returns: - - diff --git a/docs/reference/tmpl/libformfielddatetime.sgml b/docs/reference/tmpl/libformfielddatetime.sgml index 4d96d18..8b0f7b1 100644 --- a/docs/reference/tmpl/libformfielddatetime.sgml +++ b/docs/reference/tmpl/libformfielddatetime.sgml @@ -17,68 +17,22 @@ FormFieldDateTime - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - + -@obj: - - + -@parent: - - + -@Returns: - - diff --git a/docs/reference/tmpl/libformfieldfloat.sgml b/docs/reference/tmpl/libformfieldfloat.sgml index 3016dc1..9b028e1 100644 --- a/docs/reference/tmpl/libformfieldfloat.sgml +++ b/docs/reference/tmpl/libformfieldfloat.sgml @@ -17,53 +17,6 @@ FormFieldFloat - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - @@ -75,14 +28,6 @@ FormFieldFloat - - - - - -@Returns: - - diff --git a/docs/reference/tmpl/libformfieldinteger.sgml b/docs/reference/tmpl/libformfieldinteger.sgml index 1e91a9f..1066801 100644 --- a/docs/reference/tmpl/libformfieldinteger.sgml +++ b/docs/reference/tmpl/libformfieldinteger.sgml @@ -17,53 +17,6 @@ FormFieldInteger - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - @@ -75,14 +28,6 @@ FormFieldInteger - - - - - -@Returns: - - diff --git a/docs/reference/tmpl/libformfieldtext.sgml b/docs/reference/tmpl/libformfieldtext.sgml index c4d8965..80eeb4f 100644 --- a/docs/reference/tmpl/libformfieldtext.sgml +++ b/docs/reference/tmpl/libformfieldtext.sgml @@ -17,53 +17,6 @@ FormFieldText - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - @@ -75,14 +28,6 @@ FormFieldText - - - - - -@Returns: - - diff --git a/docs/reference/tmpl/libformkey.sgml b/docs/reference/tmpl/libformkey.sgml index 2683c34..e286eeb 100644 --- a/docs/reference/tmpl/libformkey.sgml +++ b/docs/reference/tmpl/libformkey.sgml @@ -17,60 +17,13 @@ FormKey - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - + @@ -78,21 +31,23 @@ FormKey @Returns: - + +@form_key: +@field: @Returns: - + @form_key: -@field: +@Varargs: @Returns: diff --git a/docs/reference/tmpl/libformwidget.sgml b/docs/reference/tmpl/libformwidget.sgml index 0aa68ab..b6f820d 100644 --- a/docs/reference/tmpl/libformwidget.sgml +++ b/docs/reference/tmpl/libformwidget.sgml @@ -17,53 +17,6 @@ FormWidget - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - @@ -80,7 +33,7 @@ FormWidget - + @@ -88,26 +41,27 @@ FormWidget @Returns: - + +@fwidget: +@glade: +@widget_name: @Returns: - + @fwidget: -@glade: -@widget_name: @Returns: - + @@ -135,3 +89,12 @@ FormWidget @Returns: + + + + + +@fwidget: +@editable: + + diff --git a/docs/reference/tmpl/libformwidgetcheck.sgml b/docs/reference/tmpl/libformwidgetcheck.sgml index 2f31241..18d9cd5 100644 --- a/docs/reference/tmpl/libformwidgetcheck.sgml +++ b/docs/reference/tmpl/libformwidgetcheck.sgml @@ -17,60 +17,13 @@ FormWidgetCheck - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - + @@ -78,30 +31,31 @@ FormWidgetCheck @Returns: - + +@widget: @Returns: - + -@widget: +@fwidget: +@value: @Returns: - + @fwidget: -@value: -@Returns: +@editable: diff --git a/docs/reference/tmpl/libformwidgetdateentry.sgml b/docs/reference/tmpl/libformwidgetdateentry.sgml new file mode 100644 index 0000000..f116887 --- /dev/null +++ b/docs/reference/tmpl/libformwidgetdateentry.sgml @@ -0,0 +1,71 @@ + +FormWidgetDateEntry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + +@widget: +@Returns: + + + + + + + +@fwidget: +@value: +@Returns: + + + + + + + +@fwidget: +@editable: + + diff --git a/docs/reference/tmpl/libformwidgetentry.sgml b/docs/reference/tmpl/libformwidgetentry.sgml index 8ddb267..603f004 100644 --- a/docs/reference/tmpl/libformwidgetentry.sgml +++ b/docs/reference/tmpl/libformwidgetentry.sgml @@ -17,60 +17,13 @@ FormWidgetEntry - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - + @@ -78,30 +31,31 @@ FormWidgetEntry @Returns: - + +@widget: @Returns: - + -@widget: +@fwidget: +@value: @Returns: - + @fwidget: -@value: -@Returns: +@editable: diff --git a/docs/reference/tmpl/libformwidgetlabel.sgml b/docs/reference/tmpl/libformwidgetlabel.sgml index a9dfbfc..7c033e7 100644 --- a/docs/reference/tmpl/libformwidgetlabel.sgml +++ b/docs/reference/tmpl/libformwidgetlabel.sgml @@ -17,67 +17,12 @@ FormWidgetLabel - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@Returns: - - diff --git a/docs/reference/tmpl/libformwidgetspin.sgml b/docs/reference/tmpl/libformwidgetspin.sgml index 4327007..3b2e1b4 100644 --- a/docs/reference/tmpl/libformwidgetspin.sgml +++ b/docs/reference/tmpl/libformwidgetspin.sgml @@ -17,60 +17,13 @@ FormWidgetSpin - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - + @@ -78,30 +31,31 @@ FormWidgetSpin @Returns: - + +@widget: @Returns: - + -@widget: +@fwidget: +@value: @Returns: - + @fwidget: -@value: -@Returns: +@editable: diff --git a/docs/reference/tmpl/libformwidgettextview.sgml b/docs/reference/tmpl/libformwidgettextview.sgml index a743b74..8b9e89d 100644 --- a/docs/reference/tmpl/libformwidgettextview.sgml +++ b/docs/reference/tmpl/libformwidgettextview.sgml @@ -17,60 +17,13 @@ FormWidgetTextview - - - - - - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - - - - - -@klass: - - - - - - - -@obj: - - - + @@ -78,30 +31,31 @@ FormWidgetTextview @Returns: - + +@widget: @Returns: - + -@widget: +@fwidget: +@value: @Returns: - + @fwidget: -@value: -@Returns: +@editable: diff --git a/src/fieldboolean.c b/src/fieldboolean.c index 1ffb6d6..2f23d82 100644 --- a/src/fieldboolean.c +++ b/src/fieldboolean.c @@ -140,7 +140,7 @@ const gchar "form-widget", &fw, NULL); - if (IS_FORM_WIDGET (fw) + if (IS_FORM_WIDGET (fw)) { ret = form_widget_get_value_stringify (fw); } diff --git a/src/form.c b/src/form.c index 907d475..935643c 100644 --- a/src/form.c +++ b/src/form.c @@ -129,8 +129,8 @@ Form /** * form_add_field: - * @form: - * @field: + * @form: a #Form object. + * @field: a #FormField object. * */ gboolean @@ -151,8 +151,8 @@ form_add_field (Form *form, FormField *field) /** * form_remove_field: - * @form: - * @field: + * @form: a #Form object. + * @field: a #FormField object. * */ gboolean @@ -173,7 +173,7 @@ form_remove_field (Form *form, FormField *field) /** * form_add_fields: - * @form: + * @form: a #Form object. * */ gboolean @@ -195,7 +195,7 @@ form_add_fields (Form *form, ...) /** * form_get_field_from_name: - * @form: + * @form: a #Form object. * @field_name: * */ @@ -224,7 +224,7 @@ FormField /** * form_get_widget_from_name: - * @form: + * @form: a #Form object. * @widget_name: * */ @@ -240,7 +240,12 @@ FormWidget while (fields != NULL) { widget = form_field_get_form_widget ((FormField *)fields->data); - + + if (strcmp (form_widget_get_widget_name (widget), widget_name) == 0) + { + widget_ret = widget; + break; + } fields = g_list_next (fields); } @@ -250,7 +255,7 @@ FormWidget /** * form_clear: - * @form: + * @form: a #Form object. * */ gboolean @@ -279,7 +284,7 @@ form_clear (Form *form) /** * form_check: - * @form: + * @form: a #Form object. * * Returns: TRUE if all obligatory fields are full. */ @@ -319,11 +324,60 @@ form_check (Form *form) return ret; } +/** + * form_set_sensitive: + * @form: a #Form object. + * @sensitive: whether to set every #Form's widget sensitive or not. + * + */ +void +form_set_sensitive (Form *form, gboolean sensitive) +{ + FormWidget *fwidget; + FormPrivate *priv = FORM_GET_PRIVATE (form); + GtkWidget *widget; + + GList *fields = g_list_first (priv->fields); + while (fields != NULL) + { + fwidget = form_field_get_form_widget ((FormField *)fields->data); + + widget = form_widget_get_widget (fwidget); + gtk_widget_set_sensitive (widget, sensitive); + + fields = g_list_next (fields); + } +} + +/** + * form_set_editable: + * @form: a #Form object. + * @editable: whether to set every #Form's widget editable or not. + * + */ +void +form_set_editable (Form *form, gboolean editable) +{ + FormWidget *fwidget; + FormPrivate *priv = FORM_GET_PRIVATE (form); + + GList *fields = g_list_first (priv->fields); + while (fields != NULL) + { + fwidget = form_field_get_form_widget ((FormField *)fields->data); + + form_widget_set_editable (fwidget, editable); + + fields = g_list_next (fields); + } +} + /** * form_get_sql: - * @form: - * @type: + * @form: a #Form object. + * @type: SQL's type that returns. * + * Returns: the SQL string. */ gchar *form_get_sql (Form *form, FormSqlType type) @@ -417,6 +471,13 @@ gchar return sql; } +/** + * form_fill_from_datamodel: + * @form: a #Form object. + * @dm: the #GdaDataModel from which fill the #Form. + * @row: the #GdaDataModel's row from which read data. + * + */ gboolean form_fill_from_datamodel (Form *form, GdaDataModel *dm, gint row) { diff --git a/src/formkey.c b/src/formkey.c index 5aeee28..8789b44 100644 --- a/src/formkey.c +++ b/src/formkey.c @@ -91,8 +91,8 @@ FormKey /** * form_key_add_field: - * @form_key: - * @field: + * @form_key: a #FormKey object. + * @field: a #FormField object. * */ gboolean @@ -113,8 +113,8 @@ form_key_add_field (FormKey *form_key, FormField *field) /** * form_key_remove_field: - * @form_key: - * @field: + * @form_key: a #FormKey object. + * @field: a #FormField object. * */ gboolean @@ -135,7 +135,7 @@ form_key_remove_field (FormKey *form_key, FormField *field) /** * form_key_add_fields: - * @form_key: + * @form_key: a #FormKey object. * */ gboolean @@ -157,7 +157,7 @@ form_key_add_fields (FormKey *form_key, ...) /** * form_key_check: - * @form_key: + * @form_key: a #FormKey object. * * Returns: TRUE if all obligatory fields are full. */ @@ -189,7 +189,7 @@ form_key_check (FormKey *form_key) /** * form_key_get_sql: - * @form_key: + * @form_key: a #FormKey object. * */ gchar @@ -229,8 +229,8 @@ gchar /** * form_key_field_is_key: - * @form_key: - * @field: + * @form_key: a #FormKey object. + * @field: a #FormField object. * * Returns: TRUE if @field is part of @form_key. */ diff --git a/src/libform.h b/src/libform.h index 23fbdb2..316db37 100644 --- a/src/libform.h +++ b/src/libform.h @@ -70,6 +70,9 @@ gboolean form_clear (Form *form); gboolean form_check (Form *form); +void form_set_sensitive (Form *form, gboolean sensitive); +void form_set_editable (Form *form, gboolean editable); + typedef enum { FORM_SQL_SELECT, diff --git a/src/libformwidget.h b/src/libformwidget.h index f0d2887..97c5154 100644 --- a/src/libformwidget.h +++ b/src/libformwidget.h @@ -50,6 +50,8 @@ struct _FormWidgetClass const gchar *(*get_value_stringify) (FormWidget *fwidget); gboolean (*set_value_stringify) (FormWidget *fwidget, const gchar *value); + + void (*set_editable) (FormWidget *fwidget, gboolean editable); }; GType form_widget_get_type (void) G_GNUC_CONST; @@ -66,6 +68,8 @@ const gchar *form_widget_get_value_stringify (FormWidget *fwidget); gboolean form_widget_set_value_stringify (FormWidget *fwidget, const gchar *value); +void form_widget_set_editable (FormWidget *fwidget, gboolean editable); + G_END_DECLS diff --git a/src/libformwidgetcheck.h b/src/libformwidgetcheck.h index d0ccb0d..0cda388 100644 --- a/src/libformwidgetcheck.h +++ b/src/libformwidgetcheck.h @@ -54,6 +54,8 @@ const gchar *form_widget_check_get_value_stringify (FormWidget *widget); gboolean form_widget_check_set_value_stringify (FormWidget *fwidget, const gchar *value); +void form_widget_check_set_editable (FormWidget *fwidget, gboolean editable); + G_END_DECLS diff --git a/src/libformwidgetcombobox.h b/src/libformwidgetcombobox.h index a0ed57c..db01d71 100644 --- a/src/libformwidgetcombobox.h +++ b/src/libformwidgetcombobox.h @@ -54,6 +54,8 @@ const gchar *form_widget_combo_box_get_value_stringify (FormWidget *widget); gboolean form_widget_combo_box_set_value_stringify (FormWidget *fwidget, const gchar *value); +void form_widget_combo_box_set_editable (FormWidget *fwidget, gboolean editable); + G_END_DECLS diff --git a/src/libformwidgetdateentry.h b/src/libformwidgetdateentry.h index fcf7033..dd7ae84 100644 --- a/src/libformwidgetdateentry.h +++ b/src/libformwidgetdateentry.h @@ -54,6 +54,8 @@ const gchar *form_widget_date_entry_get_value_stringify (FormWidget *widget); gboolean form_widget_date_entry_set_value_stringify (FormWidget *fwidget, const gchar *value); +void form_widget_date_entry_set_editable (FormWidget *fwidget, gboolean editable); + G_END_DECLS diff --git a/src/libformwidgetentry.h b/src/libformwidgetentry.h index 11d1de3..891b0cb 100644 --- a/src/libformwidgetentry.h +++ b/src/libformwidgetentry.h @@ -54,6 +54,8 @@ const gchar *form_widget_entry_get_value_stringify (FormWidget *widget); gboolean form_widget_entry_set_value_stringify (FormWidget *fwidget, const gchar *value); +void form_widget_entry_set_editable (FormWidget *fwidget, gboolean editable); + G_END_DECLS diff --git a/src/libformwidgetspin.h b/src/libformwidgetspin.h index b58450e..ea0fcb1 100644 --- a/src/libformwidgetspin.h +++ b/src/libformwidgetspin.h @@ -54,6 +54,8 @@ const gchar *form_widget_spin_get_value_stringify (FormWidget *widget); gboolean form_widget_spin_set_value_stringify (FormWidget *fwidget, const gchar *value); +void form_widget_spin_set_editable (FormWidget *fwidget, gboolean editable); + G_END_DECLS diff --git a/src/libformwidgettextview.h b/src/libformwidgettextview.h index 9f9ffe5..1d9b2cd 100644 --- a/src/libformwidgettextview.h +++ b/src/libformwidgettextview.h @@ -54,6 +54,8 @@ const gchar *form_widget_textview_get_value_stringify (FormWidget *widget); gboolean form_widget_textview_set_value_stringify (FormWidget *fwidget, const gchar *value); +void form_widget_textview_set_editable (FormWidget *fwidget, gboolean editable); + G_END_DECLS diff --git a/src/widget.c b/src/widget.c index eac6f27..8c64011 100644 --- a/src/widget.c +++ b/src/widget.c @@ -82,6 +82,10 @@ form_widget_class_init (FormWidgetClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + klass->get_value_stringify = NULL; + klass->set_value_stringify = NULL; + klass->set_editable = NULL; + object_class->set_property = form_widget_set_property; object_class->get_property = form_widget_get_property; @@ -179,7 +183,7 @@ const gchar const gchar *form_widget_get_value_stringify (FormWidget *fwidget) { - if (IS_FORM_WIDGET (fwidget)) + if (IS_FORM_WIDGET (fwidget) && FORM_WIDGET_GET_CLASS (fwidget)->get_value_stringify != NULL) { FORM_WIDGET_GET_CLASS (fwidget)->get_value_stringify (fwidget); } @@ -194,12 +198,27 @@ const gchar gboolean form_widget_set_value_stringify (FormWidget *fwidget, const gchar *value) { - if (IS_FORM_WIDGET (fwidget)) + if (IS_FORM_WIDGET (fwidget) && FORM_WIDGET_GET_CLASS (fwidget)->set_value_stringify != NULL) { FORM_WIDGET_GET_CLASS (fwidget)->set_value_stringify (fwidget, value); } } +/** + * form_widget_set_editable: + * @fwidget: + * @editable: + * + */ +void +form_widget_set_editable (FormWidget *fwidget, gboolean editable) +{ + if (IS_FORM_WIDGET (fwidget) && FORM_WIDGET_GET_CLASS (fwidget)->set_editable != NULL) + { + FORM_WIDGET_GET_CLASS (fwidget)->set_editable (fwidget, editable); + } +} + /* PRIVATE */ static void form_widget_set_property (GObject *object, diff --git a/src/widgetcheck.c b/src/widgetcheck.c index f8c6a46..5b82aa8 100644 --- a/src/widgetcheck.c +++ b/src/widgetcheck.c @@ -88,6 +88,7 @@ form_widget_check_class_init (FormWidgetCheckClass *klass) widget_class->get_value_stringify = form_widget_check_get_value_stringify; widget_class->set_value_stringify = form_widget_check_set_value_stringify; + widget_class->set_editable = form_widget_check_set_editable; g_type_class_add_private (object_class, sizeof (FormWidgetCheckPrivate)); } @@ -147,6 +148,24 @@ form_widget_check_set_value_stringify (FormWidget *fwidget, const gchar *value) return ret; } +/** + * form_widget_check_set_editable: + * @fwidget: a #FormWidget object. + * @editable: + * + */ +void +form_widget_check_set_editable (FormWidget *fwidget, gboolean editable) +{ + GtkWidget *w; + + g_object_get (G_OBJECT (fwidget), + "widget", &w, + NULL); + + gtk_widget_set_sensitive (w, editable); +} + /* PRIVATE */ static void form_widget_check_set_property (GObject *object, diff --git a/src/widgetcombobox.c b/src/widgetcombobox.c index e9cb62c..7e759a4 100644 --- a/src/widgetcombobox.c +++ b/src/widgetcombobox.c @@ -86,6 +86,7 @@ form_widget_combo_box_class_init (FormWidgetComboBoxClass *klass) widget_class->get_value_stringify = form_widget_combo_box_get_value_stringify; widget_class->set_value_stringify = form_widget_combo_box_set_value_stringify; + widget_class->set_editable = form_widget_combo_box_set_editable; g_object_class_install_property (object_class, PROP_COLUMN_FIELD, g_param_spec_int ("column-field", @@ -202,6 +203,24 @@ form_widget_combo_box_set_value_stringify (FormWidget *fwidget, const gchar *val return ret; } +/** + * form_widget_combo_box_set_editable: + * @fwidget: a #FormWidget object. + * @editable: + * + */ +void +form_widget_combo_box_set_editable (FormWidget *fwidget, gboolean editable) +{ + GtkWidget *w; + + g_object_get (G_OBJECT (fwidget), + "widget", &w, + NULL); + + gtk_widget_set_sensitive (w, editable); +} + /* PRIVATE */ static void form_widget_combo_box_set_property (GObject *object, diff --git a/src/widgetdateentry.c b/src/widgetdateentry.c index 61b3ed6..27ce575 100644 --- a/src/widgetdateentry.c +++ b/src/widgetdateentry.c @@ -89,6 +89,7 @@ form_widget_date_entry_class_init (FormWidgetDateEntryClass *klass) widget_class->get_value_stringify = form_widget_date_entry_get_value_stringify; widget_class->set_value_stringify = form_widget_date_entry_set_value_stringify; + widget_class->set_editable = form_widget_date_entry_set_editable; g_object_class_install_property (object_class, PROP_DATE_FORMAT, g_param_spec_string ("date-format", @@ -164,6 +165,24 @@ form_widget_date_entry_set_value_stringify (FormWidget *fwidget, const gchar *va return ret; } +/** + * form_widget_date_entry_set_editable: + * @fwidget: + * @editable: + * + */ +void +form_widget_date_entry_set_editable (FormWidget *fwidget, gboolean editable) +{ + GtkWidget *w; + + g_object_get (G_OBJECT (fwidget), + "widget", &w, + NULL); + + gtk_date_entry_set_editable (GTK_DATE_ENTRY (w), editable); +} + /* PRIVATE */ static void form_widget_date_entry_set_property (GObject *object, diff --git a/src/widgetentry.c b/src/widgetentry.c index c91424e..aceaa42 100644 --- a/src/widgetentry.c +++ b/src/widgetentry.c @@ -84,6 +84,7 @@ form_widget_entry_class_init (FormWidgetEntryClass *klass) widget_class->get_value_stringify = form_widget_entry_get_value_stringify; widget_class->set_value_stringify = form_widget_entry_set_value_stringify; + widget_class->set_editable = form_widget_entry_set_editable; g_type_class_add_private (object_class, sizeof (FormWidgetEntryPrivate)); } @@ -140,6 +141,24 @@ form_widget_entry_set_value_stringify (FormWidget *fwidget, const gchar *value) return ret; } +/** + * form_widget_set_editable: + * @fwidget: + * @editable: + * + */ +void +form_widget_entry_set_editable (FormWidget *fwidget, gboolean editable) +{ + GtkWidget *w; + + g_object_get (G_OBJECT (fwidget), + "widget", &w, + NULL); + + gtk_editable_set_editable (GTK_EDITABLE (w), editable); +} + /* PRIVATE */ static void form_widget_entry_set_property (GObject *object, diff --git a/src/widgetspin.c b/src/widgetspin.c index dfd0882..850f25d 100644 --- a/src/widgetspin.c +++ b/src/widgetspin.c @@ -86,6 +86,7 @@ form_widget_spin_class_init (FormWidgetSpinClass *klass) widget_class->get_value_stringify = form_widget_spin_get_value_stringify; widget_class->set_value_stringify = form_widget_spin_set_value_stringify; + widget_class->set_editable = form_widget_spin_set_editable; g_type_class_add_private (object_class, sizeof (FormWidgetSpinPrivate)); } @@ -108,7 +109,7 @@ FormWidget /** * form_widget_spin_get_value_stringify: - * @widget: + * @widget: a #FormWidget object. * */ const gchar @@ -124,7 +125,7 @@ const gchar /** * form_widget_spin_set_value_stringify: - * @fwidget: + * @fwidget: a #FormWidget object. * @value: * */ @@ -145,6 +146,24 @@ form_widget_spin_set_value_stringify (FormWidget *fwidget, const gchar *value) return ret; } +/** + * form_widget_spin_set_editable: + * @fwidget: a #FormWidget object. + * @editable: + * + */ +void +form_widget_spin_set_editable (FormWidget *fwidget, gboolean editable) +{ + GtkWidget *w; + + g_object_get (G_OBJECT (fwidget), + "widget", &w, + NULL); + + gtk_editable_set_editable (GTK_EDITABLE (w), editable); +} + /* PRIVATE */ static void form_widget_spin_set_property (GObject *object, diff --git a/src/widgettextview.c b/src/widgettextview.c index 787abce..cc80640 100644 --- a/src/widgettextview.c +++ b/src/widgettextview.c @@ -84,6 +84,7 @@ form_widget_textview_class_init (FormWidgetTextviewClass *klass) widget_class->get_value_stringify = form_widget_textview_get_value_stringify; widget_class->set_value_stringify = form_widget_textview_set_value_stringify; + widget_class->set_editable = form_widget_textview_set_editable; g_type_class_add_private (object_class, sizeof (FormWidgetTextviewPrivate)); } @@ -106,7 +107,7 @@ FormWidget /** * form_widget_textview_get_value_stringify: - * @widget: + * @widget: a #FormWidget object. * */ const gchar @@ -129,7 +130,7 @@ const gchar /** * form_widget_textview_set_value_stringify: - * @fwidget: + * @fwidget: a #FormWidget object. * @value: * */ @@ -152,6 +153,24 @@ form_widget_textview_set_value_stringify (FormWidget *fwidget, const gchar *valu return ret; } +/** + * form_widget_textview_set_editable: + * @fwidget: a #FormWidget object. + * @editable: + * + */ +void +form_widget_textview_set_editable (FormWidget *fwidget, gboolean editable) +{ + GtkWidget *w; + + g_object_get (G_OBJECT (fwidget), + "widget", &w, + NULL); + + gtk_text_view_set_editable (GTK_TEXT_VIEW (w), editable); +} + /* PRIVATE */ static void form_widget_textview_set_property (GObject *object, diff --git a/test/main.c b/test/main.c index 053a72f..bdb519a 100644 --- a/test/main.c +++ b/test/main.c @@ -57,6 +57,8 @@ FormWidget *wcombobox; GtkWidget *w; GtkWidget *txtvSql; +GtkWidget *tbtnEditable; +GtkWidget *tbtnSensitive; void on_btnClear_clicked (GtkButton *button, @@ -81,6 +83,38 @@ on_btnCheck_clicked (GtkButton *button, } } +void +on_tbtnEditable_toggled (GtkToggleButton *button, + gpointer user_data) +{ + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tbtnEditable))) + { + gtk_button_set_label (GTK_BUTTON (tbtnEditable), "Not Editable"); + form_set_editable (form, FALSE); + } + else + { + gtk_button_set_label (GTK_BUTTON (tbtnEditable), "Editable"); + form_set_editable (form, TRUE); + } +} + +void +on_tbtnSensitive_toggled (GtkToggleButton *button, + gpointer user_data) +{ + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tbtnSensitive))) + { + gtk_button_set_label (GTK_BUTTON (tbtnSensitive), "Not Sensitive"); + form_set_sensitive (form, FALSE); + } + else + { + gtk_button_set_label (GTK_BUTTON (tbtnSensitive), "Sensitive"); + form_set_sensitive (form, TRUE); + } +} + void on_btnSqlSelect_clicked (GtkButton *button, gpointer user_data) @@ -194,6 +228,9 @@ main (int argc, char **argv) w = glade_xml_get_widget (glade, "wMain"); + tbtnEditable = glade_xml_get_widget (glade, "tbtnEditable"); + tbtnSensitive = glade_xml_get_widget (glade, "tbtnSensitive"); + form = form_new (); if (form == NULL) return 0; diff --git a/test/test.glade b/test/test.glade index 40c1914..d01c748 100644 --- a/test/test.glade +++ b/test/test.glade @@ -569,35 +569,81 @@ - + True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 + False + 4 True - True True gtk-clear True GTK_RELIEF_NORMAL True - + + + 0 + False + False + True - True True - Check Form + Check + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + True + Editable True GTK_RELIEF_NORMAL True - + False + False + + + 0 + False + False + + + + + + True + True + Sensitive + True + GTK_RELIEF_NORMAL + True + False + False + + + + 0 + False + False + @@ -610,7 +656,7 @@ True - GTK_BUTTONBOX_DEFAULT_STYLE + GTK_BUTTONBOX_START 0