2016-05-26 14:46:29 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2017-01-18 16:25:02 -08:00
|
|
|
#include <Efl.hh>
|
2014-12-16 13:04:43 -08:00
|
|
|
#include <Elementary.hh>
|
|
|
|
|
|
|
|
static char *
|
|
|
|
_format_month_year(struct tm *format_time)
|
|
|
|
{
|
|
|
|
char buf[32];
|
|
|
|
if (!strftime(buf, sizeof(buf), "%b %y", format_time)) return NULL;
|
|
|
|
return strdup(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI_MAIN int
|
2017-04-19 23:33:59 -07:00
|
|
|
elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
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
|
|
|
using efl::eo::instantiate;
|
|
|
|
|
|
|
|
efl::ui::Win win(instantiate);
|
2016-05-26 14:46:29 -07:00
|
|
|
//win.title_set("Calendar Layout Formatting Example");
|
2014-12-16 13:04:43 -08:00
|
|
|
win.autohide_set(true);
|
|
|
|
|
2017-09-11 11:12:30 -07:00
|
|
|
::elm::Calendar cal(instantiate, win);
|
2016-05-26 14:46:29 -07:00
|
|
|
//cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
//win.resize_object_add(cal);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
|
|
|
cal.format_function_set(_format_month_year);
|
2016-05-26 14:46:29 -07:00
|
|
|
// cal.weekdays_names_set(weekdays);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-09-18 23:23:48 -07:00
|
|
|
cal.eo_cxx::efl::Gfx::size_set({125,134});
|
|
|
|
win.eo_cxx::efl::Gfx::size_set({125,134});
|
2014-12-16 13:04:43 -08:00
|
|
|
cal.visible_set(true);
|
|
|
|
win.visible_set(true);
|
|
|
|
|
|
|
|
elm_run();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
ELM_MAIN()
|