2019-10-24 06:36:42 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2019 by its authors. See AUTHORS.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2017-11-05 21:25:22 -08:00
|
|
|
// 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
|
2016-05-26 14:46:29 -07:00
|
|
|
|
2019-05-02 11:08:04 -07:00
|
|
|
#include <Efl_Ui.hh>
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
using efl::eo::instantiate;
|
|
|
|
|
|
|
|
static void
|
|
|
|
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
2014-12-16 13:04:43 -08:00
|
|
|
{
|
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
efl::ui::Win win(instantiate);
|
|
|
|
win.text_set("Table example");
|
2014-12-16 13:04:43 -08:00
|
|
|
win.autohide_set(true);
|
|
|
|
|
2017-12-18 21:35:06 -08:00
|
|
|
efl::ui::Table table(instantiate, win);
|
2017-11-05 21:25:22 -08:00
|
|
|
win.content_set(table);
|
2019-10-02 03:04:12 -07:00
|
|
|
table.content_padding_set(5, 5);
|
2017-11-05 21:25:22 -08:00
|
|
|
// FIXME
|
|
|
|
// table.homogeneous_set(true);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2019-12-10 16:47:50 -08:00
|
|
|
efl::ui::Textbox label(instantiate, win);
|
2017-11-05 21:25:22 -08:00
|
|
|
label.text_set("label 0");
|
2017-12-18 21:13:58 -08:00
|
|
|
table.pack_table(label, 0, 0, 1, 1);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2019-12-10 16:47:50 -08:00
|
|
|
efl::ui::Textbox label1(instantiate, win);
|
2017-11-05 21:25:22 -08:00
|
|
|
label1.text_set("label 1");
|
2017-12-18 21:13:58 -08:00
|
|
|
table.pack_table(label1, 1, 0, 1, 1);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2019-12-10 16:47:50 -08:00
|
|
|
efl::ui::Textbox label2(instantiate, win);
|
2017-11-05 21:25:22 -08:00
|
|
|
label2.text_set("label 2");
|
2017-12-18 21:13:58 -08:00
|
|
|
table.pack_table(label2, 0, 1, 1, 1);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2019-12-10 16:47:50 -08:00
|
|
|
efl::ui::Textbox label3(instantiate, win);
|
2017-11-05 21:25:22 -08:00
|
|
|
label3.text_set("label 3");
|
2017-12-18 21:13:58 -08:00
|
|
|
table.pack_table(label3, 1, 1, 1, 1);
|
2014-12-16 13:04:43 -08:00
|
|
|
}
|
2017-11-05 21:25:22 -08:00
|
|
|
EFL_MAIN()
|