Evas_Object *common_utils_add_edit_box(Evas_Object *parent, const common_utils_entry_info_t *entry_info) { Evas_Object *layout = elm_layout_add(parent); Evas_Object *entry = NULL; elm_layout_theme_set(layout, "layout", "editfield", "title"); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_part_text_set(layout, "elm.text", entry_info->title); elm_object_part_text_set(layout, "elm.guidetext", entry_info->guide_txt); // Set guidetext. entry = elm_entry_add(layout); elm_object_part_content_set(layout, "elm.swallow.content", entry); elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_scrollable_set(entry, EINA_TRUE); elm_entry_entry_set(entry, entry_info->entry_txt); elm_entry_input_panel_layout_set(entry, entry_info->panel_type); if (!elm_entry_is_empty(entry)) { INFO_LOG(UG_NAME_NORMAL, "entry is not empty"); elm_object_signal_emit(layout, "elm,state,guidetext,hide", "elm"); if (!entry_info->guide_txt || strlen(entry_info->guide_txt) <= 0) evas_object_data_set(layout, COMMON_UTILS_DEFAULT_ENTRY_TEXT_KEY, g_strdup(entry_info->entry_txt)); } evas_object_smart_callback_add(entry, "changed", __common_utils_entry_changed_cb, layout); evas_object_smart_callback_add(entry, "focused", __common_utils_entry_focused_cb, layout); evas_object_smart_callback_add(entry, "unfocused", __common_utils_entry_unfocused_cb, layout); elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", __common_utils_eraser_clicked_cb, entry); evas_object_show(entry); return layout; }
static void _init_network_page() { Evas_Object *win = ui_utils_view_window_get(VIEW_PTR(view)); view.layout2 = elm_layout_add(win); elm_win_resize_object_add(win, view.layout2); evas_object_size_hint_weight_set(view.layout2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_layout_file_set(view.layout2, phoneui_theme, "phoneui/settings/quick-settings/network"); evas_object_show(view.layout2); view.gprs_slide = elm_check_add(win); elm_object_style_set(view.gprs_slide, "toggle"); elm_object_part_content_set(view.layout2, "network-frame-auto-frame-gprs-slide", view.gprs_slide); evas_object_smart_callback_add(view.gprs_slide, "changed", _gprs_slide_changed_cb, NULL); elm_object_part_text_set(view.gprs_slide, "on", D_("Connected")); elm_object_part_text_set(view.gprs_slide, "off", D_("Disconnected")); evas_object_show(view.gprs_slide); view.sharing_slide = elm_check_add(win); elm_object_style_set(view.sharing_slide, "toggle"); elm_object_part_content_set(view.layout2, "network-frame-auto-frame-sharing-slide", view.sharing_slide); evas_object_smart_callback_add(view.sharing_slide, "changed", _sharing_slide_changed_cb, NULL); elm_object_part_text_set(view.sharing_slide, "on", D_("Sharing")); elm_object_part_text_set(view.sharing_slide, "off", D_("Not sharing")); evas_object_show(view.sharing_slide); // FIXME: until we implement it elm_object_disabled_set(view.sharing_slide, 1); elm_naviframe_item_simple_push(view.pager, view.layout2); phoneui_info_register_and_request_pdp_context_status(_pdp_context_status_signal_cb, NULL); }
Evas_Object *common_utils_show_info_popup(Evas_Object *parent, popup_btn_info_t *popup_data) { __COMMON_FUNC_ENTER__; Evas_Object *popup = elm_popup_add(parent); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); if (popup_data->title_txt) elm_object_part_text_set(popup, "title,text", popup_data->title_txt); if (popup_data->info_txt) elm_object_text_set(popup, popup_data->info_txt); if (popup_data->btn1_txt) { Evas_Object *btn_1 = elm_button_add(popup); elm_object_text_set(btn_1, popup_data->btn1_txt); elm_object_part_content_set(popup, "button1", btn_1); if (popup_data->btn1_cb) { evas_object_smart_callback_add(btn_1, "clicked", popup_data->btn1_cb, popup_data->btn1_data); } else { // set the default callback evas_object_smart_callback_add(btn_1, "clicked", (Evas_Smart_Cb)evas_object_del, popup); } } if (popup_data->btn2_txt) { Evas_Object *btn_2 = elm_button_add(popup); elm_object_text_set(btn_2, popup_data->btn2_txt); elm_object_part_content_set(popup, "button2", btn_2); evas_object_smart_callback_add(btn_2, "clicked", popup_data->btn2_cb, NULL); evas_object_show(popup); if (popup_data->btn2_cb) { evas_object_smart_callback_add(btn_2, "clicked", popup_data->btn2_cb, popup_data->btn2_data); } else { // set the default callback evas_object_smart_callback_add(btn_2, "clicked", (Evas_Smart_Cb)evas_object_del, popup); } } evas_object_show(popup); return popup; }
void show_graphic_popup(appdata_s *ad, char *text, int timeout){ Evas_Object *popup, *layout, *progressbar; ad->popup = elm_popup_add(ad->win); elm_object_style_set(ad->popup, "circle"); layout = elm_layout_add(ad->popup); elm_layout_file_set(layout, ELM_DEMO_EDJ, "popup_progressbar"); elm_object_content_set(ad->popup, layout); elm_object_part_text_set(layout,"elm.text", text); evas_object_show(layout); progressbar = elm_progressbar_add(layout); elm_object_style_set(progressbar, "process/popup/small"); evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_progressbar_pulse(progressbar, EINA_TRUE); elm_object_part_content_set(layout, "elm.swallow.content", progressbar); evas_object_show(progressbar); evas_object_show(ad->popup); if(timeout>0){ elm_popup_timeout_set(ad->popup, timeout); evas_object_smart_callback_add(ad->popup, "timeout", destroy_popup, ad); }else{ evas_object_smart_callback_del(ad->popup, "timeout", destroy_popup); } }
void Browser_Common_View::show_notify_popup_layout(const char *msg, int timeout, Evas_Object *parent) { if (m_selinfo_layout) { evas_object_del(m_selinfo_layout); m_selinfo_layout = NULL; } m_selinfo_layout = elm_layout_add(parent); if (!m_selinfo_layout) { BROWSER_LOGD("elm_layout_add failed"); return; } elm_object_part_content_set(parent, "selinfo.swallow.contents", m_selinfo_layout); evas_object_size_hint_weight_set(m_selinfo_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(m_selinfo_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_content_set(m_selection_info, m_selection_info_layout); /* Set the layout theme */ elm_layout_theme_set(m_selinfo_layout, "standard", "selectioninfo", "default"); /* Set the text */ elm_object_part_text_set(m_selinfo_layout, "elm.text", msg); elm_object_signal_emit(parent, "show,selection,info", "elm"); }
static Evas_Object * _widget_bubble_create(const char *orig_style) { char buf[PATH_MAX]; char style[PATH_MAX] = {0, }; Evas_Object *o, *ic, *lbl; ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get()); elm_image_file_set(ic, buf, NULL); evas_object_show(ic); lbl = elm_label_add(win); elm_object_text_set(lbl, "This is a bubble widget preview."); evas_object_show(lbl); o = elm_bubble_add(win); elm_object_text_set(o, "Title"); elm_object_part_text_set(o, "info", "Information"); elm_object_content_set(o, lbl); elm_object_part_content_set(o, "icon", ic); evas_object_show(o); _trim_end_default(orig_style, style); if (!strcmp("bottom_left", style)) elm_bubble_pos_set(o, ELM_BUBBLE_POS_BOTTOM_LEFT); else if (!strcmp("bottom_right", style)) elm_bubble_pos_set(o, ELM_BUBBLE_POS_BOTTOM_RIGHT); else if (!strcmp("top_left", style)) elm_bubble_pos_set(o, ELM_BUBBLE_POS_TOP_LEFT); else if (!strcmp("top_right", style)) elm_bubble_pos_set(o, ELM_BUBBLE_POS_TOP_RIGHT); return o; }
static int __app_reset(bundle *b, void *data) { struct appdata *ad = data; Evas_Object *popup; const char *val; int ret = 0; ad->b = bundle_dup(b); bundle_iterate(b, __prt_recvd_bundle, NULL); if (syspopup_has_popup(b)) { syspopup_reset(b); } else { popup = elm_popup_add(ad->win); if (popup != NULL) { ret = syspopup_create(b, &handler, ad->win, ad); evas_object_show(ad->win); if (ret == 0) { val = bundle_get_val(b, "_INTERNAL_SYSPOPUP_NAME_"); val = bundle_get_val(b, "_SYSPOPUP_TITLE_"); if (val) { snprintf(ad->title, TITLE_BUF_LEN, "%s", val); } else { snprintf(ad->title, TITLE_BUF_LEN, "%s", "Unknown Title"); } val = bundle_get_val(b, "_SYSPOPUP_CONTENT_"); if (val) { snprintf(ad->content, CONTENT_BUF_LEN, "%s", val); } else { snprintf(ad->content, CONTENT_BUF_LEN, "%s", "Unknown Content"); } elm_object_style_set(popup, "char_wrap_style"); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL); elm_object_part_text_set(popup, "title,text", ad->title); elm_object_text_set(popup, ad->content); evas_object_smart_callback_add(popup, "response", __response_cb, NULL); evas_object_show(popup); } } } return 0; }
static void gocomics_set_comic_name (void) { char name[128] = { 0 }; if (!mod->comic_name) { elm_object_part_text_set (mod->layout, "service.book.name.str", "GoComics"); return; } snprintf (name, sizeof(name), "%s - %.4d/%.2d/%.2d", mod->comic_name, mod->year, mod->month, mod->day); elm_object_part_text_set (mod->layout, "service.book.name.str", name); }
static void _test_layout() { Evas_Object *win, *box, *ly, *bt; char buf[PATH_MAX]; win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in); 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); ly = elm_layout_add(win); if (!elm_layout_theme_set( ly, "layout", "application", "titlebar")) fprintf(stderr, "Failed to set layout"); elm_object_part_text_set(ly, "elm.text", "Some title"); evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, ly); evas_object_show(ly); bt = elm_icon_add(win); elm_icon_standard_set(bt, "chat"); evas_object_size_hint_min_set(bt, 20, 20); elm_layout_icon_set(ly, bt); bt = elm_icon_add(win); elm_icon_standard_set(bt, "close"); evas_object_size_hint_min_set(bt, 20, 20); elm_layout_end_set(ly, bt); ly = elm_layout_add(win); snprintf(buf, sizeof(buf), "%s/test.edj","./data/"); elm_layout_file_set(ly, buf, "layout"); evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_box_pack_end(box, ly); //elm_win_resize_object_add(win, ly); evas_object_show(ly); bt = elm_button_add(win); elm_object_text_set(bt, "Button 1"); elm_object_part_content_set(ly, "element1", bt); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Button 2"); elm_object_part_content_set(ly, "element2", bt); evas_object_show(bt); bt = elm_button_add(win); elm_object_text_set(bt, "Button 3"); elm_object_part_content_set(ly, "element3", bt); evas_object_show(bt); evas_object_show(win); }
static void _init_bubble(Evas_Object *win) { Evas_Object *bg, *label, *icon, *bubble; 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); label = elm_label_add(win); elm_object_text_set(label, "This is the CONTENT of our bubble"); evas_object_show(label); icon = elm_icon_add(win); elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO); elm_icon_standard_set(icon, "home"); evas_object_show(icon); bubble = elm_bubble_add(win); elm_object_part_content_set(bubble, "icon", icon); elm_object_part_text_set(bubble, "info", "INFO"); elm_object_text_set(bubble, "LABEL"); elm_object_content_set(bubble, label); evas_object_smart_callback_add(bubble, "clicked", _bubble_clicked, NULL); evas_object_resize(bubble, 300, 100); evas_object_show(bubble); }
static void _edje_signal_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { //printf("Emission : %s - Source : %s\n", emission, source); if (!strcmp(emission, "info,clicked")) { Evas_Object *textblock; Evas_Object *edje; printf("info clicked \n"); textblock = elm_layout_add(win); elm_layout_file_set(textblock, "tut22.edj", "infos_panel"); evas_object_show(textblock); evas_object_size_hint_weight_set(textblock, 1, 1); elm_object_part_content_set(layout, "panel_swallow", textblock); evas_object_show(textblock); elm_object_part_text_set(textblock, "textblock", "<h1>What is Enlightenment?</h1><br>" "<tab><h4>Enlightenment is not just a window manager for <hilight>Linux/X11</hilight> and others, but also a whole suite of libraries to help you create beautiful user interfaces with much less work than doing it the old fashioned way and fighting with traditional toolkits, not to mention a traditional window manager. It covers uses from small mobile devices like phones all the way to powerful multi-core desktops (which are the primary development environment). </h4><br>" "<br><h1>Enlightenment Foundation Libraries (EFL)</h1> <br>" "<tab>These provide both a semi-traditional toolkit set in <rhinoceros>Elementary</rhinoceros> as well as the object canvas <h2>(Evas)</h2> and powerful abstracted objects (Edje) that you can combine, mix and match, even layer on top of each other with alpha channels and events in-tact. It has <link><a href=\"evas_map\">3D transformations</a></link> for all objects and more. )"); edje = elm_layout_edje_get(textblock); edje_object_signal_callback_add(edje, "*", "*", _edje_signal_textblock_cb, NULL); edje = elm_layout_edje_get(layout); edje_object_signal_emit(edje, "hide,table,anim", "tuto"); } }
static Evas_Object * _widget_actionslider_create(const char *style) { Evas_Object *as; as = elm_actionslider_add(win); EXPAND(as); ALIGN(as, EVAS_HINT_FILL, 0); if (style) elm_object_style_set(as, style); elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT); elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER| ELM_ACTIONSLIDER_RIGHT); elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT); elm_object_part_text_set(as, "left", NULL); elm_object_part_text_set(as, "center", "Accept"); elm_object_part_text_set(as, "right", "Reject"); evas_object_show(as); return as; }
static Evas_Object* _gl_btn_observe_content_get(void *data , Evas_Object *obj , const char *part) { Evas_Object *button; oicappData *ad = data; button = elm_button_add(obj); elm_object_part_text_set(button , NULL , "Observe"); evas_object_propagate_events_set(button , EINA_FALSE); evas_object_smart_callback_add(button , "clicked" , _btn_observe_clicked , ad); return button; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *btn, *layout; char buf[PATH_MAX]; elm_app_info_set(elm_main, "elementary", "examples/layout_example.edj"); win = elm_win_add(NULL, "layout", ELM_WIN_BASIC); 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); // Adding layout layout = elm_layout_add(win); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, layout); snprintf(buf, sizeof(buf), "%s/examples/layout_example.edj", elm_app_data_dir_get()); elm_layout_file_set(layout, buf, "example/mylayout3"); evas_object_show(layout); elm_object_signal_callback_add(layout, "size,changed", "", _size_changed_cb, layout); // Setting title const char *title = elm_layout_data_get(layout, "title"); if (title) { elm_win_title_set(win, title); elm_object_part_text_set(layout, TITLE, title); } btn = elm_button_add(win); elm_object_text_set(btn, "Enlarge me!"); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_part_content_set(layout, SWALLOW, btn); evas_object_smart_callback_add(btn, "clicked", _swallow_btn_cb, layout); evas_object_size_hint_min_set(bg, 160, 160); evas_object_size_hint_max_set(bg, 640, 640); evas_object_resize(win, 160, 160); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
/** * send * This function is used to create editfield * @param parent pointer to Evas object, as the parent * @param title string for title * @param str string for guide text * @param clicked_cb cb, when get single "clicked" * @param data_clicked @clicked_cb data * @param unfocused_cb cb, when get signle "unfocused" * @param data_unfocused @unfocused data * @return when success, return a pointer to evas object, or return NULL * @exception */ Evas_Object *widget_create_editfield(Evas_Object * parent, gchar * title, gchar * str, EO_SMART_CB clicked_cb, void *data_clicked, EO_SMART_CB unfocused_cb, void *data_unfocused) { Evas_Object *ret = NULL; int nErr = SUCCESS; Evas_Object *layout = elm_layout_add(parent); elm_layout_theme_set(layout, "layout", "editfield", "title"); Evas_Object *entry = elm_entry_add(parent); elm_object_part_content_set(layout, "elm.swallow.content", entry); ret = layout; CLK_RETVM_IF(!ret, NULL, "elm_editfield_add error!"); elm_object_part_text_set(layout, "elm.text", title); elm_object_part_text_set(layout, "elm.text", str); elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_scrollable_set(entry, EINA_TRUE); evas_object_size_hint_weight_set(ret, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ret, EVAS_HINT_FILL, 0); //cb evas_object_smart_callback_add(entry, "changed", _entry_changed_cb, layout); evas_object_smart_callback_add(entry, "focused", _entry_focused_cb, layout); evas_object_smart_callback_add(entry, "unfocused", _entry_unfocused_cb, layout); elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, entry); End: //CLK_FUN_END(); return ret; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *bubble, *label, *icon; win = elm_win_add(NULL, "bubble", ELM_WIN_BASIC); elm_win_title_set(win, "Bubble"); elm_win_autodel_set(win, EINA_TRUE); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); evas_object_resize(win, 300, 200); evas_object_show(win); 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); label = elm_label_add(win); elm_object_text_set(label, "This is the CONTENT of our bubble"); evas_object_show(label); icon = evas_object_rectangle_add(evas_object_evas_get(win)); evas_object_color_set(icon, 0, 0, 255, 255); evas_object_show(icon); bubble = elm_bubble_add(win); elm_object_part_content_set(bubble, "icon", icon); elm_object_part_text_set(bubble, "info", "INFO"); elm_object_text_set(bubble, "LABEL"); elm_object_content_set(bubble, label); evas_object_resize(bubble, 300, 100); evas_object_show(bubble); evas_object_smart_callback_add(bubble, "clicked", _bla, NULL); label = elm_label_add(win); elm_object_text_set(label, "Bubble with no icon, info or label"); evas_object_show(label); bubble = elm_bubble_add(win); elm_object_content_set(bubble, label); evas_object_resize(bubble, 200, 50); evas_object_move(bubble, 0, 110); evas_object_show(bubble); elm_run(); elm_shutdown(); return 0; }
void Browser_Common_View::show_msg_popup(const char *title, const char *msg, int timeout) { BROWSER_LOGD("[%s]", __func__); if (m_popup) { evas_object_del(m_popup); m_popup = NULL; } m_popup = elm_popup_add(m_navi_bar); evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(m_popup, "title,text", title); elm_object_text_set(m_popup, msg); elm_popup_timeout_set(m_popup, timeout); evas_object_show(m_popup); }
static void launch_popup_cb(void *data , Evas_Object *obj , void *event_info) { datetimedata_s *dd = data; char *format; create_datetime_popup(dd); Evas_Object *box = elm_box_add(dd->popup); dd->datetime = elm_datetime_add(dd->nf); format = evas_object_data_get(obj, "format"); if (!strcmp(format, DATE_FORMAT)) { elm_object_part_text_set(dd->popup, "title,text", "Date Picker"); elm_object_style_set(dd->datetime, DATE_LAYOUT); elm_datetime_format_set(dd->datetime, "%d/%b/%Y"); } else if (!strcmp(format, TIME_12_FORMAT)) { elm_object_part_text_set(dd->popup, "title,text", "Time_12 Picker"); elm_object_style_set(dd->datetime, TIME_12_LAYOUT); elm_datetime_format_set(dd->datetime, "%d/%b/%Y %I:%M %p"); } else { elm_object_part_text_set(dd->popup, "title,text", "Time_24 Picker"); elm_object_style_set(dd->datetime, TIME_24_LAYOUT); elm_datetime_format_set(dd->datetime, "%d/%b/%Y %H:%M"); } elm_datetime_value_set(dd->datetime, &dd->saved_time); evas_object_size_hint_align_set(dd->datetime, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(dd->datetime); elm_box_pack_end(box, dd->datetime); elm_object_content_set(dd->popup, box); evas_object_show(dd->popup); }
Eina_Bool Browser_Common_View::_show_share_popup(const char *url) { BROWSER_LOGE("url=[%s]", url); if (!url || strlen(url) == 0) { BROWSER_LOGE("url is empty"); return EINA_FALSE; } m_share_url = std::string(url); m_sns_path_list.clear(); m_sns_name_list.clear(); m_sns_icon_list.clear(); m_share_popup = elm_popup_add(m_navi_bar); if (!m_share_popup) { BROWSER_LOGE("elm_popup_add failed"); return EINA_FALSE; } elm_object_style_set(m_share_popup, "menustyle"); elm_object_part_text_set(m_share_popup, "title,text", BR_STRING_SHARE); evas_object_size_hint_weight_set(m_share_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); m_share_list = elm_list_add(m_share_popup); if (!m_share_list) { BROWSER_LOGE("elm_list_add failed"); return EINA_FALSE; } evas_object_size_hint_weight_set(m_share_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(m_share_list, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_list_item_append(m_share_list, BR_STRING_MESSAGES, NULL, NULL, __send_via_message_cb, this); elm_list_item_append(m_share_list, BR_STRING_EMAIL, NULL, NULL, __send_via_email_cb, this); evas_object_show(m_share_list); Evas_Object *cancel_button = elm_button_add(m_share_popup); elm_object_text_set(cancel_button, BR_STRING_CANCEL); elm_object_part_content_set(m_share_popup, "button1", cancel_button); elm_object_style_set(cancel_button, "popup_button/default"); evas_object_smart_callback_add(cancel_button, "clicked", __popup_response_cb, this); elm_object_content_set(m_share_popup, m_share_list); evas_object_show(m_share_popup); return EINA_TRUE; }
static void _init_multibutton_entry(Evas_Object *win) { Evas_Object *scroller, *bg, *box, *mb_entry; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); 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); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, box); evas_object_show(box); scroller = elm_scroller_add(win); elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); elm_scroller_policy_set (scroller, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO); evas_object_show(scroller); mb_entry = elm_multibuttonentry_add(win); elm_object_part_text_set(mb_entry, "guide", "Tap to add recipient"); elm_object_text_set(mb_entry, EAIL_TEST_INPUT_TEXT); evas_object_size_hint_weight_set(mb_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(mb_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_content_set(scroller, mb_entry); evas_object_show(mb_entry); elm_multibuttonentry_item_append(mb_entry, "first", NULL, NULL); elm_multibuttonentry_item_append(mb_entry, "second", NULL, NULL); elm_multibuttonentry_item_append(mb_entry, "third", NULL, NULL); elm_multibuttonentry_item_append(mb_entry, "fourth", NULL, NULL); elm_object_focus_set(mb_entry, EINA_TRUE); elm_box_pack_end(box, mb_entry); evas_object_resize(win, 130, 180); }
void _update_time_part(Evas_Object *obj, const char *part, double t) { Eina_Strbuf *str; double s; int h, m; s = t; h = (int)(s / 3600.0); s -= h * 3600; m = (int)(s / 60.0); s -= m * 60; str = eina_strbuf_new(); eina_strbuf_append_printf(str, "%02d:%02d:%02d", h, m, (int)s); elm_object_part_text_set(obj, part, eina_strbuf_string_get(str)); eina_strbuf_free(str); }
static Evas_Object* create_about_section(view_sys *p_sys) { /* Create layout and set the theme */ Evas_Object *layout = elm_layout_add(p_sys->nf_toolbar); /* */ elm_layout_file_set(layout, ABOUT_EDJ, "about"); /* Cone */ Evas_Object *cone = elm_image_add(layout); evas_object_size_hint_align_set(cone, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(cone, EVAS_HINT_FILL, EVAS_HINT_EXPAND); elm_image_file_set(cone, ICON_DIR"cone.png", NULL); elm_object_part_content_set(layout, "cone", cone); evas_object_show(cone); /* Description */ Evas_Object *lbl_description = elm_label_add(layout); evas_object_size_hint_align_set(lbl_description, EVAS_HINT_FILL, 0); evas_object_size_hint_weight_set(lbl_description, EVAS_HINT_FILL, EVAS_HINT_EXPAND); elm_label_line_wrap_set(lbl_description, ELM_WRAP_MIXED); elm_object_text_set(lbl_description, "<font-size=22><align=center>VLC for Tizen™ is a port of VLC media player, the popular open-source media player."); elm_object_part_content_set(layout, "description", lbl_description); evas_object_show(lbl_description); /* Revision number */ elm_object_part_text_set(layout, "revision", REVISION); /* Handle cone animation */ p_sys->p_anim->initial_y = -1; // Initial position unknown p_sys->p_anim->obj = cone; p_sys->p_anim->container = layout; evas_object_smart_callback_add(cone, "clicked", cone_clicked_cb, p_sys); /* */ evas_object_show(layout); return layout; }
static void _main_view_show_warning_popup(Evas_Object *navi, const char *caption, const char *text, const char *button_text, void *data) { RETM_IF(!data, "data is null"); DBG(" <<< called"); main_view *main_view_data = data; Evas_Object *popup = elm_popup_add(navi); RETM_IF(!popup, "popup is not created"); elm_object_part_text_set(popup, "title,text", caption); elm_object_text_set(popup, text); evas_object_show(popup); Evas_Object *button = elm_button_add(popup); RETM_IF(!button, "button is not created"); elm_object_style_set(button, POPUP_BUTTON_STYLE); elm_object_text_set(button, button_text); elm_object_part_content_set(popup, POPUP_BUTTON_PART, button); evas_object_smart_callback_add(button, "clicked", _main_view_popup_close_cb, main_view_data); eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _main_view_popup_close_cb, main_view_data); main_view_data->popup = popup; }
int create_and_show_basic_popup_min(struct appdata *ad) { Evas_Object *btn1; Evas_Object *btn2; ad->popup_poweroff = elm_popup_add(ad->win_main); if (ad->popup_poweroff == NULL) { system_print("\n System-popup : Add popup failed \n"); return -1; } evas_object_size_hint_weight_set(ad->popup_poweroff, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_text_set(ad->popup_poweroff, _("IDS_ST_BODY_POWER_OFF")); elm_object_part_text_set(ad->popup_poweroff, "title,text", _("IDS_COM_BODY_SYSTEM_INFO_ABB")); btn1 = elm_button_add(ad->popup_poweroff); elm_object_text_set(btn1, _("IDS_COM_SK_OK")); elm_object_part_content_set(ad->popup_poweroff, "button1", btn1); elm_object_style_set (btn1,"popup_button/default"); evas_object_smart_callback_add(btn1, "clicked", poweroff_response_yes_cb_min, ad); btn2 = elm_button_add(ad->popup_poweroff); elm_object_text_set(btn2, _("IDS_COM_SK_CANCEL")); elm_object_part_content_set(ad->popup_poweroff, "button2", btn2); elm_object_style_set (btn2,"popup_button/default"); evas_object_smart_callback_add(btn2, "clicked", poweroff_response_no_cb_min, ad); Ecore_X_Window xwin; xwin = elm_win_xwindow_get(ad->popup_poweroff); ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); utilx_grab_key(ecore_x_display_get(), xwin, KEY_SELECT, SHARED_GRAB); ecore_event_handler_add(ECORE_EVENT_KEY_UP, poweroff_response_no_cb_min, NULL); evas_object_show(ad->popup_poweroff); return 0; }
/* Basic popup widget */ int usbotg_unmount_create_and_show_basic_popup(struct appdata *ad) { Evas_Object *btn1; Evas_Object *btn2; char buf[PATH_MAX] = {0, }; /* Initialization */ int ret_val = 0; snprintf(buf, PATH_MAX, "Unmount %s?", dev_name); ad->device_name = malloc(strlen(dev_name)+1); strncpy(ad->device_name, dev_name, strlen(dev_name)); /* Add notify */ /* No need to give main window, it will create internally */ ad->popup = elm_popup_add(ad->win_main); evas_object_size_hint_weight_set(ad->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_text_set(ad->popup, buf); elm_object_part_text_set(ad->popup, "title,text", _("IDS_COM_BODY_SYSTEM_INFO_ABB")); btn1 = elm_button_add(ad->popup); elm_object_text_set(btn1, "OK"); elm_object_part_content_set(ad->popup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", ok_clicked_cb, ad); btn2 = elm_button_add(ad->popup); elm_object_text_set(btn2, "Cancel"); elm_object_part_content_set(ad->popup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", bg_clicked_cb, ad); Ecore_X_Window xwin; xwin = elm_win_xwindow_get(ad->popup); ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); evas_object_show(ad->popup); return 0; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *icon, *icon2, *bt, *bt2, *layout; Evas_Object *clk; Evas_Object *item; char buf[PATH_MAX]; elm_app_info_set(elm_main, "elementary", "examples/layout_example.edj"); win = elm_win_add(NULL, "layout", ELM_WIN_BASIC); 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); // Adding layout and filling it with widgets layout = elm_layout_add(win); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, layout); snprintf(buf, sizeof(buf), "%s/examples/layout_example.edj", elm_app_data_dir_get()); elm_layout_file_set(layout, buf, "example/mylayout"); evas_object_show(layout); // Setting title const char *title = elm_layout_data_get(layout, "title"); if (title) { elm_win_title_set(win, title); elm_object_part_text_set(layout, TITLE, title); } // Add icon, clock and button to the table icon = elm_icon_add(win); elm_icon_standard_set(icon, "home"); evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_layout_table_pack(layout, TABLE, icon, 0, 0, 1, 1); evas_object_show(icon); icon2 = elm_icon_add(win); elm_icon_standard_set(icon2, "close"); evas_object_size_hint_weight_set(icon2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(icon2, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_layout_table_pack(layout, TABLE, icon2, 1, 0, 1, 1); evas_object_show(icon2); clk = elm_clock_add(win); evas_object_size_hint_weight_set(clk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(clk, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_layout_table_pack(layout, TABLE, clk, 2, 0, 1, 1); evas_object_show(clk); bt = elm_button_add(win); elm_object_text_set(bt, "Click me!"); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_layout_table_pack(layout, TABLE, bt, 0, 1, 3, 1); evas_object_smart_callback_add(bt, "clicked", _tbl_btn_cb, layout); evas_object_show(bt); item = elm_button_add(win); elm_object_text_set(item, "Position 0"); evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(item, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_layout_box_insert_at(layout, BOX, item, 0); evas_object_smart_callback_add(item, "clicked", _box_btn_cb, layout); evas_object_show(item); item = elm_button_add(win); elm_object_text_set(item, "Prepended"); evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(item, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_layout_box_prepend(layout, BOX, item); evas_object_smart_callback_add(item, "clicked", _box_btn_cb, layout); evas_object_show(item); bt2 = elm_button_add(win); elm_object_text_set(bt2, "Delete All"); elm_object_part_content_set(layout, SWALLOW, bt2); evas_object_smart_callback_add(bt2, "clicked", _swallow_btn_cb, layout); evas_object_resize(win, 320, 320); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *popup, *btn1, *btn2, *btn3, *icon1; char buf[256]; elm_app_info_set(elm_main, "elementary", "images/logo_small.png"); win = elm_win_add(NULL, "popup", ELM_WIN_BASIC); elm_win_title_set(win, "Popup"); elm_win_autodel_set(win, EINA_TRUE); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 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); popup = elm_popup_add(win); // Setting popup content-text elm_object_text_set(popup, "This is the Content-Text for popup. The wrap" "for the content-text is character wrapping"); // Setting the wrapping type to character wrapping elm_popup_content_text_wrap_type_set(popup, ELM_WRAP_CHAR); // Seting popup title-text elm_object_part_text_set(popup, "title,text", "Title"); icon1 = elm_icon_add(popup); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); elm_icon_file_set(icon1, buf, NULL); //Setting popup title-icon elm_object_part_content_set(popup, "title,icon", icon1); // Creating the first action button btn1 = elm_button_add(popup); elm_object_text_set(btn1, "OK"); // Setting the fist action button elm_object_part_content_set(popup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", _response_cb, popup); // Creating the second action button btn2 = elm_button_add(popup); elm_object_text_set(btn2, "Cancel"); // Setting the second action button elm_object_part_content_set(popup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", _response_cb, popup); btn3 = elm_button_add(popup); elm_object_text_set(btn3, "Close"); // Setting this action button elm_object_part_content_set(popup, "button3", btn3); // Setting the orientation of popup to Top elm_popup_orient_set(popup, ELM_POPUP_ORIENT_TOP); // Display the popup object evas_object_show(popup); evas_object_resize(win, 480, 800); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
void Object::setText (const std::string &part, const std::string &label) { elm_object_part_text_set(o, part.c_str(), label.c_str()); }
void mini_control_title_set(minicontrol *mc, const char* title) { elm_object_part_text_set(mc->layout, "swallow.title", title); }
/* public functions */ EM_INTERN Eina_Bool em_gui_init(void) { Evas_Object *o, *oo; /* allocate our object */ gui = EM_OBJECT_ALLOC(Em_Gui, EM_GUI_TYPE, _em_gui_cb_free); if (!gui) return EINA_FALSE; /* create window */ gui->w_win = elm_win_add(NULL, "emote", ELM_WIN_BASIC); elm_win_title_set(gui->w_win, "Emote"); elm_win_keyboard_mode_set(gui->w_win, ELM_WIN_KEYBOARD_ALPHA); evas_object_smart_callback_add(gui->w_win, "delete,request", _em_gui_cb_win_del, NULL); /* create background */ o = elm_bg_add(gui->w_win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(gui->w_win, o); evas_object_show(o); o = elm_box_add(gui->w_win); elm_box_homogeneous_set(o, EINA_FALSE); elm_win_resize_object_add(gui->w_win, o); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_box_align_set(o, 0.5, 0.5); evas_object_show(o); /* create main toolbar */ gui->w_tb = elm_toolbar_add(gui->w_win); elm_toolbar_icon_size_set(gui->w_tb, (8 * elm_config_scale_get())); elm_toolbar_align_set(gui->w_tb, 1.0); elm_toolbar_shrink_mode_set(gui->w_tb, ELM_TOOLBAR_SHRINK_SCROLL); elm_toolbar_item_append(gui->w_tb, "preferences-system", _("Settings"), _em_gui_cb_settings, NULL); elm_toolbar_item_append(gui->w_tb, "application-exit", _("Quit"), _em_gui_cb_quit, NULL); evas_object_size_hint_weight_set(gui->w_tb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(gui->w_tb, EVAS_HINT_FILL, 0.0); evas_object_show(gui->w_tb); elm_box_pack_start(o, gui->w_tb); /* create packing box */ gui->w_box = elm_panes_add(gui->w_win); elm_panes_fixed_set(gui->w_box, EINA_FALSE); elm_panes_horizontal_set(gui->w_box, EINA_FALSE); elm_panes_content_left_size_set(gui->w_box, 0.20); evas_object_size_hint_weight_set(gui->w_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(gui->w_box, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(o, gui->w_box); evas_object_show(gui->w_box); gui->w_chansel_itc = elm_genlist_item_class_new(); gui->w_chansel_itc->item_style = "default"; gui->w_chansel_itc->func.text_get = _em_gui_chansel_cb_label_get; gui->w_chansel_itc->func.content_get = NULL; gui->w_chansel_itc->func.state_get = NULL; gui->w_chansel_itc->func.del = NULL; /* create channel selector w/ frame */ gui->w_chansel = elm_genlist_add(gui->w_win); elm_genlist_mode_set(gui->w_chansel, ELM_LIST_SCROLL); evas_object_size_hint_min_set(gui->w_chansel, 200, MIN_WIN_HEIGHT); evas_object_size_hint_weight_set(gui->w_chansel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(gui->w_chansel); o = elm_frame_add(gui->w_win); elm_object_part_text_set(o, "default", "Channels"); oo = elm_frame_add(gui->w_win); elm_object_style_set(oo, "pad_small"); elm_object_part_content_set(o, "default", oo); elm_object_part_content_set(oo, "default", gui->w_chansel); elm_object_part_content_set(gui->w_box, "left", o); evas_object_show(oo); evas_object_show(o); /* set min size of window and show it */ evas_object_show(gui->w_win); evas_object_resize(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); gui->servers = eina_hash_string_small_new(_em_gui_server_del); return EINA_TRUE; }