efl

Форк
0
/
calendar_cxx_example_05.cc 
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

18
EAPI_MAIN int
19
elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
20
{
21
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
22

23
   using efl::eo::instantiate;
24

25
   efl::ui::Win win(instantiate);
26
   win.text_set("Calendar Getters Example");
27
   win.autohide_set(true);
28

29
   efl::ui::Calendar cal(instantiate, win);
30
   win.content_set(cal);
31
   cal.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

61
   win.size_set({135,135});
62

63
   elm_run();
64
   return 0;
65
}
66
ELM_MAIN()
67

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.