efl
66 строк · 2.6 Кб
1/*
2* Copyright 2019 by its authors. See AUTHORS.
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16#include <Efl_Ui.hh>
17
18EAPI_MAIN int
19elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
20{
21elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
22
23using efl::eo::instantiate;
24
25efl::ui::Win win(instantiate);
26win.text_set("Calendar Getters Example");
27win.autohide_set(true);
28
29efl::ui::Calendar cal(instantiate, win);
30win.content_set(cal);
31cal.size_set({135,135});
32
33// auto print_cal_info = std::bind([] (::elm::Calendar obj)
34// {
35// int year_min, year_max;
36// bool sel_enabled;
37// const char **wds;
38// struct tm sel_time;
39// double interval;
40
41// if (!obj.selected_time_get(&sel_time))
42// return;
43
44// interval = obj.interval_get();
45// obj.min_max_year_get(&year_min, &year_max);
46// sel_enabled = (obj.select_mode_get() != ELM_CALENDAR_SELECT_MODE_NONE);
47// wds = obj.weekdays_names_get();
48
49// std::cout << "Day: " << sel_time.tm_mday << ", Mon: " << sel_time.tm_mon << ", Year " <<
50// sel_time.tm_year + 1900 << ", WeekDay: " << sel_time.tm_wday << "<br>" << std::endl;
51
52// std::cout << "Interval: " << interval << ", Year_Min: " << year_min << ", Year_Max " <<
53// year_max << ", Sel Enabled: " << sel_enabled << "<br>" << std::endl;
54
55// std::cout << "Weekdays: " << wds[0] << ", " << wds[1] << ", " << wds[2] << ", " << wds[3] <<
56// ", " << wds[4] << ", " << wds[5] << ", " << wds[6] << "<br>" << std::endl << std::endl;
57// } , std::placeholders::_1 );
58
59// cal.callback_changed_add(print_cal_info);
60
61win.size_set({135,135});
62
63elm_run();
64return 0;
65}
66ELM_MAIN()
67