From: Andrea Zagli Date: Wed, 19 Dec 2012 10:04:36 +0000 (+0100) Subject: Added functions GtkFormDecoder::set_editable and get. X-Git-Tag: 0.5.0~4 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=07336cc720c9fb0685c68eebdc8af01bd0ed9cd6;p=libgtkform Added functions GtkFormDecoder::set_editable and get. --- diff --git a/libgtkformui/gtkformdecoder.c b/libgtkformui/gtkformdecoder.c index eed709c..2620e8d 100644 --- a/libgtkformui/gtkformdecoder.c +++ b/libgtkformui/gtkformdecoder.c @@ -1,7 +1,7 @@ /* * GtkFormDecoder widget for GTK+ * - * Copyright (C) 2011 Andrea Zagli + * Copyright (C) 2011-2012 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -557,6 +557,26 @@ gtk_form_decoder_btn_browse_is_visible (GtkFormDecoder *decoder) return gtk_widget_get_visible (priv->btn_browse); } +void +gtk_form_decoder_set_editable (GtkFormDecoder *decoder, gboolean editable) +{ + GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); + + gtk_widget_set_sensitive (priv->btn_new, editable); + gtk_widget_set_sensitive (priv->btn_open, editable); + gtk_widget_set_sensitive (priv->btn_browse, editable); + + gtk_editable_set_editable (GTK_EDITABLE (priv->txt_decoded), editable && (priv->completion_dm != NULL)); +} + +gboolean +gtk_form_decoder_get_editable (GtkFormDecoder *decoder) +{ + GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); + + return (gtk_widget_is_sensitive (priv->btn_new)); +} + void gtk_form_decoder_set_completion (GtkFormDecoder *decoder, const gchar *sql, diff --git a/libgtkformui/gtkformdecoder.h b/libgtkformui/gtkformdecoder.h index d37d681..fb092db 100644 --- a/libgtkformui/gtkformdecoder.h +++ b/libgtkformui/gtkformdecoder.h @@ -1,7 +1,7 @@ /* * GtkFormDecoder widget for GTK+ * - * Copyright (C) 2011 Andrea Zagli + * Copyright (C) 2011-2012 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -76,6 +76,9 @@ gboolean gtk_form_decoder_btn_new_is_visible (GtkFormDecoder *decoder); gboolean gtk_form_decoder_btn_open_is_visible (GtkFormDecoder *decoder); gboolean gtk_form_decoder_btn_browse_is_visible (GtkFormDecoder *decoder); +void gtk_form_decoder_set_editable (GtkFormDecoder *decoder, gboolean editable); +gboolean gtk_form_decoder_get_editable (GtkFormDecoder *decoder); + void gtk_form_decoder_set_completion (GtkFormDecoder *decoder, const gchar *sql, GdaDataModel *data_model,