efl

Форк
0
/
table_cxx_example_02.cc 
56 строк · 1.8 Кб
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
// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` table_cxx_example_01.cc -o table_cxx_example_01
17

18
#include <Evas.hh>
19
#include <Efl_Ui.hh>
20

21
using efl::eo::instantiate;
22

23
static void
24
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
25
{
26
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
27

28
   efl::ui::Win win(instantiate);
29
   win.text_set("Table example");
30
   win.autohide_set(true);
31

32
   efl::ui::Table table(instantiate, win);
33
   win.content_set(table);
34
   table.content_padding_set(5, 5);
35

36
   efl::canvas::Rectangle rect(instantiate, win);
37
   rect.color_set(255, 0, 0, 255);
38
   rect.hint_size_min_set({100, 50});
39
   table.pack_table(rect, 0, 0, 2, 1);
40

41
   efl::canvas::Rectangle rect2(instantiate, win);
42
   rect2.color_set(0, 255, 0, 255);
43
   rect2.hint_size_min_set({50, 100});
44
   table.pack_table(rect2, 0, 1, 1, 2);
45

46
   efl::canvas::Rectangle rect3(instantiate, win);
47
   rect3.color_set(0, 0, 255, 255);
48
   rect3.hint_size_min_set({50, 50});
49
   table.pack_table(rect3, 1, 1, 1, 1);
50

51
   efl::canvas::Rectangle rect4(instantiate, win);
52
   rect4.color_set(255, 255, 0, 255);
53
   rect4.hint_size_min_set({50, 50});
54
   table.pack_table(rect4, 1, 2, 1, 1);
55
}
56
EFL_MAIN()
57

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

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

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

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