Exemplo n.º 1
0
/*
 * handler for button to switch to day view.
 */
extern void
day_button (Widget widget, XtPointer data, XtPointer cbs)
{
        Calendar *c = calendar;

	if (c->view->glance == dayGlance)
		return;

	XtUnmapWidget(c->canvas);
	invalidate_cache(c);

	switch (c->view->glance) {
		case weekGlance:
			c->view->glance = dayGlance;
			cleanup_after_weekview(c);
			break;
		case yearGlance:
			c->view->glance = dayGlance;
			cleanup_after_yearview(c);
			break;
		case monthGlance:
			c->view->glance = dayGlance;
			cleanup_after_monthview(c);
			break;
		default:
			break;	
	}

	init_mo(c);
	(void)init_dayview(c);

	XtMapWidget(c->canvas);
}
Exemplo n.º 2
0
extern void
paint_day(Calendar *c)
{
	Day *day_info = (Day *) c->view->day_info;

        c->view->glance = dayGlance;
	XmToggleButtonGadgetSetState(c->day_scope, True, False);
	gr_clear_area(c->xcontext, 0, 0, c->view->winw, c->view->winh);
	if (day_info->month_panels == (Widget *) NULL)
		(void)init_dayview(c);
	paint_dayview(c, True, NULL, True); 
	calendar_select(c, hourSelect, (caddr_t)NULL);
}
Exemplo n.º 3
0
/*
 * Handler for "hot" buttons to navigate to day view
 */
static void
quick_button_cb(Widget widget, XtPointer client, XtPointer call)
{
    Calendar *c = calendar;
    Week    *w = (Week *)c->view->week_info;
    int dow = (int) (intptr_t) client;
    char buf[BUFSIZ];

    if (c->view->date != get_bot()) {
        c->view->olddate = c->view->date;
        c->view->date = w->start_date + dow * daysec;
    }
    calendar_select(c, weekhotboxSelect, NULL);

    cleanup_after_weekview(c);

    c->view->glance = dayGlance;
    init_mo(c);
    (void)init_dayview(c);

    paint_day(c);

}