aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-09-17 10:58:58 +0800
committerChris Toshok <toshok@src.gnome.org>2001-09-17 10:58:58 +0800
commit6d1f104d1e22eff69151ef4a3a0b25863c392fdb (patch)
tree9c5a29080a3395a3d147e717b4de7728360170d6 /widgets/misc
parent04b1bded1c8809e85950d6b08ccafcedca8213fb (diff)
downloadgsoc2013-evolution-6d1f104d1e22eff69151ef4a3a0b25863c392fdb.tar
gsoc2013-evolution-6d1f104d1e22eff69151ef4a3a0b25863c392fdb.tar.gz
gsoc2013-evolution-6d1f104d1e22eff69151ef4a3a0b25863c392fdb.tar.bz2
gsoc2013-evolution-6d1f104d1e22eff69151ef4a3a0b25863c392fdb.tar.lz
gsoc2013-evolution-6d1f104d1e22eff69151ef4a3a0b25863c392fdb.tar.xz
gsoc2013-evolution-6d1f104d1e22eff69151ef4a3a0b25863c392fdb.tar.zst
gsoc2013-evolution-6d1f104d1e22eff69151ef4a3a0b25863c392fdb.zip
add prototype for e_date_edit_set_editable.
2001-09-16 Chris Toshok <toshok@ximian.com> * e-dateedit.h: add prototype for e_date_edit_set_editable. * e-dateedit.c (e_date_edit_set_editable): new function, analogous to gtk_entry_set_editable: let's the user select but not edit (or in this case, bring up the calendar view.) svn path=/trunk/; revision=12867
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-dateedit.c21
-rw-r--r--widgets/misc/e-dateedit.h4
3 files changed, 33 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index b57cc24d41..57b8ebff70 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,11 @@
+2001-09-16 Chris Toshok <toshok@ximian.com>
+
+ * e-dateedit.h: add prototype for e_date_edit_set_editable.
+
+ * e-dateedit.c (e_date_edit_set_editable): new function, analogous
+ to gtk_entry_set_editable: let's the user select but not edit (or
+ in this case, bring up the calendar view.)
+
2001-09-13 Jeffrey Stedfast <fejj@ximian.com>
* e-search-bar.c (set_dropdown): Don't unref the old dropdown, we
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index e046b65517..32e5aa194d 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -472,6 +472,27 @@ e_date_edit_destroy (GtkObject *object)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
+/**
+ * e_date_edit_set_editable:
+ * @dedit: an #EDateEdit widget.
+ * @editable: whether or not the widget should accept edits.
+ *
+ * Allows the programmer to disallow editing (and the popping up of
+ * the calendar widget), while still allowing the user to select the
+ * date from the GtkEntry.
+ */
+void
+e_date_edit_set_editable (EDateEdit *dedit, gboolean editable)
+{
+ EDateEditPrivate *priv;
+
+ g_return_if_fail (E_IS_DATE_EDIT (dedit));
+
+ priv = dedit->priv;
+
+ gtk_entry_set_editable (GTK_ENTRY (priv->date_entry), editable);
+ gtk_widget_set_sensitive (priv->date_button, editable);
+}
static void
e_date_edit_forall (GtkContainer *container,
diff --git a/widgets/misc/e-dateedit.h b/widgets/misc/e-dateedit.h
index 61d2b1858d..76fdb06bf9 100644
--- a/widgets/misc/e-dateedit.h
+++ b/widgets/misc/e-dateedit.h
@@ -81,6 +81,10 @@ struct _EDateEditClass {
guint e_date_edit_get_type (void);
GtkWidget* e_date_edit_new (void);
+/* Analogous to gtk_entry_set_editable. disable editing, while still
+ allowing selection. */
+void e_date_edit_set_editable (EDateEdit *dedit, gboolean editable);
+
/* Returns TRUE if the last date and time set were valid. The date and time
are only set when the user hits Return or switches keyboard focus, or
selects a date or time from the popup. */