1 #include <Elementary.hh>
4 elm_main (int argc, char *argv[])
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
8 ::elm::win_standard win;
9 win.title_set("Calendar Getters Example");
10 win.autohide_set(true);
12 ::elm::calendar cal(efl::eo::parent = win);
13 cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
14 win.resize_object_add(cal);
16 auto print_cal_info = std::bind([] (::elm::calendar obj)
18 int year_min, year_max;
24 if (!obj.selected_time_get(&sel_time))
27 interval = obj.interval_get();
28 obj.min_max_year_get(&year_min, &year_max);
29 sel_enabled = (obj.select_mode_get() != ELM_CALENDAR_SELECT_MODE_NONE);
30 wds = obj.weekdays_names_get();
32 std::cout << "Day: " << sel_time.tm_mday << ", Mon: " << sel_time.tm_mon << ", Year " <<
33 sel_time.tm_year + 1900 << ", WeekDay: " << sel_time.tm_wday << "<br>" << std::endl;
35 std::cout << "Interval: " << interval << ", Year_Min: " << year_min << ", Year_Max " <<
36 year_max << ", Sel Enabled: " << sel_enabled << "<br>" << std::endl;
38 std::cout << "Weekdays: " << wds[0] << ", " << wds[1] << ", " << wds[2] << ", " << wds[3] <<
39 ", " << wds[4] << ", " << wds[5] << ", " << wds[6] << "<br>" << std::endl << std::endl;
40 } , std::placeholders::_1 );
42 cal.callback_changed_add(print_cal_info);
43 cal.visible_set(true);
45 win.visible_set(true);