From b7f6c874fd5b630fab571462978029cd306e9f74 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Wed, 30 Aug 2000 20:50:55 +0000 Subject: switched to using new ECalendar widget, and a few other fixes. 2000-08-30 Damon Chaplin * gui/e-day-view.[hc]: * gui/e-day-view-main-item.c: * gui/e-week-view.[hc]: * gui/e-week-view-main-item.c: * gui/calendar-commands.c: * gui/gnome-cal.[hc]: switched to using new ECalendar widget, and a few other fixes. svn path=/trunk/; revision=5121 --- calendar/gui/gnome-cal.h | 89 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 25 deletions(-) (limited to 'calendar/gui/gnome-cal.h') diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index df087395e1..b484caff1e 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -10,22 +10,31 @@ #define GNOME_CALENDAR_APP_H #include -#include -#include #include +#include #include +#include #include BEGIN_GNOME_DECLS +/* These must match the page numbers in the GtkNotebook. */ +typedef enum { + GNOME_CALENDAR_VIEW_DAY = 0, + GNOME_CALENDAR_VIEW_WORK_WEEK = 1, + GNOME_CALENDAR_VIEW_WEEK = 2, + GNOME_CALENDAR_VIEW_MONTH = 3, + + GNOME_CALENDAR_VIEW_NOT_SET = 9 +} GnomeCalendarViewType; + + #define GNOME_CALENDAR(obj) GTK_CHECK_CAST(obj, gnome_calendar_get_type(), GnomeCalendar) #define GNOME_CALENDAR_CLASS(class) GTK_CHECK_CAST_CLASS(class, gnome_calendar_get_type(), GnomeCalendarClass) #define GNOME_IS_CALENDAR(obj) GTK_CHECK_TYPE(obj, gnome_calendar_get_type()) -#define GNOME_CALENDAR_NUM_VIEWS 4 - typedef struct { GtkVBox vbox; @@ -36,13 +45,17 @@ typedef struct { GHashTable *object_editor_hash; + /* This is the last selection explicitly selected by the user. We try + to keep it the same when we switch views, but we may have to alter + it depending on the view (e.g. the week views only select days, so + any times are lost. */ time_t selection_start_time; time_t selection_end_time; - GtkWidget *main_notebook; - GtkWidget *sub_notebook; GtkWidget *hpane; - GtkCalendar *gtk_calendar; + GtkWidget *notebook; + GtkWidget *vpane; + ECalendar *date_navigator; GtkWidget *todo; GtkWidget *day_view; @@ -50,13 +63,33 @@ typedef struct { GtkWidget *week_view; GtkWidget *month_view; - GtkWidget *view_toolbar_buttons[GNOME_CALENDAR_NUM_VIEWS]; + /* These are the toolbar radio buttons for switching views. */ + GtkWidget *day_button; + GtkWidget *work_week_button; + GtkWidget *week_button; + GtkWidget *month_button; + + /* This is the view currently shown. We use it to keep track of the + positions of the panes. range_selected is TRUE if a range of dates + was selected in the date navigator to show the view. */ + GnomeCalendarViewType current_view_type; + gboolean range_selected; + + /* These are the saved positions of the panes. They are multiples of + calendar month widths & heights in the date navigator, so that they + will work OK after theme changes. */ + gfloat hpane_pos; + gfloat vpane_pos; + gfloat hpane_pos_month_view; + gfloat vpane_pos_month_view; + + /* This is TRUE when we just want to set the state of the toolbar + radio buttons without causing any related code to be executed. + The "clicked" signal handlers just return when this is set. */ + gboolean ignore_view_button_clicks; void *event_editor; - /* The signal handler id for our GtkCalendar "day_selected" handler. */ - guint day_selected_id; - /* Alarm ID for the midnight refresh function */ gpointer midnight_alarm_refresh_id; @@ -91,11 +124,12 @@ void gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time); /* Jumps to the current day */ void gnome_calendar_goto_today (GnomeCalendar *gcal); -void gnome_calendar_tag_calendar (GnomeCalendar *cal, - GtkCalendar *gtk_cal); +void gnome_calendar_tag_calendar (GnomeCalendar *gcal, + ECalendar *ecal); char *gnome_calendar_get_current_view_name (GnomeCalendar *gcal); -void gnome_calendar_set_view (GnomeCalendar *gcal, - char *page_name); +void gnome_calendar_set_view (GnomeCalendar *gcal, + char *page_name, + gboolean reset_range_shown); void gnome_calendar_set_selected_time_range (GnomeCalendar *gcal, time_t start_time, @@ -114,18 +148,23 @@ void gnome_calendar_get_current_time_range (GnomeCalendar *gcal, time_t *end_time); -/* Notifies the calendar that the time format has changed and it must update all its views */ -void gnome_calendar_time_format_changed (GnomeCalendar *gcal); +/* Notifies the calendar that the time format has changed and it must update + all its views */ +void gnome_calendar_time_format_changed (GnomeCalendar *gcal); -/* Notifies the calendar that the todo list properties have changed and its time - * to update the views. - */ -void gnome_calendar_colors_changed (GnomeCalendar *gcal); +/* Notifies the calendar that the todo list properties have changed and its + time to update the views. */ +void gnome_calendar_colors_changed (GnomeCalendar *gcal); -/* Notifies the calendar that the todo list properties have changed and its time - * to update the views. - */ -void gnome_calendar_todo_properties_changed (GnomeCalendar *gcal); +/* Notifies the calendar that the todo list properties have changed and its + time to update the views. */ +void gnome_calendar_todo_properties_changed (GnomeCalendar *gcal); + + +/* This makes the appropriate radio button in the toolbar active. + It sets the ignore_view_button_clicks flag so the "clicked" signal handlers + just return without doing anything. */ +void gnome_calendar_update_view_buttons (GnomeCalendar *gcal); -- cgit v1.2.3