コード例 #1
0
ファイル: gui_calendar.c プロジェクト: adongy/ixus160_elph160
//-------------------------------------------------------------------
int gui_calendar_kbd_process() {
    switch (kbd_get_autoclicked_key()) {
        case KEY_UP:
            ++cal_year;
            need_redraw = 1;
            break;
        case KEY_DOWN:
            if (cal_year>1) --cal_year;
            need_redraw = 1;
            break;
        case KEY_LEFT:
            if (--cal_month<0) {
                cal_month=11;
                --cal_year;
            }
            need_redraw = 1;
            break;
        case KEY_RIGHT:
            if (++cal_month>11) {
                cal_month=0;
                ++cal_year;
            }
            need_redraw = 1;
            break;
        case KEY_ERASE:
        case KEY_DISPLAY:
            calendar_goto_today();
            need_redraw = 1;
            break;
    }
    return 0;
}
コード例 #2
0
static void
today_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
{
	GnomeCalendar *gcal;

	gcal = GNOME_CALENDAR (data);

	calendar_goto_today (gcal);
}
コード例 #3
0
ファイル: gui_calendar.c プロジェクト: adongy/ixus160_elph160
//-------------------------------------------------------------------
int basic_module_init() {

    gui_set_mode(&GUI_MODE_CALENDAR);

    calendar_goto_today();
    cal_w = FONT_WIDTH*4*7;
    cal_h = 4+FONT_HEIGHT+4+4+FONT_HEIGHT+4+(FONT_HEIGHT+4)*6;
    cal_x = (camera_screen.width-cal_w)/2;
    cal_y = FONT_HEIGHT+(camera_screen.height-FONT_HEIGHT-cal_h)/2;
    need_redraw = 2;
	return 1;
}