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.
|
|
|
|
|
*/
|
2019-05-02 11:08:04 -07:00
|
|
|
|
#include <Efl_Ui.hh>
|
2016-05-26 14:46:29 -07:00
|
|
|
|
|
2018-01-15 01:38:36 -08:00
|
|
|
|
#warning This example can not be implemented with EO APIs... FIXME
|
2017-11-01 06:42:04 -07:00
|
|
|
|
|
|
|
|
|
using efl::eo::instantiate;
|
|
|
|
|
|
2014-12-16 13:04:43 -08:00
|
|
|
|
#define SECS_DAY 86400
|
|
|
|
|
|
2017-11-01 06:42:04 -07:00
|
|
|
|
static void
|
|
|
|
|
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
2014-12-16 13:04:43 -08:00
|
|
|
|
{
|
2018-01-15 01:40:39 -08:00
|
|
|
|
#if 0
|
2014-12-16 13:04:43 -08:00
|
|
|
|
struct tm selected_time;
|
|
|
|
|
time_t current_time;
|
2018-01-15 01:40:39 -08:00
|
|
|
|
#endif
|
2014-12-16 13:04:43 -08:00
|
|
|
|
|
|
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
|
|
|
|
|
|
2017-09-11 11:12:30 -07:00
|
|
|
|
efl::ui::Win win(instantiate);
|
2017-11-01 06:42:04 -07:00
|
|
|
|
win.text_set("Calendar Day Selection Example");
|
2014-12-16 13:04:43 -08:00
|
|
|
|
win.autohide_set(true);
|
|
|
|
|
|
2017-09-11 11:12:30 -07:00
|
|
|
|
::efl::ui::Box bx(instantiate, win);
|
2017-11-01 06:42:04 -07:00
|
|
|
|
win.content_set(bx);
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
|
|
::efl::ui::Calendar cal(instantiate, win);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
cal.select_mode_set(ELM_CALENDAR_SELECT_MODE_NONE);
|
2017-09-18 23:23:48 -07:00
|
|
|
|
cal.eo_cxx::efl::Gfx::size_set({125,135});
|
2016-05-26 14:46:29 -07:00
|
|
|
|
//bx.pack_end(cal); no matching function for call to ‘efl::ui::Box::pack_end(elm::Calendar&)’
|
|
|
|
|
//candidate: bool eo_cxx::efl::pack::Linear::pack_end(Efl_Gfx*) const
|
|
|
|
|
// inline bool eo_cxx::efl::pack::Linear::pack_end(Efl_Gfx * subobj_) const
|
2014-12-16 13:04:43 -08:00
|
|
|
|
|
2017-09-11 11:12:30 -07:00
|
|
|
|
::elm::Calendar cal2(instantiate, win);
|
2016-05-26 14:46:29 -07:00
|
|
|
|
//cal2.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
|
//cal2.size_hint_fill_set(true, true);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
current_time = time(NULL) +2 * SECS_DAY;
|
|
|
|
|
localtime_r(¤t_time, &selected_time);
|
2016-05-26 14:46:29 -07:00
|
|
|
|
// cal2.selected_time_set(&selected_time);
|
2017-09-18 23:23:48 -07:00
|
|
|
|
cal2.eo_cxx::efl::Gfx::size_set({125,135});
|
2016-05-26 14:46:29 -07:00
|
|
|
|
//bx.pack_end(cal2);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
|
2017-11-01 06:42:04 -07:00
|
|
|
|
#endif
|
2014-12-16 13:04:43 -08:00
|
|
|
|
|
2017-11-01 06:42:04 -07:00
|
|
|
|
win.size_set({500,560});
|
2014-12-16 13:04:43 -08:00
|
|
|
|
}
|
2017-11-01 06:42:04 -07:00
|
|
|
|
EFL_MAIN()
|