/*
* GtkFormDecoder widget for GTK+
*
- * Copyright (C) 2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2011-2012 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
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,
/*
* GtkFormDecoder widget for GTK+
*
- * Copyright (C) 2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2011-2012 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
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,