Evas_Object * emusic_notify_creat(Em_Smart_Data *em) { Evas_Object *bx, *bt, *notify, *label; sd = calloc(1, sizeof(Smart_Data)); if (!sd) return NULL; notify = elm_notify_add(em->edje); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_TOP_RIGHT); //edje_object_part_swallow(, "box.swallow", em->notify.notify); sd->notify = notify; bx = elm_box_add(notify); elm_notify_content_set(notify, bx); elm_box_horizontal_set(bx, 1); evas_object_show(bx); label = elm_label_add(notify); elm_label_label_set(label, "Top Right position."); elm_box_pack_end(bx, label); evas_object_show(label); sd->label = label; bt = elm_button_add(notify); elm_button_label_set(bt, "Close"); evas_object_smart_callback_add(bt, "clicked", _notify_bt_close, NULL); elm_box_pack_end(bx, bt); evas_object_show(bt); return notify; }
static void _init_photo(Evas_Object *win) { Evas_Object *bg, *bx, *photo; const char * const filename = "./data/th-whiterabbit01.jpg"; bg = elm_bg_add(win); elm_bg_color_set(bg, 255, 255, 255); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_homogeneous_set(bx, EINA_TRUE); elm_win_resize_object_add(win, bx); photo = elm_photo_add(win); g_assert(elm_photo_file_set(photo, filename)); elm_photo_size_set(photo, 100); elm_photo_aspect_fixed_set(photo, EINA_FALSE); evas_object_smart_callback_add(photo, "clicked", _on_photo_clicked, NULL); evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_photo_fill_inside_set(photo, EINA_TRUE); evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(bx, photo); evas_object_show(photo); evas_object_show(bx); }
static Evas_Object * _add_login_box ( Evas_Object *win) { Evas_Object *box = NULL, *label, *login_button; Eina_Bool value; box = elm_box_add (win); evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (box); elm_win_resize_object_add (win, box); elm_box_horizontal_set (box, EINA_TRUE); evas_object_size_hint_align_set (box, 0.1, 0.0); /* login button */ login_button = elm_button_add (win); elm_object_text_set (login_button, "Login"); evas_object_size_hint_weight_set (login_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (login_button, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add (login_button, "clicked", _on_login_user_clicked, win); elm_box_pack_end (box, login_button); evas_object_show (login_button); return box; }
Box::Box(Widget& parent, Mode mode) : Widget(&parent, &elm_box_add) { if (mode == Mode::Horizontal) { elm_box_horizontal_set(getHandle(), EINA_TRUE); } }
Eo* float_new(PropertyValue* val, Eo* obj) { Evas_Object *bx; bx = elm_box_add(obj); elm_box_horizontal_set(bx, EINA_TRUE); elm_box_padding_set(bx, 4, 0); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); Evas_Coord fw = -1, fh = -1; elm_coords_finger_size_adjust(1, &fw, 1, &fh); evas_object_size_hint_min_set(bx, 0, fh); const char* name; /* Eo* l = elm_layout_add(obj); elm_layout_file_set(l, "edc/entry.edj", "main"); evas_object_size_hint_weight_set(l, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(l, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(l); elm_box_pack_end(bx, l); return bx; */ //Evas_Object* en = smart_entry_add(evas_object_evas_get(obj)); //Evas_Object* en = smart_entry_add(obj); //chris //Evas_Object *en = eo_add(JK_ENTRY_CLASS, obj); Evas_Object *en = jk_entry_add(obj); //evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); //evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5); evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(en); elm_box_pack_end(bx, en); //Eo* rect = evas_object_rectangle_add(evas_object_evas_get(obj)); //evas_object_show(rect); //evas_object_color_set(rect, rand() % 255, rand() % 255, rand() % 255, 255/2); //evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); //evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL); // //elm_box_pack_end(bx, rect); evas_object_smart_callback_add(en, "changed,end", _jk_entry_changed_end_cb_list, val); evas_object_smart_callback_add(en, "changed", _jk_entry_changed_cb_list, val); const float* f = val->data; //eo_do(en, jk_entry_value_set(*f)); jk_entry_value_set(en, *f); val->item_eo = en; evas_object_show(bx); return bx; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *bx, *notify, *content; win = elm_win_util_standard_add("notify", "Notify"); elm_win_autodel_set(win, EINA_TRUE); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_FALSE); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); evas_object_show(bx); content = elm_label_add(win); elm_object_text_set(content, "default"); evas_object_show(content); notify = elm_notify_add(win); elm_notify_allow_events_set(notify, EINA_FALSE); elm_notify_timeout_set(notify, 5); elm_object_content_set(notify, content); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); elm_box_pack_end(bx, notify); evas_object_smart_callback_add(notify, "block,clicked", _hide, NULL); content = elm_label_add(win); elm_object_text_set(content, "bottom"); evas_object_show(content); notify = elm_notify_add(win); elm_notify_align_set(notify, 0.5, 1.0); elm_object_content_set(notify, content); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); elm_box_pack_end(bx, notify); content = elm_label_add(win); elm_object_text_set(content, "center"); evas_object_show(content); notify = elm_notify_add(win); elm_notify_align_set(notify, 0.5, 0.5); elm_object_content_set(notify, content); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); elm_box_pack_end(bx, notify); evas_object_resize(win, 100, 200); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
int emusic_playlist_ctl_creat(Em_Smart_Data *em) { Evas_Object *obj, *box, *ic, *bt; sd = calloc(1, sizeof(Smart_Data)); if (!sd) return FALSE; obj = edje_object_add(em->evas); if (!edje_object_file_set(obj, emusic_config_theme_get(), "widget/playlist_ctl")) { int err = edje_object_load_error_get(obj); const char *errmsg = edje_load_error_str(err); ERR("cannot load theme '%s', group '%s': %s\n", emusic_config_theme_get(),"widget/playlist_ctl", errmsg); evas_object_del(obj); return NULL; } em->playlist_ctl = obj; box = elm_box_add(obj); elm_box_homogenous_set(box, 0); elm_box_horizontal_set(box, 1); ic = elm_icon_add(obj); elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_playlist"); bt = elm_button_add(obj); evas_object_smart_callback_add(bt, "clicked", _button_clicked_playlist_cb, em); elm_button_icon_set(bt, ic); elm_box_pack_end(box, bt); evas_object_show(bt); evas_object_show(ic); ic = elm_icon_add(obj); elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_repeat_off"); bt = elm_button_add(obj); evas_object_smart_callback_add(bt, "clicked", _button_clicked_repeat_cb, em); elm_button_icon_set(bt, ic); elm_box_pack_end(box, bt); evas_object_show(bt); evas_object_show(ic); sd->repeat_btn = bt; ic = elm_icon_add(obj); elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_shuffle_off"); bt = elm_button_add(obj); evas_object_smart_callback_add(bt, "clicked", _button_clicked_shuffle_cb, em); elm_button_icon_set(bt, ic); elm_box_pack_end(box, bt); evas_object_show(bt); evas_object_show(ic); sd->shuffle_btn = bt; edje_object_part_swallow(obj, "box.swallow", box); evas_object_show(box); return TRUE; }
static void _init_radio(Evas_Object *win) { Evas_Object *bg, *radio, *group, *bx, *ic; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_show(bg); bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); evas_object_show(bx); group = radio = elm_radio_add(win); elm_object_text_set(radio, RADIO1); elm_radio_state_value_set(radio, 1); elm_radio_value_pointer_set(radio, &val); ic = elm_icon_add(win); elm_icon_standard_set(ic, "home"); elm_object_part_content_set(radio, "icon", ic); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(radio); radio = elm_radio_add(win); elm_object_text_set(radio, RADIO2); elm_radio_state_value_set(radio, 2); elm_radio_value_pointer_set(radio, &val); elm_radio_group_add(radio, group); ic = elm_icon_add(win); elm_icon_standard_set(ic, "file"); elm_object_part_content_set(radio, "icon", ic); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(radio); radio = elm_radio_add(win); elm_object_text_set(radio, RADIO3); elm_radio_state_value_set(radio, 3); elm_radio_value_pointer_set(radio, &val); elm_radio_group_add(radio, group); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(radio); elm_radio_value_set(radio, RADIO2_SEL); }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *box; Evas_Object *list; win = elm_win_add(NULL, "icon", ELM_WIN_BASIC); elm_win_title_set(win, "Icon"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); bg = elm_bg_add(win); elm_bg_color_set(bg, 255,255 ,255); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); elm_box_horizontal_set(box, EINA_TRUE); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(win, box); evas_object_show(box); if (!_itc) { _itc = elm_genlist_item_class_new(); _itc->item_style = "double_label"; _itc->func.text_get = _item_label_get; _itc->func.content_get = _item_content_get; _itc->func.state_get = NULL; _itc->func.del = NULL; } list = _genlist_add(box); _genlist_fill(list); list = _genlist_add(box); elm_genlist_mode_set(list, ELM_LIST_LIMIT); _genlist_fill(list); list = _genlist_add(box); elm_genlist_mode_set(list, ELM_LIST_COMPRESS); _genlist_fill(list); evas_object_size_hint_min_set(bg, 800, 160); evas_object_size_hint_max_set(bg, 800, 640); evas_object_resize(win, 800, 320); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
EAPI_MAIN int elm_main(int argc, char *argv[]) { Evas_Object *win, *bg, *bx, *datetime; win = elm_win_add(NULL, "Datetime", ELM_WIN_BASIC); elm_win_title_set(win, "Datetime"); evas_object_smart_callback_add(win, "delete,request", _on_done, NULL); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); elm_box_horizontal_set(bx, EINA_FALSE); evas_object_show(bx); evas_object_size_hint_min_set(bx, 360, 200); //datetime showing only DATE datetime = elm_datetime_add(bx); evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5); elm_datetime_field_visible_set(datetime, ELM_DATETIME_HOUR, EINA_FALSE); elm_datetime_field_visible_set(datetime, ELM_DATETIME_MINUTE, EINA_FALSE); elm_datetime_field_visible_set(datetime, ELM_DATETIME_AMPM, EINA_FALSE); elm_box_pack_end(bx, datetime); evas_object_show(datetime); //datetime showing only TIME datetime = elm_datetime_add(bx); evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5); elm_datetime_field_visible_set(datetime, ELM_DATETIME_YEAR, EINA_FALSE); elm_datetime_field_visible_set(datetime, ELM_DATETIME_MONTH, EINA_FALSE); elm_datetime_field_visible_set(datetime, ELM_DATETIME_DATE, EINA_FALSE); elm_box_pack_end(bx, datetime); evas_object_show(datetime); //datetime showing both DATE and TIME datetime = elm_datetime_add(bx); evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5); elm_box_pack_end(bx, datetime); evas_object_show(datetime); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
SH_API Evas_Object * create_box(Evas_Object *parent, Eina_Bool is_horizontal) { Evas_Object *box; box = elm_box_add(parent); elm_box_horizontal_set(box, is_horizontal); return box; }
EAPI int elm_main(int argc, char **argv) { Evas_Object *win, *o, *bg, *box; Ecore_Event_Handler *handle_key_up, *handle_key_down; win = elm_win_add(NULL, "elm_event", ELM_WIN_BASIC); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); o = elm_bg_add(win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, o); evas_object_show(o); box = elm_box_add(win); elm_box_horizontal_set(box, EINA_FALSE); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, box); evas_object_show(box); o = elm_entry_add(win); elm_entry_single_line_set(o, EINA_TRUE); elm_entry_entry_set(o, "123ab456"); elm_box_pack_end(box, o); evas_object_show(o); o = elm_button_add(win); elm_object_text_set(o, "Test"); elm_box_pack_end(box, o); evas_object_show(o); handle_key_up = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _input_event_cb, NULL); handle_key_down = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _input_event_cb, NULL); evas_object_resize(win, 300, 300); evas_object_show(win); elm_run(); if (handle_key_up) ecore_event_handler_del(handle_key_up); if (handle_key_down) ecore_event_handler_del(handle_key_down); elm_shutdown(); return 0; }
/** * send * This function is used to create box * @param parent pointer to evas object, as the parent * @return when success, return a pointer to evas object, or return NULL * @exception */ Evas_Object *widget_create_box(Evas_Object * parent) { Evas_Object *ret = NULL; int nErr = SUCCESS; //CLK_FUN_BEG(); ret = elm_box_add(parent); CLK_RETVM_IF(!ret, NULL, "elm_box_add error!"); //beat style elm_box_horizontal_set(ret, 0); evas_object_size_hint_weight_set(ret, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(ret, EVAS_HINT_FILL, 0.0); End: //CLK_FUN_END(); return ret; }
int elm_main(int argc, char **argv) { Evas_Object *win, *box, *lab, *btn; // new window - do the usual and give it a name (hello) and title (Hello) win = elm_win_util_standard_add("hello", "Hello"); // when the user clicks "close" on a window there is a request to delete evas_object_smart_callback_add(win, "delete,request", on_done, NULL); // add a box object - default is vertical. a box holds children in a row, // either horizontally or vertically. nothing more. box = elm_box_add(win); // make the box horizontal elm_box_horizontal_set(box, EINA_TRUE); // add object as a resize object for the window (controls window minimum // size as well as gets resized if window is resized) elm_win_resize_object_add(win, box); evas_object_show(box); // add a label widget, set the text and put it in the pad frame lab = elm_label_add(win); // set default text of the label elm_object_text_set(lab, "Hello out there world!"); // pack the label at the end of the box elm_box_pack_end(box, lab); evas_object_show(lab); // add an ok button btn = elm_button_add(win); // set default text of button to "OK" elm_object_text_set(btn, "OK"); // pack the button at the end of the box elm_box_pack_end(box, btn); evas_object_show(btn); // call on_done when button is clicked evas_object_smart_callback_add(btn, "clicked", on_done, NULL); // now we are done, show the window evas_object_show(win); // run the mainloop and process events and callbacks elm_run(); elm_shutdown(); return 0; }
static Evas_Object * _add_user_list ( Evas_Object *win) { Evas_Object *box = NULL, *main_box, *label, *users_list, *cb; box = elm_box_add (win); evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (box); elm_win_resize_object_add (win, box); evas_object_size_hint_align_set (box, 0.1, 0.1); label = elm_label_add(win); elm_object_text_set(label, "Switch User"); elm_box_pack_end (box, label); evas_object_show(label); users_list = elm_hoversel_add(win); elm_hoversel_horizontal_set(users_list, EINA_FALSE); elm_object_text_set(users_list, "Select User From the List"); _populate_users (users_list); evas_object_smart_callback_add(users_list, "selected", _on_switch_user_clicked, NULL); elm_box_pack_end (box, users_list); evas_object_show(users_list); main_box = elm_box_add (win); evas_object_size_hint_weight_set (main_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (main_box); elm_box_horizontal_set (main_box, EINA_TRUE); elm_win_resize_object_add (win, main_box); elm_box_pack_end (main_box, box); cb = _add_checkbox (win); elm_box_pack_end (main_box, cb); return box; }
static Evas_Object* create_main_box(interface *intf, Evas_Object *parent) { /* Create a content box to display the content and the mini player */ intf->main_box = elm_box_add(parent); elm_box_horizontal_set(intf->main_box, EINA_FALSE); /* Main View Naviframe */ intf->nf_content = elm_naviframe_add(intf->main_box); /* Put the naviframe at the top of the content_box */ evas_object_size_hint_weight_set(intf->nf_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(intf->nf_content, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(intf->main_box, intf->nf_content); /* Library scan progress */ intf->scan_progress = elm_progressbar_add(intf->main_box); elm_progressbar_unit_format_set(intf->scan_progress, "Scanning... %.0f%%"); elm_progressbar_horizontal_set(intf->scan_progress, EINA_TRUE); evas_object_size_hint_weight_set(intf->scan_progress, EVAS_HINT_EXPAND, EVAS_HINT_FILL); evas_object_size_hint_align_set(intf->scan_progress, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_hide(intf->scan_progress); /* Mini Player creation */ intf->mini_player_layout = elm_layout_add(intf->main_box); intf->p_mini_player = audio_player_create(intf, application_get_playback_service(intf->p_app), intf->mini_player_layout); evas_object_hide(intf->mini_player_layout); evas_object_size_hint_weight_set(intf->mini_player_layout, EVAS_HINT_FILL, 0.1); evas_object_size_hint_align_set(intf->mini_player_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); /* */ evas_object_show(intf->nf_content); /* Ask the global box to recalculate her current children display */ elm_box_recalculate(intf->main_box); return intf->main_box; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *box, *hbox; Evas_Object *list, *btn; int i; win = elm_win_util_standard_add("genlist", "Genlist - simple"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); box = elm_box_add(win); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, box); evas_object_show(box); list = elm_genlist_add(win); if (!_itc) { _itc = elm_genlist_item_class_new(); _itc->item_style = "default"; _itc->func.text_get = _item_label_get; _itc->func.content_get = _item_content_get; _itc->func.state_get = NULL; _itc->func.del = NULL; } Eina_Bool hbounce, vbounce, always, no_sel; Elm_Scroller_Policy hp, vp; Elm_Object_Select_Mode sel_mode; always = no_sel = EINA_FALSE; sel_mode = elm_genlist_select_mode_get(list); if (sel_mode == ELM_OBJECT_SELECT_MODE_ALWAYS) always = EINA_TRUE; else if (sel_mode == ELM_OBJECT_SELECT_MODE_NONE) no_sel = EINA_TRUE; printf("default values:\n"); printf("always select: %d\n", always); elm_scroller_bounce_get(list, &hbounce, &vbounce); printf("bounce - horizontal: %d, vertical: %d\n", hbounce, vbounce); printf("homogeneous: %d\n", elm_genlist_homogeneous_get(list)); printf("horizontal mode: %d\n", elm_genlist_mode_get(list)); printf("longpress timeout: %0.3f\n", elm_genlist_longpress_timeout_get(list)); printf("multi selection: %d\n", elm_genlist_multi_select_get(list)); printf("no selection mode: %d\n", no_sel); elm_scroller_policy_get(list, &hp, &vp); printf("scroller policy - horizontal: %d, vertical: %d\n", hp, vp); printf("block count: %d\n", elm_genlist_block_count_get(list)); printf("\n"); elm_scroller_bounce_set(list, EINA_FALSE, EINA_FALSE); elm_genlist_homogeneous_set(list, EINA_FALSE); elm_genlist_mode_set(list, ELM_LIST_LIMIT); elm_genlist_multi_select_set(list, EINA_TRUE); elm_genlist_select_mode_set(list, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON); elm_genlist_longpress_timeout_set(list, 0.5); elm_genlist_block_count_set(list, 16); for (i = 0; i < N_ITEMS; i++) { elm_genlist_item_append(list, _itc, (void *)(long)i, NULL, ELM_GENLIST_ITEM_NONE, _item_sel_cb, NULL); } evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, list); evas_object_show(list); hbox = elm_box_add(win); elm_box_horizontal_set(hbox, EINA_TRUE); evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, hbox); evas_object_show(hbox); btn = elm_button_add(win); elm_object_text_set(btn, "Show status"); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, 0.5, 0.5); evas_object_smart_callback_add(btn, "clicked", _show_status_cb, list); elm_box_pack_end(hbox, btn); evas_object_show(btn); btn = elm_button_add(win); elm_object_text_set(btn, "Realize"); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, 0.5, 0.5); evas_object_smart_callback_add(btn, "clicked", _realize_cb, list); elm_box_pack_end(hbox, btn); evas_object_show(btn); evas_object_resize(win, 200, 320); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
static Evas_Object * _create_dialog ( const gchar *username) { Evas_Object *dialog, *bg, *box, *frame, *content_box; Evas_Object *button_frame, *pad_frame, *button_box; Evas_Object *cancel_button, *ok_button; g_free (main_dialog); main_dialog = g_malloc0 (sizeof (MainDialog)); /* main window */ dialog = elm_win_add (NULL, "dialog", ELM_WIN_BASIC); elm_win_title_set (dialog, "Enter user password"); elm_win_center (dialog, EINA_TRUE, EINA_TRUE); evas_object_smart_callback_add (dialog, "delete,request", _on_close_dialog_clicked, dialog); main_dialog->dialog = dialog; /* window background */ bg = elm_bg_add (dialog); evas_object_size_hint_weight_set (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (bg); elm_win_resize_object_add (dialog, bg); box = elm_box_add (dialog); evas_object_size_hint_min_set (box, 200, 200); evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (box); elm_win_resize_object_add (dialog, box); frame = elm_frame_add (dialog); elm_object_style_set (frame, "pad_small"); evas_object_size_hint_weight_set (frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (frame, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show (frame); elm_box_pack_start (box, frame); content_box = elm_box_add (dialog); elm_box_padding_set (content_box, 0, 3); evas_object_size_hint_weight_set (content_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (content_box, 0.0, 0.0); evas_object_show (content_box); elm_object_part_content_set (frame, NULL, content_box); main_dialog->username_entry = _add_entry (dialog, content_box, "Username:"******"Password:"******"outdent_bottom"); evas_object_size_hint_weight_set (button_frame, 0.0, 0.0); evas_object_size_hint_align_set (button_frame, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show (button_frame); elm_box_pack_end (box, button_frame); pad_frame = elm_frame_add (dialog); elm_object_style_set (pad_frame, "pad_medium"); evas_object_show (pad_frame); elm_object_part_content_set (button_frame, NULL, pad_frame); button_box = elm_box_add (dialog); elm_box_horizontal_set (button_box, 1); elm_box_homogeneous_set (button_box, 1); evas_object_show (button_box); elm_object_part_content_set (pad_frame, NULL, button_box); /* Cancel button */ cancel_button = elm_button_add (dialog); elm_object_text_set (cancel_button, "Cancel"); evas_object_size_hint_weight_set (cancel_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (cancel_button, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add (cancel_button, "clicked", _on_close_dialog_clicked, dialog); evas_object_show (cancel_button); elm_box_pack_end (button_box, cancel_button); /* OK button */ ok_button = elm_button_add (dialog); elm_object_text_set (ok_button, "OK"); evas_object_size_hint_weight_set (ok_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (ok_button, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add (ok_button, "clicked", _on_ok_dialog_clicked, dialog); evas_object_show (ok_button); elm_box_pack_end (button_box, ok_button); return dialog; }
static Evas_Object * _create_nfc_dialog ( const gchar *username) { Evas_Object *dialog, *bg, *box, *frame, *content_box, *label; Evas_Object *button_frame, *pad_frame, *button_box; Evas_Object *ok_button; main_dialog = g_malloc0 (sizeof (MainDialog)); /* main window */ dialog = elm_win_add (NULL, "dialog", ELM_WIN_BASIC); elm_win_title_set (dialog, "Show NFC tag"); elm_win_center (dialog, EINA_TRUE, EINA_TRUE); evas_object_smart_callback_add (dialog, "delete,request", _on_close_dialog_clicked, dialog); main_dialog->dialog = dialog; /* window background */ bg = elm_bg_add (dialog); evas_object_size_hint_weight_set (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (bg); elm_win_resize_object_add (dialog, bg); box = elm_box_add (dialog); evas_object_size_hint_min_set (box, 200, 200); evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (box); elm_win_resize_object_add (dialog, box); frame = elm_frame_add (dialog); elm_object_style_set (frame, "pad_small"); evas_object_size_hint_weight_set (frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (frame, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show (frame); elm_box_pack_start (box, frame); content_box = elm_box_add (dialog); elm_box_padding_set (content_box, 0, 3); evas_object_size_hint_weight_set (content_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (content_box, 0.0, 0.0); evas_object_show (content_box); elm_object_part_content_set (frame, NULL, content_box); /* NFC label */ label = elm_label_add(dialog); elm_object_text_set(label, "Show your NFC tag"); elm_object_style_set(label, "marker"); evas_object_color_set(label, 255, 0, 0, 255); elm_box_pack_end (content_box, label); evas_object_show(label); button_frame = elm_frame_add (dialog); elm_object_style_set (button_frame, "outdent_bottom"); evas_object_size_hint_weight_set (button_frame, 0.0, 0.0); evas_object_size_hint_align_set (button_frame, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show (button_frame); elm_box_pack_end (box, button_frame); pad_frame = elm_frame_add (dialog); elm_object_style_set (pad_frame, "pad_medium"); evas_object_show (pad_frame); elm_object_part_content_set (button_frame, NULL, pad_frame); button_box = elm_box_add (dialog); elm_box_horizontal_set (button_box, 1); elm_box_homogeneous_set (button_box, 1); evas_object_show (button_box); elm_object_part_content_set (pad_frame, NULL, button_box); /* OK button */ ok_button = elm_button_add (dialog); elm_object_text_set (ok_button, "OK"); evas_object_size_hint_weight_set (ok_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (ok_button, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add (ok_button, "clicked", _on_ok_dialog_clicked, dialog); evas_object_show (ok_button); elm_box_pack_end (button_box, ok_button); return dialog; }
/* externally accessible functions */ Evas_Object * enna_photo_slideshow_add(Evas_Object *parent) { Smart_Data *sd; Evas_Object *bx, *bt, *ic; Evas_Coord w, h; sd = calloc(1, sizeof(Smart_Data)); sd->delay = enna_config->slideshow_delay; sd->layout = elm_layout_add(parent); elm_layout_file_set(sd->layout, enna_config_theme_get(), "enna/slideshow"); evas_object_size_hint_weight_set(sd->layout, 1.0, 1.0); evas_object_show(sd->layout); sd->slideshow = elm_slideshow_add(sd->layout); elm_slideshow_transition_set(sd->slideshow, "horizontal"); elm_slideshow_loop_set(sd->slideshow, 1); // sd->controls = elm_notify_add(sd->layout); // elm_notify_orient_set(sd->controls, ELM_NOTIFY_ORIENT_BOTTOM); evas_object_geometry_get(enna->layout, NULL, NULL, &w, &h); evas_object_move(sd->controls, 0, 0); evas_object_resize(sd->controls, w, h); //elm_object_style_set(sd->controls, "enna_bottom"); /* Fixme : add a config value */ // elm_notify_timeout_set(sd->controls, 10); bx = elm_box_add(sd->layout); elm_box_horizontal_set(bx, 1); // elm_notify_content_set(sd->controls, bx); evas_object_show(bx); evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_IN, _mouse_in, sd); evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_OUT, _mouse_out, sd); ELM_ADD ("icon/mp_prev", _button_clicked_prev_cb); ELM_ADD ("icon/mp_pause", _button_clicked_play_cb); sd->btplay = bt; ELM_ADD ("icon/mp_next", _button_clicked_next_cb); ELM_ADD ("icon/mp_stop", _button_clicked_stop_cb); sd->spin = elm_spinner_add(bx); elm_spinner_label_format_set(sd->spin, "%2.f secs."); evas_object_smart_callback_add(sd->spin, "changed", _spin, sd); elm_spinner_step_set(sd->spin, 1); elm_spinner_min_max_set(sd->spin, 1, 100); elm_spinner_value_set(sd->spin, sd->delay); elm_box_pack_end(bx, sd->spin); evas_object_show(sd->spin); #ifdef FEATURE_ROTATION ELM_ADD ("icon/rotate_ccw", _button_clicked_rotate_ccw_cb); ELM_ADD ("icon/rotate_cw", _button_clicked_rotate_cw_cb); #endif /* FEATURE_ROTATION */ evas_object_show(sd->layout); evas_object_show(sd->slideshow); elm_layout_content_set(sd->layout, "enna.content.swallow", sd->slideshow); evas_object_data_set(sd->layout, "sd", sd); sd->state = 4; /* Catch mouse wheel event */ evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb, sd); /* connect to the input signal */ sd->listener = enna_input_listener_add("slideshow", _input_events_cb, sd->layout); enna_input_listener_demote(sd->listener); evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_MOUSE_UP, _controls_show, sd); evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_MOUSE_MOVE, _controls_show, sd); evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_DEL, _sd_del, sd); return sd->layout; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *bx, *panel, *content; win = elm_win_add(NULL, "panel", ELM_WIN_BASIC); elm_win_title_set(win, "Panel"); elm_win_autodel_set(win, EINA_TRUE); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_show(bg); bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_FALSE); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(win, bx); evas_object_show(bx); panel = elm_panel_add(win); elm_panel_orient_set(panel, ELM_PANEL_ORIENT_TOP); elm_panel_toggle(panel); evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(panel); elm_box_pack_end(bx, panel); content = elm_label_add(win); elm_object_text_set(content, "content"); evas_object_show(content); evas_object_size_hint_min_set(content, 100, 30); elm_object_content_set(panel, content); panel = elm_panel_add(win); elm_panel_orient_set(panel, ELM_PANEL_ORIENT_RIGHT); elm_panel_hidden_set(panel, EINA_TRUE); evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(panel); elm_box_pack_end(bx, panel); content = elm_label_add(win); elm_object_text_set(content, "content2"); evas_object_show(content); evas_object_size_hint_min_set(content, 100, 30); elm_object_content_set(panel, content); panel = elm_panel_add(win); evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(panel); elm_box_pack_end(bx, panel); content = elm_label_add(win); elm_object_text_set(content, "content2"); evas_object_show(content); evas_object_size_hint_min_set(content, 100, 30); elm_object_content_set(panel, content); evas_object_show(win); elm_run(); return 0; }
EAPI int elm_main(int argc, char **argv) { Ecore_X_Window *roots = NULL; int num = 0, i = 0; roots = ecore_x_window_root_list(&num); if ((!roots) || (num <= 0)) return EXIT_FAILURE; for (i = 0; i < num; i++) { Ecore_X_Window *zones; int x = 0, count = 0; count = ecore_x_window_prop_window_list_get(roots[i], ECORE_X_ATOM_E_ILLUME_ZONE_LIST, &zones); if (!zones) continue; for (x = 0; x < count; x++) { Evas_Object *win; Evas_Object *bg, *box, *btn, *icon; Ecore_X_Window xwin; Ecore_X_Window_State states[2]; char buff[PATH_MAX]; int zx, zy, zw, zh; /* create new window */ win = elm_win_add(NULL, "Illume-Softkey", ELM_WIN_DOCK); elm_win_title_set(win, "Illume Softkey"); evas_object_smart_callback_add(win, "delete-request", _cb_win_del, NULL); evas_object_data_set(win, "zone", (const void *)zones[x]); xwin = elm_win_xwindow_get(win); ecore_x_icccm_hints_set(xwin, 0, 0, 0, 0, 0, 0, 0); states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER; ecore_x_netwm_window_state_set(xwin, states, 2); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); elm_box_horizontal_set(box, EINA_TRUE); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, box); evas_object_show(box); icon = elm_icon_add(win); snprintf(buff, sizeof(buff), "%s/images/back.png", PACKAGE_DATA_DIR); elm_icon_file_set(icon, buff, NULL); evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); btn = elm_button_add(win); elm_button_icon_set(btn, icon); evas_object_smart_callback_add(btn, "clicked", _cb_btn_back_clicked, win); evas_object_size_hint_align_set(btn, 1.0, 0.5); elm_box_pack_end(box, btn); evas_object_show(btn); evas_object_show(icon); icon = elm_icon_add(win); snprintf(buff, sizeof(buff), "%s/images/close.png", PACKAGE_DATA_DIR); elm_icon_file_set(icon, buff, NULL); evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); btn = elm_button_add(win); elm_button_icon_set(btn, icon); evas_object_smart_callback_add(btn, "clicked", _cb_btn_close_clicked, win); evas_object_size_hint_align_set(btn, 1.0, 0.5); elm_box_pack_end(box, btn); evas_object_show(btn); evas_object_show(icon); ecore_x_window_geometry_get(zones[x], &zx, &zy, &zw, &zh); ecore_x_e_illume_softkey_geometry_set(zones[x], zx, (zy + zh - 40), zw, 40); evas_object_move(win, zx, (zy + zh - 40)); evas_object_resize(win, zw, 40); evas_object_show(win); } free(zones); } free(roots); elm_run(); elm_shutdown(); return EXIT_SUCCESS; }
static void on_contact_select(void *data, Evas_Object *obj, void *event_info) { Data_Contact *ctc = data; if (!ctc) { Evas_Object *win, *bx, *bt, *sc, *en; win = window; inwin2 = elm_win_inwin_add(win); elm_object_style_set(inwin2, "minimal_vertical"); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 0.0); evas_object_size_hint_align_set(bx, -1.0, -1.0); sc = elm_scroller_add(win); elm_scroller_content_min_limit(sc, 0, 1); evas_object_size_hint_weight_set(sc, 1.0, 1.0); evas_object_size_hint_align_set(sc, -1.0, 0.5); elm_box_pack_end(bx, sc); en = elm_entry_add(win); elm_entry_single_line_set(en, 1); elm_entry_entry_set(en, "Enter number..."); evas_object_size_hint_weight_set(en, 1.0, 0.0); evas_object_size_hint_align_set(en, -1.0, 0.0); elm_entry_select_all(en); elm_scroller_content_set(sc, en); evas_object_show(en); evas_object_show(sc); number_entry = en; bt = elm_button_add(window); elm_button_label_set(bt, "OK"); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_box_pack_end(bx, bt); evas_object_smart_callback_add(bt, "clicked", on_number_ok, NULL); evas_object_show(bt); elm_win_inwin_content_set(inwin2, bx); evas_object_show(bx); elm_win_inwin_activate(inwin2); elm_object_focus(en); } else if (eina_list_count(ctc->tel.numbers) > 1) { Evas_Object *win, *bx, *bx2, *bt, *li, *fr, *ph, *lb; Eina_List *l; char *name, *file; win = window; inwin2 = elm_win_inwin_add(win); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 0.0); evas_object_size_hint_align_set(bx, -1.0, -1.0); fr = elm_frame_add(win); name = data_contact_name_get(ctc); if (name) { elm_label_label_set(write_lb, name); elm_frame_label_set(fr, name); free(name); } evas_object_size_hint_weight_set(fr, 1.0, 0.0); evas_object_size_hint_align_set(fr, -1.0, -1.0); elm_box_pack_end(bx, fr); evas_object_show(fr); bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_frame_content_set(fr, bx2); evas_object_show(bx2); ph = elm_photo_add(win); file = data_contact_photo_file_get(ctc); if (file) { elm_photo_file_set(write_ph, file); elm_photo_file_set(ph, file); free(file); } evas_object_size_hint_weight_set(ph, 0.0, 0.0); evas_object_size_hint_align_set(ph, -1.0, -1.0); elm_box_pack_end(bx2, ph); evas_object_show(ph); lb = elm_label_add(win); elm_label_label_set(lb, "This contact has multiple<br>" "numbers. Select one."); evas_object_size_hint_weight_set(lb, 1.0, 0.0); evas_object_size_hint_align_set(lb, -1.0, -1.0); elm_box_pack_end(bx2, lb); evas_object_show(lb); li = elm_list_add(win); evas_object_size_hint_weight_set(li, 1.0, 1.0); evas_object_size_hint_align_set(li, -1.0, -1.0); elm_box_pack_end(bx, li); for (l = (Eina_List *)(ctc->tel.numbers); l; l = l->next) { Data_Contact_Tel *tel = l->data; // FIXME: // tel->flags can be 0 or more of: // DATA_CONTACT_TEL_HOME = (1 << 0), // DATA_CONTACT_TEL_MSG = (1 << 1), // DATA_CONTACT_TEL_WORK = (1 << 2), // DATA_CONTACT_TEL_PREF = (1 << 3), // DATA_CONTACT_TEL_VOICE = (1 << 4), // DATA_CONTACT_TEL_FAX = (1 << 5), // DATA_CONTACT_TEL_CELL = (1 << 6), // DATA_CONTACT_TEL_VIDEO = (1 << 7), // DATA_CONTACT_TEL_PAGER = (1 << 8), // DATA_CONTACT_TEL_BBS = (1 << 9), // DATA_CONTACT_TEL_MODEM = (1 << 10), // DATA_CONTACT_TEL_CAR = (1 << 11), // DATA_CONTACT_TEL_ISDN = (1 << 12), // DATA_CONTACT_TEL_PCS = (1 << 13) elm_list_item_append(li, tel->number, NULL, NULL, on_number_select, tel); } elm_list_go(li); evas_object_show(li); bt = elm_button_add(window); elm_button_label_set(bt, "OK"); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_box_pack_end(bx, bt); evas_object_smart_callback_add(bt, "clicked", on_number_list_ok, NULL); evas_object_show(bt); elm_win_inwin_content_set(inwin2, bx); evas_object_show(bx); elm_win_inwin_activate(inwin2); } else { Data_Contact_Tel *tel; char *name, *file; tel = ctc->tel.numbers->data; if (number) free(number); number = strdup(tel->number); elm_label_label_set(write_lb, number); name = data_contact_name_get(ctc); if (name) { elm_label_label_set(write_lb, name); free(name); } file = data_contact_photo_file_get(ctc); if (file) { elm_photo_file_set(write_ph, file); free(file); } } }
static void _action_delete_cb(void *data, Enna_File *file) { Evas_Object *win; Evas_Object *bg; Evas_Object *fr; Evas_Object *lb; Evas_Object *bx; Evas_Object *btn_bx; Evas_Object *btn_ok; Evas_Object *btn_cancel; Enna_Localfiles_Priv *priv = data; const char *label; ENNA_OBJECT_DEL(priv->dialog); win = elm_win_add(enna->win, NULL, ELM_WIN_DIALOG_BASIC); elm_win_title_set(win, _("Delete files")); elm_win_autodel_set(win, EINA_TRUE); evas_object_data_set(win, "file", file); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); evas_object_size_hint_min_set(bg, 400, 64); fr = elm_frame_add(win); elm_object_style_set(fr, "pad_medium"); evas_object_show(fr); elm_win_resize_object_add(win, fr); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bx, -1, -1); evas_object_show(bx); elm_frame_content_set(fr, bx); elm_box_padding_set(bx, 4, 4); lb = elm_label_add(win); elm_label_line_wrap_set(lb, ELM_WRAP_MIXED); elm_label_wrap_width_set(lb, 400); label = eina_stringshare_printf(_("Are you sure to delete <b>%s</b> ?"), file->label); elm_object_text_set(lb, label); eina_stringshare_del(label); evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(lb, 0.5, -1); evas_object_show(lb); elm_box_pack_end(bx, lb); btn_bx = elm_box_add(win); elm_box_horizontal_set(btn_bx, EINA_TRUE); evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, 0.5); evas_object_show(btn_bx); elm_box_padding_set(btn_bx, 8, 2); btn_ok = elm_button_add(win); elm_object_text_set(btn_ok, _("Delete")); evas_object_show(btn_ok); evas_object_size_hint_weight_set(btn_ok, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn_ok, EVAS_HINT_FILL, 0.5); elm_box_pack_end(btn_bx, btn_ok); evas_object_smart_callback_add(btn_ok, "clicked", _dialog_delete_ok_clicked_cb, priv); btn_cancel = elm_button_add(win); elm_object_text_set(btn_cancel, _("Cancel")); evas_object_show(btn_cancel); evas_object_size_hint_weight_set(btn_cancel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn_cancel, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(btn_bx, btn_cancel); evas_object_smart_callback_add(btn_cancel, "clicked", _dialog_cancel_clicked_cb, priv); elm_box_pack_end(bx, btn_bx); evas_object_resize(win, 400, 128); evas_object_show(win); priv->dialog = win; }
static void _action_create_folder_cb(void *data, Enna_File *file) { Evas_Object *win; Evas_Object *bg; Evas_Object *fr; Evas_Object *en; Evas_Object *lb; Evas_Object *bx; Evas_Object *btn_bx; Evas_Object *btn_ok; Evas_Object *btn_cancel; Enna_Localfiles_Priv *priv = data; win = elm_win_add(enna->win, NULL, ELM_WIN_DIALOG_BASIC); elm_win_title_set(win, _("Create New Folder")); elm_win_autodel_set(win, EINA_TRUE); evas_object_data_set(win, "file", file); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); evas_object_size_hint_min_set(bg, 400, 64); fr = elm_frame_add(win); elm_object_style_set(fr, "pad_medium"); evas_object_show(fr); elm_win_resize_object_add(win, fr); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bx, -1, -1); evas_object_show(bx); elm_frame_content_set(fr, bx); elm_box_padding_set(bx, 4, 4); lb = elm_label_add(win); elm_object_text_set(lb, _("Enter folder name")); evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(lb, 0.5, -1); evas_object_show(lb); elm_box_pack_end(bx, lb); en = elm_entry_add(win); elm_entry_single_line_set(en, EINA_TRUE); evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(en, -1, -1); elm_object_text_set(en, "New Folder"); elm_box_pack_end(bx, en); evas_object_show(en); evas_object_data_set(win, "entry", en); btn_bx = elm_box_add(win); elm_box_horizontal_set(btn_bx, EINA_TRUE); evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, 0.5); evas_object_show(btn_bx); elm_box_padding_set(btn_bx, 8, 2); btn_ok = elm_button_add(win); elm_object_text_set(btn_ok, _("Create")); evas_object_show(btn_ok); evas_object_size_hint_weight_set(btn_ok, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn_ok, EVAS_HINT_FILL, 0.5); evas_object_smart_callback_add(btn_ok, "clicked", _dialog_create_folder_ok_clicked_cb, priv); elm_box_pack_end(btn_bx, btn_ok); btn_cancel = elm_button_add(win); elm_object_text_set(btn_cancel, _("Cancel")); evas_object_show(btn_cancel); evas_object_size_hint_weight_set(btn_cancel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn_cancel, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add(btn_cancel, "clicked", _dialog_cancel_clicked_cb, priv); elm_box_pack_end(btn_bx, btn_cancel); elm_box_pack_end(bx, btn_bx); evas_object_show(win); priv->dialog = win; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *vbox, *hbox, *ic, *ck, *fs_bt, *en, *lb, *sep; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("fileselector-button", "File Selector Button Example"); elm_win_autodel_set(win, EINA_TRUE); vbox = elm_box_add(win); evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, vbox); evas_object_show(vbox); ic = elm_icon_add(win); elm_icon_standard_set(ic, "file"); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); /* file selector button */ fs_bt = elm_fileselector_button_add(win); elm_fileselector_button_path_set(fs_bt, "/tmp"); elm_object_text_set(fs_bt, "Select a file"); elm_object_part_content_set(fs_bt, "icon", ic); elm_box_pack_end(vbox, fs_bt); evas_object_show(fs_bt); evas_object_show(ic); /* attribute setting knobs */ sep = elm_separator_add(win); elm_separator_horizontal_set(sep, EINA_TRUE); elm_box_pack_end(vbox, sep); evas_object_show(sep); hbox = elm_box_add(win); elm_box_horizontal_set(hbox, EINA_TRUE); elm_box_pack_end(vbox, hbox); evas_object_show(hbox); ck = elm_check_add(win); elm_object_text_set(ck, "editable selection"); elm_check_state_set(ck, elm_fileselector_button_is_save_get(fs_bt)); evas_object_smart_callback_add(ck, "changed", _current_sel_toggle, fs_bt); elm_box_pack_end(hbox, ck); evas_object_show(ck); ck = elm_check_add(win); elm_object_text_set(ck, "\"inwin\" mode"); elm_check_state_set(ck, elm_fileselector_button_inwin_mode_get(fs_bt)); evas_object_smart_callback_add(ck, "changed", _inwin_mode_toggle, fs_bt); elm_box_pack_end(hbox, ck); evas_object_show(ck); ck = elm_check_add(win); elm_object_text_set(ck, "folders only"); elm_check_state_set(ck, elm_fileselector_button_folder_only_get(fs_bt)); evas_object_smart_callback_add(ck, "changed", _folder_only_toggle, fs_bt); elm_box_pack_end(hbox, ck); evas_object_show(ck); ck = elm_check_add(win); elm_object_text_set(ck, "expandable"); elm_check_state_set(ck, elm_fileselector_button_expandable_get(fs_bt)); evas_object_smart_callback_add(ck, "changed", _expandable_toggle, fs_bt); elm_box_pack_end(hbox, ck); evas_object_show(ck); lb = elm_label_add(win); elm_object_text_set(lb, "Last selection:"); elm_box_pack_end(vbox, lb); evas_object_show(lb); en = elm_entry_add(win); elm_entry_line_wrap_set(en, EINA_FALSE); elm_entry_editable_set(en, EINA_FALSE); evas_object_smart_callback_add(fs_bt, "file,chosen", _file_chosen, en); elm_box_pack_end(vbox, en); evas_object_show(en); evas_object_resize(win, 400, 400); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bx, *radio, *group, *ic; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("radio", "Radio"); elm_win_autodel_set(win, EINA_TRUE); bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); evas_object_show(bx); group = radio = elm_radio_add(win); elm_object_text_set(radio, "Radio 1"); elm_radio_state_value_set(radio, 1); elm_radio_value_pointer_set(radio, &val); ic = elm_icon_add(win); elm_icon_standard_set(ic, "home"); elm_object_part_content_set(radio, "icon", ic); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(radio); evas_object_smart_callback_add(radio, "changed", _cb, NULL); radio = elm_radio_add(win); elm_object_text_set(radio, "Radio 2"); elm_radio_state_value_set(radio, 2); elm_radio_value_pointer_set(radio, &val); elm_radio_group_add(radio, group); ic = elm_icon_add(win); elm_icon_standard_set(ic, "file"); elm_object_part_content_set(radio, "icon", ic); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(radio); evas_object_smart_callback_add(radio, "changed", _cb, NULL); radio = elm_radio_add(win); elm_object_text_set(radio, "Radio 3"); elm_radio_state_value_set(radio, 3); elm_radio_value_pointer_set(radio, &val); elm_radio_group_add(radio, group); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(radio); evas_object_smart_callback_add(radio, "changed", _cb, NULL); radio = elm_radio_add(win); elm_object_text_set(radio, "Radio 4"); elm_radio_state_value_set(radio, 4); elm_radio_value_pointer_set(radio, &val); elm_radio_group_add(radio, group); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(radio); evas_object_smart_callback_add(radio, "changed", _cb, NULL); evas_object_show(win); elm_run(); return 0; }
Evas_Object * init_panel_camera_light(Evas_Object *win, Eo *camera_node, Eo *light_node, double posX, double posY) { Evas_Object *nnavig = NULL, *bx_navigall = NULL; Evas_Object *bx_navigcamup = NULL, *bx_navigcamlow = NULL, *bx_navigligthup = NULL, *bx_navigligthlow = NULL; Evas_Object *spX = NULL, *spY = NULL, *spZ = NULL; Evas_Object *spangle = NULL, *spaX = NULL, *spaY = NULL, *spaZ = NULL; Evas_Object *splX = NULL, *splY = NULL, *splZ = NULL; Evas_Object *splangle = NULL, *splaX = NULL, *splaY = NULL, *splaZ = NULL; Evas_Object *separator = NULL; Axis_Key *camera_xyz = NULL, *light_xyz = NULL; Panel_Struct *pobject = NULL; Evas_Real px = 0, py = 0, pz = 0; if (ELM_WIN_UNKNOWN == elm_win_type_get(win)) { fprintf(stdout, "Not appropriate parent object - at %s line %d\n", __FILE__, __LINE__); return NULL; } if (!_alloc_memory(&camera_xyz, &pobject, &light_xyz)) return NULL; /*Navigation panel layout*/ bx_navigall = elm_box_add(win); elm_box_homogeneous_set(bx_navigall, EINA_TRUE); evas_object_show(bx_navigall); bx_navigcamup = elm_box_add(win); elm_box_horizontal_set(bx_navigcamup, EINA_TRUE); elm_box_homogeneous_set(bx_navigcamup, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigcamup); evas_object_show(bx_navigcamup); bx_navigcamlow = elm_box_add(win); elm_box_horizontal_set(bx_navigcamlow, EINA_TRUE); elm_box_homogeneous_set(bx_navigcamlow, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigcamlow); evas_object_show(bx_navigcamlow); separator = elm_separator_add(win); elm_separator_horizontal_set(separator, EINA_TRUE); elm_box_pack_end(bx_navigall, separator); evas_object_show(separator); bx_navigligthup = elm_box_add(win); elm_box_horizontal_set(bx_navigligthup, EINA_TRUE); elm_box_homogeneous_set(bx_navigligthup, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigligthup); evas_object_show(bx_navigligthup); bx_navigligthlow = elm_box_add(win); elm_box_horizontal_set(bx_navigligthlow, EINA_TRUE); elm_box_homogeneous_set(bx_navigligthlow, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigligthlow); evas_object_show(bx_navigligthlow); /*Set UI panel for changing camera and light*/ /*Init sp camera by default*/ spX = elm_spinner_add(win); elm_spinner_editable_set(spX, EINA_TRUE); elm_spinner_min_max_set(spX, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(spX, "camera X: %1.0f"); elm_spinner_step_set(spX, 1.0); pobject->cspX = spX; elm_box_pack_end(bx_navigcamup, spX); evas_object_show(spX); evas_object_smart_callback_add(spX, "changed", _camera_light_changeX_cb, camera_node); spY = elm_spinner_add(win); elm_spinner_editable_set(spY, EINA_TRUE); elm_spinner_min_max_set(spY, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(spY, "camera Y: %1.0f"); elm_spinner_step_set(spY, 1.0); pobject->cspY = spY; elm_box_pack_end(bx_navigcamup, spY); evas_object_show(spY); evas_object_smart_callback_add(spY, "changed", _camera_light_changeY_cb, camera_node); spZ = elm_spinner_add(win); elm_spinner_editable_set(spZ, EINA_TRUE); elm_spinner_min_max_set(spZ, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(spZ, "camera Z: %1.0f"); elm_spinner_step_set(spY, 1.0); pobject->cspZ = spZ; elm_box_pack_end(bx_navigcamup, spZ); evas_object_show(spZ); evas_object_smart_callback_add(spZ, "changed", _camera_light_changeZ_cb, camera_node); eo_do(camera_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &px, &py, &pz)); elm_spinner_value_set(spX, px); elm_spinner_value_set(spY, py); elm_spinner_value_set(spZ, pz); spangle = elm_spinner_add(win); elm_spinner_editable_set(spangle, EINA_TRUE); elm_spinner_min_max_set(spangle, 0.0, ANGLERANGE); elm_spinner_label_format_set(spangle, "angle: %1.0f"); elm_spinner_step_set(spangle, 1.0); pobject->cspangle = spangle; evas_object_data_set(spangle, axiskeys, camera_xyz); elm_box_pack_end(bx_navigcamlow, spangle); elm_spinner_value_set(spangle, 0.0); evas_object_show(spangle); evas_object_smart_callback_add(spangle, "changed", _camera_light_angle_change_cb, camera_node); spaX = elm_spinner_add(win); elm_spinner_min_max_set(spaX, 0.0, 1.0); elm_spinner_label_format_set(spaX, "axisX: %1.0f"); elm_spinner_step_set(spaX, 1.0); elm_box_pack_end(bx_navigcamlow, spaX); evas_object_show(spaX); evas_object_smart_callback_add(spaX, "changed", _camera_light_axisX_change_cb, spangle); spaY = elm_spinner_add(win); elm_spinner_min_max_set(spaY, 0.0, 1.0); elm_spinner_label_format_set(spaY, "axisY: %1.0f"); elm_spinner_step_set(spaY, 1.0); elm_box_pack_end(bx_navigcamlow, spaY); evas_object_show(spaY); evas_object_smart_callback_add(spaY, "changed", _camera_light_axisY_change_cb, spangle); spaZ = elm_spinner_add(win); elm_spinner_min_max_set(spaZ, 0.0, 1.0); elm_spinner_label_format_set(spaZ, "axisZ: %1.0f"); elm_spinner_step_set(spaZ, 1.0); elm_box_pack_end(bx_navigcamlow, spaZ); evas_object_show(spaZ); evas_object_smart_callback_add(spaZ, "changed", _camera_light_axisZ_change_cb, spangle); /*Init spl light by default*/ splX = elm_spinner_add(win); elm_spinner_editable_set(splX, EINA_TRUE); elm_spinner_min_max_set(splX, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(splX, "light X: %1.0f"); elm_spinner_step_set(splX, 1.0); pobject->lspX = splX; elm_box_pack_end(bx_navigligthup, splX); evas_object_show(splX); evas_object_smart_callback_add(splX, "changed", _camera_light_changeX_cb, light_node); splY = elm_spinner_add(win); elm_spinner_editable_set(splY, EINA_TRUE); elm_spinner_min_max_set(splY, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(splY, "light Y: %1.0f"); elm_spinner_step_set(splY, 1.0); pobject->lspY = splY; elm_box_pack_end(bx_navigligthup, splY); evas_object_show(splY); evas_object_smart_callback_add(splY, "changed", _camera_light_changeY_cb, light_node); splZ = elm_spinner_add(win); elm_spinner_editable_set(splZ, EINA_TRUE); elm_spinner_min_max_set(splZ, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(splZ, "light Z: %1.0f"); elm_spinner_step_set(splY, 1.0); pobject->lspZ = splZ; elm_box_pack_end(bx_navigligthup, splZ); evas_object_show(splZ); evas_object_smart_callback_add(splZ, "changed", _camera_light_changeZ_cb, light_node); eo_do(light_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &px, &py, &pz)); elm_spinner_value_set(splX, px); elm_spinner_value_set(splY, py); elm_spinner_value_set(splZ, pz); splangle = elm_spinner_add(win); elm_spinner_editable_set(splangle, EINA_TRUE); elm_spinner_min_max_set(splangle, 0.0, ANGLERANGE); elm_spinner_label_format_set(splangle, "angle: %1.0f"); elm_spinner_step_set(splangle, 1.0); pobject->lspangle = splangle; evas_object_data_set(splangle, axiskeys, light_xyz); elm_box_pack_end(bx_navigligthlow, splangle); elm_spinner_value_set(splangle, 0.0); evas_object_show(splangle); evas_object_smart_callback_add(splangle, "changed", _camera_light_angle_change_cb, light_node); splaX = elm_spinner_add(win); elm_spinner_min_max_set(splaX, 0.0, 1.0); elm_spinner_label_format_set(splaX, "axisX: %1.0f"); elm_spinner_step_set(splaX, 1.0); elm_box_pack_end(bx_navigligthlow, splaX); evas_object_show(splaX); evas_object_smart_callback_add(splaX, "changed", _camera_light_axisX_change_cb, splangle); splaY = elm_spinner_add(win); elm_spinner_min_max_set(splaY, 0.0, 1.0); elm_spinner_label_format_set(splaY, "axisY: %1.0f"); elm_spinner_step_set(splaY, 1.0); elm_box_pack_end(bx_navigligthlow, splaY); evas_object_show(splaY); evas_object_smart_callback_add(splaY, "changed", _camera_light_axisY_change_cb, splangle); splaZ = elm_spinner_add(win); elm_spinner_min_max_set(splaZ, 0.0, 1.0); elm_spinner_label_format_set(splaZ, "axisZ: %1.0f"); elm_spinner_step_set(splaZ, 1.0); elm_box_pack_end(bx_navigligthlow, splaZ); evas_object_show(splaZ); evas_object_smart_callback_add(spaZ, "changed", _camera_light_axisZ_change_cb, splangle); nnavig = elm_notify_add(win); elm_object_content_set(nnavig, bx_navigall); elm_notify_align_set(nnavig, posX, posY); evas_object_data_set(nnavig, pb, pobject); return nnavig; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *bx, *hbx, *li, *bt; win = elm_win_add(NULL, "list", ELM_WIN_BASIC); elm_win_title_set(win, "List Items Example"); evas_object_smart_callback_add(win, "delete,request", _on_done, NULL); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); evas_object_show(bx); li = elm_list_add(win); evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(bx, li); elm_list_item_append(li, "Item 0", NULL, NULL, NULL, NULL); elm_list_item_append(li, "Item 1", NULL, NULL, NULL, NULL); elm_list_item_append(li, "Item 2", NULL, NULL, NULL, NULL); hbx = elm_box_add(win); elm_box_horizontal_set(hbx, EINA_TRUE); evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0); elm_box_pack_end(bx, hbx); evas_object_show(hbx); bt = elm_button_add(win); elm_object_text_set(bt, "Prepend item"); evas_object_smart_callback_add(bt, "clicked", _prepend_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Append item"); evas_object_smart_callback_add(bt, "clicked", _add_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); hbx = elm_box_add(win); elm_box_horizontal_set(hbx, EINA_TRUE); evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0); elm_box_pack_end(bx, hbx); evas_object_show(hbx); bt = elm_button_add(win); elm_object_text_set(bt, "Append with icon"); evas_object_smart_callback_add(bt, "clicked", _add_ic_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Append with selected function"); evas_object_smart_callback_add(bt, "clicked", _add_func_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Append with data"); evas_object_smart_callback_add(bt, "clicked", _add_data_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); hbx = elm_box_add(win); elm_box_horizontal_set(hbx, EINA_TRUE); evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0); elm_box_pack_end(bx, hbx); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(hbx); bt = elm_button_add(win); elm_object_text_set(bt, "Delete item"); evas_object_smart_callback_add(bt, "clicked", _del_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Unselect item"); evas_object_smart_callback_add(bt, "clicked", _unselect_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Print items"); evas_object_smart_callback_add(bt, "clicked", _print_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Clear"); evas_object_smart_callback_add(bt, "clicked", _clear_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); hbx = elm_box_add(win); elm_box_horizontal_set(hbx, EINA_TRUE); evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0); elm_box_pack_end(bx, hbx); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(hbx); bt = elm_button_add(win); elm_object_text_set(bt, "Select next item"); evas_object_smart_callback_add(bt, "clicked", _select_next_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Insert after item"); evas_object_smart_callback_add(bt, "clicked", _insert_after_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Select previous item"); evas_object_smart_callback_add(bt, "clicked", _select_prev_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Insert before item"); evas_object_smart_callback_add(bt, "clicked", _insert_before_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); hbx = elm_box_add(win); elm_box_horizontal_set(hbx, EINA_TRUE); evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0); elm_box_pack_end(bx, hbx); evas_object_show(hbx); bt = elm_button_add(win); elm_object_text_set(bt, "Set as separator"); evas_object_smart_callback_add(bt, "clicked", _set_separator_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Disable item"); evas_object_smart_callback_add(bt, "clicked", _disable_cb, li); elm_box_pack_end(hbx, bt); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); evas_object_show(bt); elm_list_go(li); evas_object_show(li); evas_object_resize(win, 320, 600); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
void create_compose(Data_Message *rep_to, const char *to, const char *text) { Evas_Object *bx, *bx2, *ph, *lb, *bt, *sc, *en; if (content) evas_object_del(content); reply_to = NULL; if (number) { free(number); number = NULL; } if (rep_to) { reply_to = rep_to; if (reply_to->from_to) number = strdup(reply_to->from_to); } if (to) { if (number) free(number); number = strdup(to); } bx = elm_box_add(window); evas_object_size_hint_weight_set(bx, 1.0, 1.0); evas_object_size_hint_align_set(bx, -1.0, -1.0); content = bx; bx2 = elm_box_add(window); elm_box_horizontal_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); ph = elm_photo_add(window); evas_object_smart_callback_add(ph, "clicked", on_to_select, NULL); evas_object_size_hint_weight_set(ph, 0.0, 1.0); evas_object_size_hint_align_set(ph, -1.0, -1.0); elm_box_pack_end(bx2, ph); evas_object_show(ph); write_ph = ph; lb = elm_label_add(window); elm_label_label_set(lb, "Select..."); evas_object_size_hint_weight_set(lb, 1.0, 1.0); evas_object_size_hint_align_set(lb, -1.0, 0.5); elm_box_pack_end(bx2, lb); evas_object_show(lb); write_lb = lb; lb = elm_label_add(window); elm_label_label_set(lb, "0"); evas_object_size_hint_weight_set(lb, 0.0, 1.0); evas_object_size_hint_align_set(lb, 0.5, 0.5); elm_box_pack_end(bx2, lb); evas_object_show(lb); write_stat = lb; if (number) { Data_Contact *ctc = data_contact_by_tel_find(number); if (ctc) { char *name, *file; elm_label_label_set(write_lb, number); name = data_contact_name_get(ctc); if (name) { elm_label_label_set(write_lb, name); free(name); } file = data_contact_photo_file_get(ctc); if (file) { elm_photo_file_set(write_ph, file); free(file); } } } elm_box_pack_end(bx, bx2); evas_object_show(bx2); sc = elm_scroller_add(window); evas_object_size_hint_weight_set(sc, 1.0, 1.0); evas_object_size_hint_align_set(sc, -1.0, -1.0); elm_box_pack_end(bx, sc); en = elm_entry_add(window); if (text) elm_entry_entry_set(en, text); else elm_entry_entry_set(en, ""); evas_object_size_hint_weight_set(en, 1.0, 1.0); evas_object_size_hint_align_set(en, -1.0, -1.0); elm_scroller_content_set(sc, en); evas_object_smart_callback_add(en, "changed", on_edit, NULL); evas_object_show(en); evas_object_show(sc); sms_entry = en; bt = elm_button_add(window); elm_button_label_set(bt, "Send"); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_box_pack_end(bx, bt); evas_object_smart_callback_add(bt, "clicked", on_send, NULL); evas_object_show(bt); elm_box_pack_end(box, bx); evas_object_show(bx); }