time_t sec_per_day = (60*60*24);
time_t sec_per_year = sec_per_day * 365;
time_t the_time = (sec_per_year * 41) + (sec_per_day * 10); /* Set date to JAN 01, 2011 */
- elm_calendar_day_selection_disabled_set(cal, EINA_TRUE);
+ elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_NONE);
elm_calendar_selected_time_set(cal, gmtime(&the_time));
}
break;
time_t sec_per_year = sec_per_day * 365;
time_t the_time = (sec_per_year * 41) + (sec_per_day * 40); /* Set date to FEB 01, 2011 */
elm_calendar_marks_clear(cal);
- elm_calendar_day_selection_disabled_set(cal, EINA_TRUE);
+ elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_NONE);
elm_calendar_selected_time_set(cal, gmtime(&the_time));
}
break;
void
test_calendar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *win, *bg, *cal, *bx, *bxx, *bt;
+ Evas_Object *win, *cal, *bx, *bxx, *bt;
api_data *api = calloc(1, sizeof(api_data));
- win = elm_win_add(NULL, "calendar", ELM_WIN_BASIC);
- elm_win_title_set(win, "Calendar");
+ win = elm_win_util_standard_add("calendar", "Calendar");
elm_win_autodel_set(win, EINA_TRUE);
evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
- bg = elm_bg_add(win);
- elm_win_resize_object_add(win, bg);
- evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(bg);
-
bxx = elm_box_add(win);
elm_win_resize_object_add(win, bxx);
evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
interval = elm_calendar_interval_get(cal);
elm_calendar_min_max_year_get(cal, &year_min, &year_max);
- sel_enabled = !elm_calendar_day_selection_disabled_get(cal);
+ sel_enabled = !!(elm_calendar_select_mode_get(cal) != ELM_CALENDAR_SELECT_MODE_NONE);
wds = elm_calendar_weekdays_names_get(cal);
snprintf(info, sizeof(info),
void
test_calendar2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *win, *bg, *bx, *bxh, *cal, *cal2, *cal3, *en;
+ Evas_Object *win, *bx, *bxh, *cal, *cal2, *cal3, *en;
Elm_Calendar_Mark *mark;
struct tm selected_time;
time_t current_time;
"Thursday", "Friday", "Saturday"
};
- win = elm_win_add(NULL, "calendar2", ELM_WIN_BASIC);
- elm_win_title_set(win, "Calendar 2");
+ win = elm_win_util_standard_add("calendar2", "Calendar 2");
elm_win_autodel_set(win, EINA_TRUE);
- bg = elm_bg_add(win);
- elm_win_resize_object_add(win, bg);
- evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(bg);
-
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
cal2 = elm_calendar_add(win);
evas_object_size_hint_weight_set(cal2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(cal2, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_calendar_day_selection_disabled_set(cal2, EINA_TRUE);
+ elm_calendar_select_mode_set(cal2, ELM_CALENDAR_SELECT_MODE_NONE);
evas_object_show(cal2);
elm_box_pack_end(bxh, cal2);
evas_object_smart_callback_add(cal, "changed", _print_cal_info_cb, en);
}
+
+void
+test_calendar3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *win, *cal, *bxx;
+ api_data *api = calloc(1, sizeof(api_data));
+
+ win = elm_win_util_standard_add("calendar", "Calendar");
+ elm_win_autodel_set(win, EINA_TRUE);
+ evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
+
+ bxx = elm_box_add(win);
+ elm_win_resize_object_add(win, bxx);
+ evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(bxx);
+
+ cal = elm_calendar_add(win);
+ elm_calendar_first_day_of_week_set(cal, ELM_DAY_THURSDAY);
+ elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_ONDEMAND);
+ evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_box_pack_end(bxx, cal);
+
+ evas_object_show(cal);
+
+ evas_object_show(win);
+}
+
#endif