aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gncal-full-day.c
diff options
context:
space:
mode:
authorNat Friedman <nat@nat.org>1999-01-20 15:01:10 +0800
committerNat Friedman <nat@src.gnome.org>1999-01-20 15:01:10 +0800
commite79ebe3019e4e30b6105f2a36b0372f8ff51bc93 (patch)
treef19847918794e93eabd8df60e2926379d5220dad /calendar/gui/gncal-full-day.c
parentd2ef9770157ef4c8832cd330a91818d0ae929ff2 (diff)
downloadgsoc2013-evolution-e79ebe3019e4e30b6105f2a36b0372f8ff51bc93.tar
gsoc2013-evolution-e79ebe3019e4e30b6105f2a36b0372f8ff51bc93.tar.gz
gsoc2013-evolution-e79ebe3019e4e30b6105f2a36b0372f8ff51bc93.tar.bz2
gsoc2013-evolution-e79ebe3019e4e30b6105f2a36b0372f8ff51bc93.tar.lz
gsoc2013-evolution-e79ebe3019e4e30b6105f2a36b0372f8ff51bc93.tar.xz
gsoc2013-evolution-e79ebe3019e4e30b6105f2a36b0372f8ff51bc93.tar.zst
gsoc2013-evolution-e79ebe3019e4e30b6105f2a36b0372f8ff51bc93.zip
Only trap printable characters such that hotkeys work. (UNSELECT_TIMEOUT):
1999-01-20 Nat Friedman <nat@nat.org> * gncal-full-day.c (gncal_full_day_key_press): Only trap printable characters such that hotkeys work. (UNSELECT_TIMEOUT): Changed to 0. Much saner behavior. * prop.c (properties): Connect gnome_help_pbox_display to the GnomePropertyBox help button. svn path=/trunk/; revision=615
Diffstat (limited to 'calendar/gui/gncal-full-day.c')
-rw-r--r--calendar/gui/gncal-full-day.c56
1 files changed, 32 insertions, 24 deletions
diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c
index 402c19acee..343eb1281c 100644
--- a/calendar/gui/gncal-full-day.c
+++ b/calendar/gui/gncal-full-day.c
@@ -24,7 +24,7 @@
#define HANDLE_SIZE 8
#define MIN_WIDTH 200
#define XOR_RECT_WIDTH 2
-#define UNSELECT_TIMEOUT 150 /* ms */
+#define UNSELECT_TIMEOUT 0 /* ms */
/* Size of the pixmaps */
#define DECOR_WIDTH 16
@@ -109,7 +109,6 @@ static void gncal_full_day_forall (GtkContainer *container,
static void range_activated (GncalFullDay *fullday);
-
static GtkContainerClass *parent_class;
static int fullday_signals[LAST_SIGNAL] = { 0 };
@@ -1816,10 +1815,10 @@ gncal_full_day_button_release (GtkWidget *widget, GdkEventButton *event)
break;
case DRAG_SELECT:
- if ((event->time - di->click_time) < UNSELECT_TIMEOUT)
- di->sel_rows_used = 0;
- else
- recompute_motion (fullday, y);
+ if ((event->time - di->click_time) < UNSELECT_TIMEOUT)
+ di->sel_rows_used = 0;
+ else
+ recompute_motion (fullday, y);
gdk_pointer_ungrab (event->time);
@@ -1960,28 +1959,37 @@ gncal_full_day_key_press (GtkWidget *widget, GdkEventKey *event)
return TRUE;
}
- if (event->length > 0) {
- /* This means some printable key was pressed */
-
- gtk_signal_emit (GTK_OBJECT (fullday), fullday_signals[RANGE_ACTIVATED]);
-
- /* Find the new child, which should hopefully be focused, and insert the keypress */
-
- for (children = fullday->children; children; children = children->next) {
- child = children->data;
+ /*
+ * If a non-printable key was pressed, bail. Otherwise, begin
+ * editing the appointment.
+ */
+ if ((event->keyval < 0x20) || (event->keyval > 0xFF)
+ || (event->length == 0) || (event->state & GDK_CONTROL_MASK)
+ || (event->state & GDK_MOD1_MASK))
+ return FALSE;
+
+ gtk_signal_emit (GTK_OBJECT (fullday),
+ fullday_signals[RANGE_ACTIVATED]);
+
+ /*
+ * Find the new child, which should hopefully be focused, and
+ * insert the keypress.
+ */
+ for (children = fullday->children; children; children = children->next)
+ {
+ child = children->data;
- if (GTK_WIDGET_HAS_FOCUS (child->widget)) {
- pos = gtk_text_get_length (GTK_TEXT (child->widget));
+ if (GTK_WIDGET_HAS_FOCUS (child->widget)) {
+ pos = gtk_text_get_length (GTK_TEXT (child->widget));
- gtk_editable_insert_text (GTK_EDITABLE (child->widget),
- event->string,
- event->length,
- &pos);
+ gtk_editable_insert_text (GTK_EDITABLE (child->widget),
+ event->string,
+ event->length,
+ &pos);
- return TRUE;
- }
+ return TRUE;
}
- }
+ }
return FALSE;
}