Page MenuHomePhabricator
Paste P198

(An Untitled Masterwork)
ActivePublic

Authored by raster on Jun 28 2017, 1:27 AM.
#include <Elementary.h>
Evas_Object *hbox0;
static Evas_Object *
search_new(Evas_Object *win)
{
Evas_Object *o;
Evas_Object *hbox;
Evas_Object *vbox;
o = elm_box_add(win);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
elm_box_horizontal_set(o, EINA_TRUE);
hbox = o;
o = elm_entry_add(win);
elm_entry_scrollable_set(o, EINA_TRUE);
elm_entry_single_line_set(o, EINA_TRUE);
elm_object_part_text_set(o, "guide", "Type search text here");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(hbox, o);
evas_object_show(o);
o = elm_box_add(win);
evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_horizontal_set(o, EINA_FALSE);
elm_box_pack_end(hbox, o);
vbox = o;
o = elm_button_add(win);
elm_object_style_set(o, "spinner/increase/default");
elm_box_pack_end(vbox, o);
evas_object_show(o);
o = elm_button_add(win);
elm_object_style_set(o, "spinner/decrease/default");
elm_box_pack_end(vbox, o);
evas_object_show(o);
evas_object_show(vbox);
return hbox;
}
static Eina_Bool
_anim(void *data, double pos)
{
int n;
n = 200.0 *
elm_config_scale_get() *
ecore_animator_pos_map(pos, ECORE_POS_MAP_SINUSOIDAL, 0, 0);
evas_object_size_hint_min_set(data, n, 0);
return EINA_TRUE;
}
static void
_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Evas_Object *o, *tab;
Elm_Box_Transition *l;
Ecore_Animator *anim;
o = elm_table_add(data);
evas_object_size_hint_weight_set(o, 0.0, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
elm_box_pack_start(hbox0, o);
evas_object_show(o);
tab = o;
o = evas_object_rectangle_add(evas_object_evas_get(data));
evas_object_color_set(o, 0, 0, 0, 0);
anim = ecore_animator_timeline_add(1.0, _anim, o);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(tab, o, 0, 0, 1, 1);
evas_object_show(o);
o = search_new(data);
elm_table_pack(tab, o, 0, 0, 1, 1);
evas_object_show(o);
}
EAPI_MAIN int
elm_main(int argc, char *argv[])
{
Evas_Object *win;
Evas_Object *o;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
/* window */
o = elm_win_util_standard_add("etui", "search");
elm_win_focus_highlight_enabled_set(o, EINA_TRUE);
elm_win_autodel_set(o, EINA_TRUE);
win = o;
o = elm_box_add(win);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_horizontal_set(o, EINA_TRUE);
elm_win_resize_object_add(win, o);
evas_object_show(o);
hbox0 = o;
o = elm_button_add(win);
elm_object_text_set(o, "Button 2");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_smart_callback_add(o, "clicked", _cb, win);
elm_box_pack_end(hbox0, o);
evas_object_show(o);
evas_object_resize(win, 480, 640);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
raster created this paste.Jun 28 2017, 1:27 AM
raster created this object with visibility "Public (No Login Required)".