diff options
author | Bolian Yin <bolian.yin@sun.com> | 2003-06-19 10:41:49 +0800 |
---|---|---|
committer | Bolian Yin <byin@src.gnome.org> | 2003-06-19 10:41:49 +0800 |
commit | 1998629bf7362303a2a1b7b961a95f07ddd01df5 (patch) | |
tree | fd1e484af5d7ace2f5daa23b24b83f6385e901a7 /calendar/gui | |
parent | 243441287ff8b44896fe5d8bc26b81a8fad9eeb2 (diff) | |
download | gsoc2013-evolution-1998629bf7362303a2a1b7b961a95f07ddd01df5.tar.gz gsoc2013-evolution-1998629bf7362303a2a1b7b961a95f07ddd01df5.tar.zst gsoc2013-evolution-1998629bf7362303a2a1b7b961a95f07ddd01df5.zip |
Fixes #44682, Shift+F10 to active popup menu on day/week view
2003-06-10 Bolian Yin <bolian.yin@sun.com>
Fixes #44682, Shift+F10 to active popup menu on day/week view
* gui/e-day-view.c (e_day_view_key_press, e_day_view_do_key_press):
When the key press is not handled, give keybindings the chance.
(e_day_view_popup_menu, e_day_view_show_popup_menu,
e_day_view_on_event_right_click ): popup menu will be activated from
both keyboard and mouse.
* gui/e-week-view.c (e_week_view_key_press, e_week_view_do_key_press):
When the key press is not handled, give keybindings the chance.
(e_week_view_popup_menu): popup menu can be activated from keyboard
svn path=/trunk/; revision=21473
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-day-view.c | 61 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 33 |
2 files changed, 78 insertions, 16 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 8b3e968d95..004904ea0d 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -144,8 +144,11 @@ static gint e_day_view_focus_in (GtkWidget *widget, 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 @@ static void e_day_view_on_event_right_click (EDayView *day_view, 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 @@ e_day_view_class_init (EDayViewClass *class) 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 @@ free_view_popup (GtkWidget *widget, gpointer data) } 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 @@ e_day_view_on_event_right_click (EDayView *day_view, 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 @@ e_day_view_event_sort_func (const void *arg1, 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 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) 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) diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index fc63e83f24..8a459d506e 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -174,7 +174,11 @@ static gboolean e_week_view_on_text_item_event (GnomeCanvasItem *item, 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_queue_layout (EWeekView *week_view); 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 @@ e_week_view_class_init (EWeekViewClass *class) 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 @@ e_week_view_is_one_day_event (EWeekView *week_view, 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 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event) 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_week_view_show_popup_menu (EWeekView *week_view, 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) |