[evolution-patches] patche for bug 44682, Shift+F10 to active popup menu on day/week view
- From: Bolian Yin <bolian yin sun com>
- To: rodrigo ximian com, jpr ximian com
- Cc: evolution-patches lists ximian com
- Subject: [evolution-patches] patche for bug 44682, Shift+F10 to active popup menu on day/week view
- Date: Tue, 17 Jun 2003 15:52:57 +0800
Hi,
Can you give it a quick review? I have more patches depend on this one.
All the patches are part of the evolution accessibility project, you may
have heard about it. About more information you can email to
sceri-evolution-acc sun com
This is Evolution Calendar Keyboard Navigation Fix.
patch for bug 44682, http://bugzilla.ximian.com/show_bug.cgi?id=44682
It also include a fix for gal/widgets/e-gui-utils.c
Regards, Bolian
Index: e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.196
diff -u -r1.196 e-day-view.c
--- e-day-view.c 2 Jun 2003 14:19:27 -0000 1.196
+++ e-day-view.c 13 Jun 2003 04:02:28 -0000
@@ -144,8 +144,11 @@
GdkEventFocus *event);
static gint e_day_view_focus_out (GtkWidget *widget,
GdkEventFocus *event);
-static gint e_day_view_key_press (GtkWidget *widget,
- GdkEventKey *event);
+static gboolean e_day_view_key_press (GtkWidget *widget,
+ GdkEventKey *event);
+static gboolean e_day_view_do_key_press (GtkWidget *widget,
+ GdkEventKey *event);
+static gboolean e_day_view_popup_menu (GtkWidget *widget);
static void e_day_view_cursor_key_up_shifted (EDayView *day_view,
GdkEventKey *event);
static void e_day_view_cursor_key_down_shifted (EDayView *day_view,
@@ -249,6 +252,11 @@
GdkEventButton *bevent,
gint day,
gint event_num);
+static void e_day_view_show_popup_menu (EDayView *day_view,
+ GdkEvent *gdk_event,
+ gint day,
+ gint event_num);
+
static void e_day_view_recalc_day_starts (EDayView *day_view,
time_t start_time);
@@ -506,14 +514,15 @@
widget_class->focus_in_event = e_day_view_focus_in;
widget_class->focus_out_event = e_day_view_focus_out;
widget_class->key_press_event = e_day_view_key_press;
+ widget_class->popup_menu = e_day_view_popup_menu;
class->selection_changed = NULL;
/* clipboard atom */
if (!clipboard_atom)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-}
+}
static void
e_day_view_init (EDayView *day_view)
@@ -3748,10 +3757,10 @@
}
static void
-e_day_view_on_event_right_click (EDayView *day_view,
- GdkEventButton *bevent,
- gint day,
- gint event_num)
+e_day_view_show_popup_menu (EDayView *day_view,
+ GdkEvent *gdk_event,
+ gint day,
+ gint event_num)
{
EDayViewEvent *event;
int have_selection;
@@ -3814,7 +3823,27 @@
popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, day_view);
g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), day_view);
- e_popup_menu (popup, (GdkEvent *) bevent);
+ e_popup_menu (popup, gdk_event);
+}
+
+static gboolean
+e_day_view_popup_menu (GtkWidget *widget)
+{
+ EDayView *day_view = E_DAY_VIEW (widget);
+ e_day_view_show_popup_menu (day_view, NULL,
+ day_view->editing_event_day,
+ day_view->editing_event_num);
+ return TRUE;
+}
+
+static void
+e_day_view_on_event_right_click (EDayView *day_view,
+ GdkEventButton *bevent,
+ gint day,
+ gint event_num)
+{
+ e_day_view_show_popup_menu (day_view, (GdkEvent*)bevent,
+ day, event_num);
}
static void
@@ -5585,9 +5614,8 @@
return 0;
}
-
-static gint
-e_day_view_key_press (GtkWidget *widget, GdkEventKey *event)
+static gboolean
+e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
{
EDayView *day_view;
CalComponent *comp;
@@ -5739,6 +5767,17 @@
return TRUE;
}
+static gboolean
+e_day_view_key_press (GtkWidget *widget, GdkEventKey *event)
+{
+ gboolean handled = FALSE;
+ handled = e_day_view_do_key_press (widget, event);
+
+ /* if not handled, try key bindings */
+ if (!handled)
+ handled = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+ return handled;
+}
static void
e_day_view_cursor_key_up_shifted (EDayView *day_view, GdkEventKey *event)
Index: e-week-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-week-view.c,v
retrieving revision 1.164
diff -u -r1.164 e-week-view.c
--- e-week-view.c 2 Jun 2003 14:19:26 -0000 1.164
+++ e-week-view.c 13 Jun 2003 04:02:53 -0000
@@ -174,7 +174,11 @@
static gboolean e_week_view_on_jump_button_event (GnomeCanvasItem *item,
GdkEvent *event,
EWeekView *week_view);
-static gint e_week_view_key_press (GtkWidget *widget, GdkEventKey *event);
+static gboolean e_week_view_key_press (GtkWidget *widget, GdkEventKey *event);
+static gboolean e_week_view_do_key_press (GtkWidget *widget,
+ GdkEventKey *event);
+static gboolean e_week_view_popup_menu (GtkWidget *widget);
+
static void e_week_view_on_new_appointment (GtkWidget *widget,
gpointer data);
static void e_week_view_on_new_event (GtkWidget *widget,
@@ -238,7 +242,6 @@
static void e_week_view_cancel_layout (EWeekView *week_view);
static gboolean e_week_view_layout_timeout_cb (gpointer data);
-
static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
@@ -273,6 +276,7 @@
widget_class->focus_in_event = e_week_view_focus_in;
widget_class->focus_out_event = e_week_view_focus_out;
widget_class->key_press_event = e_week_view_key_press;
+ widget_class->popup_menu = e_week_view_popup_menu;
widget_class->expose_event = e_week_view_expose_event;
class->selection_changed = NULL;
@@ -3430,9 +3434,8 @@
return FALSE;
}
-
-static gint
-e_week_view_key_press (GtkWidget *widget, GdkEventKey *event)
+static gboolean
+e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
{
EWeekView *week_view;
CalComponent *comp;
@@ -3521,6 +3524,18 @@
return TRUE;
}
+static gboolean
+e_week_view_key_press (GtkWidget *widget, GdkEventKey *event)
+{
+ gboolean handled = FALSE;
+ handled = e_week_view_do_key_press (widget, event);
+
+ /* if not handled, try key bindings */
+ if (!handled)
+ handled = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+ return handled;
+}
+
enum {
/*
* This is used to "flag" events that can not be editted
@@ -3692,6 +3707,14 @@
e_popup_menu (popup, (GdkEvent *) bevent);
}
+static gboolean
+e_week_view_popup_menu (GtkWidget *widget)
+{
+ EWeekView *week_view = E_WEEK_VIEW (widget);
+ e_week_view_show_popup_menu (week_view, NULL,
+ week_view->editing_event_num);
+ return TRUE;
+}
static void
e_week_view_on_new_appointment (GtkWidget *widget, gpointer data)
Index: e-gui-utils.c
===================================================================
RCS file: /cvs/gnome/gal/gal/widgets/e-gui-utils.c,v
retrieving revision 1.27
diff -u -r1.27 e-gui-utils.c
--- e-gui-utils.c 25 Mar 2003 15:47:13 -0000 1.27
+++ e-gui-utils.c 13 Jun 2003 03:40:50 -0000
@@ -48,15 +48,21 @@
e_auto_kill_popup_menu_on_selection_done (menu);
- if (event->type == GDK_KEY_PRESS)
- gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, event->key.time);
- else if ((event->type == GDK_BUTTON_PRESS) ||
- (event->type == GDK_BUTTON_RELEASE) ||
- (event->type == GDK_2BUTTON_PRESS) ||
- (event->type == GDK_3BUTTON_PRESS)){
- gtk_menu_popup (menu, NULL, NULL, 0, NULL, event->button.button, event->button.time);
+ if (event) {
+ if (event->type == GDK_KEY_PRESS)
+ gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0,
+ event->key.time);
+ else if ((event->type == GDK_BUTTON_PRESS) ||
+ (event->type == GDK_BUTTON_RELEASE) ||
+ (event->type == GDK_2BUTTON_PRESS) ||
+ (event->type == GDK_3BUTTON_PRESS)){
+ gtk_menu_popup (menu, NULL, NULL, 0, NULL,
+ event->button.button,
+ event->button.time);
+ }
} else
- gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, GDK_CURRENT_TIME);
+ gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0,
+ GDK_CURRENT_TIME);
}
typedef struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]