static int viewer_manager_header_create(Evas_Object* genlist) { __COMMON_FUNC_ENTER__; Evas_Object *toggle_btn = NULL; manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi)); header_itc_text.item_style = "dialogue/1text.1icon"; header_itc_text.func.text_get = _gl_header_text_get; header_itc_text.func.content_get = _gl_header_content_get; header_itc_text.func.state_get = NULL; header_itc_text.func.del = _gl_header_del; common_utils_add_dialogue_separator(genlist, "dialogue/separator"); toggle_btn = elm_check_add(genlist); elm_object_style_set(toggle_btn, "on&off"); evas_object_propagate_events_set(toggle_btn, EINA_TRUE); elm_check_state_set(toggle_btn, EINA_FALSE); evas_object_show(toggle_btn); evas_object_ref(toggle_btn); assertm_if(NULL != manager_object->item_header, "ERROR!!"); manager_object->item_header = elm_genlist_item_append(genlist, &header_itc_text, toggle_btn, NULL, ELM_GENLIST_ITEM_NONE, _gl_header_sel_cb, NULL); assertm_if(NULL == manager_object->item_header, "NULL!!"); __COMMON_FUNC_EXIT__; return TRUE; }
void GenlistItemScenarioSchedule::scenarioDelete(void *data) { if (!scenario) return; Evas_Object *table = createPaddingTable(evas, parent, 280, 260); Evas_Object *glist = elm_genlist_add(table); elm_object_style_set(glist, "calaos"); elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS); evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(glist); string title_label = _("Confirmation<br><small><light_blue>Are you sure you want to delete this scenarios?</light_blue></small>"); GenlistItemBase *header = new GenlistItemSimpleHeader(evas, glist, title_label); header->Append(glist); GenlistItemSimple *_item = new GenlistItemSimple(evas, parent, _("Yes, delete the scenario"), true); _item->Append(glist, header); _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::deleteScenarioValid)); _item = new GenlistItemSimple(evas, parent, _("No"), true); _item->Append(glist, header); _item->item_selected.connect(sigc::bind(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::deleteScenarioCancel), _item)); elm_table_pack(table, glist, 1, 1, 1, 1); elm_naviframe_item_push(pager_popup, NULL, NULL, NULL, table, "calaos"); }
static Evas_Object *_gl_bottom_content_get(void *data, Evas_Object *obj, const char *part) { __COMMON_FUNC_ENTER__; if (manager_object == NULL || obj == NULL) return NULL; int ret = -1; Evas_Object *toggle_btn = elm_check_add(obj); assertm_if(NULL == toggle_btn, "NULL!!"); elm_object_style_set(toggle_btn, "on&off"); evas_object_propagate_events_set(toggle_btn, EINA_TRUE); ret = wifi_setting_value_get(VCONFKEY_WIFI_ENABLE_QS); switch (ret) { case 1: elm_check_state_set(toggle_btn, EINA_TRUE); break; case 0: elm_check_state_set(toggle_btn, EINA_FALSE); break; default: assertm_if(TRUE, "Setting fail!!"); break; } __COMMON_FUNC_EXIT__; return toggle_btn; }
static void create_main_view(appdata_s *ad) { Evas_Object *genlist; Evas_Object *circle_genlist; Evas_Object *btn; Evas_Object *nf = ad->nf; Elm_Object_Item *nf_it; Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new(); Elm_Genlist_Item_Class *ttc = elm_genlist_item_class_new(); Elm_Genlist_Item_Class *ptc = elm_genlist_item_class_new(); item_data *id; int index = 0; /* Genlist */ genlist = elm_genlist_add(nf); elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); evas_object_smart_callback_add(genlist, "selected", gl_selected_cb, NULL); circle_genlist = eext_circle_object_genlist_add(genlist, ad->circle_surface); eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE); /* Genlist Title Item style */ ttc->item_style = "title"; ttc->func.text_get = _gl_menu_title_text_get; ttc->func.del = _gl_menu_del; /* Genlist Item style */ itc->item_style = "default"; itc->func.text_get = _gl_menu_text_get; itc->func.del = _gl_menu_del; /* Genlist Padding Item style */ ptc->item_style = "padding"; ptc->func.del = _gl_menu_del; /* Title Items Here */ elm_genlist_item_append(genlist, ttc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); /* Main Menu Items Here */ id = (item_data *)calloc(sizeof(item_data), 1); id->index = index++; id->item = elm_genlist_item_append(genlist, itc, id, NULL, ELM_GENLIST_ITEM_NONE, index_cb, ad); id = (item_data *)calloc(sizeof(item_data), 1); id->index = index++; id->item = elm_genlist_item_append(genlist, itc, id, NULL, ELM_GENLIST_ITEM_NONE, index_cb, ad); elm_genlist_item_append(genlist, ptc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); elm_genlist_item_class_free(itc); elm_genlist_item_class_free(ttc); elm_genlist_item_class_free(ptc); /* This button is set for devices which doesn't have H/W back key. */ btn = elm_button_add(nf); elm_object_style_set(btn, "naviframe/end_btn/default"); nf_it = elm_naviframe_item_push(nf, NULL, btn, NULL, genlist, "empty"); elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->win); }
Evas_Object *IOGenlistScenarioHomeView::getPartItem(Evas_Object *obj, string part) { Evas_Object *o = NULL; if (!io) return o; if (part == "calaos.button.go") { object_button = o = elm_button_add(parent); Evas_Object *icon = elm_icon_add(o); if (io->params["state"] == "true") elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/stop"); else elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/play"); elm_object_style_set(o, "calaos/action_button/default"); elm_object_content_set(o, icon); evas_object_smart_callback_add(o, "clicked", _item_button_Go, this); } initView(); return o; }
void tab_view_add(Evas_Object *parent) { RETM_IF(!parent, "parent is NULL"); tab_view_data *data = calloc(1, sizeof(tab_view_data)); data->navi = parent; data->layout = ui_utils_layout_add(data->navi, _tab_view_destroy, data); if(!data->layout) { free(data); return; } data->tab = elm_toolbar_add(data->navi); if(!data->tab) { evas_object_del(data->layout); return; } elm_toolbar_shrink_mode_set(data->tab, ELM_TOOLBAR_SHRINK_EXPAND); elm_toolbar_transverse_expanded_set(data->tab, EINA_TRUE); elm_object_style_set(data->tab, "tabbar"); _tab_view_fill(data); data->navi_item = elm_naviframe_item_push(data->navi, NULL, NULL, NULL, data->layout, "tabbar/notitle"); elm_object_item_part_content_set(data->navi_item, "tabbar", data->tab); /* Create badge */ int err = badge_new(PACKAGE); if(BADGE_ERROR_NONE != err) { ERR("Badge is not created."); } }
void create_list_view(appdata_s *ad) { Evas_Object *list; Evas_Object *btn; Evas_Object *nf = ad->navi; Elm_Object_Item *nf_it; /* List */ list = elm_list_add(nf); elm_list_mode_set(list, ELM_LIST_COMPRESS); evas_object_smart_callback_add(list, "selected", list_selected_cb, NULL); /* Main Menu Items Here */ elm_list_item_append(list, "Wait Connection", NULL, NULL, _wait_cb, ad); elm_list_item_append(list, "Gesture Setting", NULL, NULL, _setting_cb, ad); elm_list_go(list); /* This button is set for devices which doesn't have H/W back key. */ btn = elm_button_add(nf); elm_object_style_set(btn, "naviframe/end_btn/default"); // 네비프레임 맨위를 설정한다. nf_it = elm_naviframe_item_push(nf, "Gear Presentor", btn, NULL, list, NULL); elm_naviframe_item_pop_cb_set(nf_it, _naviframe_pop_cb, ad); }
void contact_list_add(struct ContactListData *list_data) { Evas_Object *win; win = ui_utils_view_window_get(list_data->view); list_data->index = NULL; list_data->list = elm_genlist_add(win); elm_genlist_mode_set(list_data->list, ELM_LIST_LIMIT); elm_genlist_longpress_timeout_set(list_data->list, 0.5); //elm_genlist_multi_select_set(list_data->list, EINA_TRUE); evas_object_size_hint_align_set(list_data->list, 0.0, 0.0); elm_object_scale_set(list_data->list, 1.0); itc.item_style = "contact"; itc.func.text_get = gl_text_get; itc.func.content_get = gl_content_get; itc.func.state_get = NULL; itc.func.del = gl_del; evas_object_show(list_data->list); if (list_data->layout) { elm_object_part_content_set(list_data->layout, "contacts_list", list_data->list); } list_data->progress = elm_progressbar_add(win); elm_object_style_set(list_data->progress, "wheel"); elm_object_text_set(list_data->progress, D_("Loading...")); evas_object_size_hint_align_set(list_data->progress, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(list_data->progress, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_content_set(list_data->layout, "loading_indicator", list_data->progress); evas_object_show(list_data->progress); }
static void create_list_view(appdata_s *ad) { Evas_Object *list; Evas_Object *btn; Evas_Object *nf = ad->nf; Elm_Object_Item *nf_it; // List list = elm_list_add(nf); elm_list_mode_set(list, ELM_LIST_COMPRESS); evas_object_smart_callback_add(list, "selected", list_selected_cb, NULL); // Main Menu Items Here elm_list_item_append(list, "Group APIs", NULL, NULL, group_cb, nf); elm_list_item_append(list, "Configuration APIs", NULL, NULL, configuration_cb, nf); elm_list_go(list); // This button is set for devices which doesn't have H/W back key. btn = elm_button_add(nf); elm_object_style_set(btn, "naviframe/end_btn/default"); nf_it = elm_naviframe_item_push(nf, "Things Manager", btn, NULL, list, NULL); elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->win); }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *bt, *bt2, *rect, *rect2, *rect3, *hover; win = elm_win_add(NULL, "hover", ELM_WIN_BASIC); elm_win_title_set(win, "Hover"); 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); rect = evas_object_rectangle_add(evas_object_evas_get(win)); evas_object_size_hint_min_set(rect, 25, 25); evas_object_color_set(rect, 255, 0, 0, 255); evas_object_show(rect); rect2 = evas_object_rectangle_add(evas_object_evas_get(win)); evas_object_size_hint_min_set(rect2, 25, 25); evas_object_color_set(rect2, 0, 255, 0, 255); evas_object_show(rect2); rect3 = evas_object_rectangle_add(evas_object_evas_get(win)); evas_object_size_hint_min_set(rect3, 25, 25); evas_object_color_set(rect3, 0, 0, 255, 255); evas_object_show(rect3); bt = elm_button_add(win); elm_object_text_set(bt, "Show hover"); evas_object_move(bt, 60, 90); evas_object_resize(bt, 80, 20); evas_object_show(bt); bt2 = elm_button_add(win); elm_object_text_set(bt2, "Hide hover"); evas_object_show(bt2); hover = elm_hover_add(win); elm_hover_parent_set(hover, win); elm_hover_target_set(hover, bt); elm_object_style_set(hover, "popout"); elm_hover_content_set(hover, "left", rect); elm_hover_content_set(hover, "top", rect2); elm_hover_content_set(hover, "right", rect3); elm_hover_content_set(hover, "middle", bt2); evas_object_smart_callback_add(bt, "clicked", _show_hover, hover); evas_object_smart_callback_add(bt2, "clicked", _hide_hover, hover); evas_object_resize(win, 200, 200); evas_object_show(win); elm_run(); return 0; }
Evas_Object* viewer_list_create(Evas_Object *win) { __COMMON_FUNC_ENTER__; assertm_if(NULL == win, "NULL!!"); assertm_if(NULL != viewer_list, "Err!!"); viewer_list = elm_genlist_add(win); elm_object_style_set(viewer_list, "dialogue"); assertm_if(NULL == viewer_list, "NULL!!"); elm_genlist_mode_set(viewer_list, ELM_LIST_LIMIT); evas_object_size_hint_weight_set(viewer_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(viewer_list, EVAS_HINT_FILL, EVAS_HINT_FILL); container = NULL; container = g_slist_alloc(); assertm_if(NULL == container, "NULL!!"); itc.item_style = "dialogue/2text.2icon.3.tb"; itc.func.text_get = _gl_listview_text_get; itc.func.content_get = _gl_listview_content_get; itc.func.state_get = NULL; itc.func.del = _gl_listview_del; __COMMON_FUNC_EXIT__; return viewer_list; }
/** * send * This function is used to create button * @param parent pointer to Evas object, as the parent * @param label string for title * @param icon_path string for icon path * @param cb as cb when get signle "clicked" * @param cb_data as cb'data * @param style as style * @return when success, return a pointer to evas object, or return NULL * @exception */ Evas_Object *widget_create_button(Evas_Object * parent, char *style, const char *label, const char *icon_path, EO_SMART_CB cb, void *cb_data) { Evas_Object *ret = NULL; Evas_Object *icon = NULL; int nErr = SUCCESS; CLK_FUN_BEG(); ret = elm_button_add(parent); CLK_RETVM_IF(!ret, NULL, "elm_button_add error!"); elm_object_style_set(ret, style); evas_object_size_hint_weight_set(ret, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ret, EVAS_HINT_FILL, 0.5); if (icon_path) { icon = widget_create_icon(parent, icon_path); } if (label) { elm_object_text_set(ret, label); } if (icon) { elm_object_part_content_set(ret, "icon", icon); } if (cb && cb_data) { evas_object_smart_callback_add(ret, "clicked", cb, cb_data); } evas_object_show(ret); End: CLK_FUN_END(); return ret; }
void ActivityScheduleScenarioView::showTimeRangePopup() { pager_popup = elm_naviframe_add(parent); evas_object_show(pager_popup); spin_start_hours = spin_start_min = spin_start_sec = NULL; spin_end_hours = spin_end_min = spin_end_sec = NULL; createTimeSelectTypeList(NULL, NULL, "", ""); //create popup popup = elm_ctxpopup_add(parent); elm_object_content_set(popup, pager_popup); elm_object_style_set(popup, "calaos"); elm_ctxpopup_direction_priority_set(popup, ELM_CTXPOPUP_DIRECTION_DOWN, ELM_CTXPOPUP_DIRECTION_RIGHT, ELM_CTXPOPUP_DIRECTION_LEFT, ELM_CTXPOPUP_DIRECTION_UP); Evas_Coord x,y; evas_pointer_canvas_xy_get(evas, &x, &y); evas_object_move(popup, x, y); evas_object_show(popup); }
void utils_edit_object_delete(void *data, Evas_Object *obj, void *event_info) { Evas_Object *lbl, *tb, *bt; _inwin_delete_slide = elm_win_inwin_add(win); evas_object_show(_inwin_delete_slide); elm_object_style_set(_inwin_delete_slide, "minimal"); tb = elm_table_add(win); elm_win_inwin_content_set(_inwin_delete_slide, tb); lbl = elm_label_add(win); elm_object_text_set(lbl, D_("Are you sure you want to delete this object ?")); elm_table_pack(tb, lbl, 0, 2, 2, 1); evas_object_show(lbl); bt= elm_button_add(win); elm_object_text_set(bt, "Invisible button to add a vertical space"); elm_table_pack(tb, bt, 0, 3, 1, 1); bt= elm_button_add(win); elm_object_text_set(bt, D_("Yes, Delete the object")); evas_object_smart_callback_add(bt, "clicked", _utils_object_delete_cb, NULL); evas_object_color_set(bt, 255, 0, 0, 255); elm_table_pack(tb, bt, 0, 4, 1, 1); evas_object_show(bt); bt= elm_button_add(win); elm_object_text_set(bt, D_("No, do not delete the object")); evas_object_smart_callback_add(bt, "clicked", _utils_object_delete_cancel_cb, NULL); elm_table_pack(tb, bt, 1, 4, 1, 1); evas_object_show(bt); }
ActivityConfigClockView::ActivityConfigClockView(Evas *_e, Evas_Object *_parent): ActivityView(_e, _parent, "calaos/page/config/clock") { printf("Clock view constructor\n"); TimeZone tz; tzList = elm_genlist_add(_parent); setPartText("tab1.text", _("Action and positions of widgets")); setPartText("tab1.text.detail", _("Resume : <light_blue>Current settings</light_blue><br><small>Configure Date and Time !</small")); setPartText("tab2.text", _("About")); setPartText("tab2.text.detail", _("About : <light_blue>Calaos products</light_blue><br><small>Touchscreen solutions.</small>")); elm_object_style_set(tzList, "calaos"); elm_genlist_select_mode_set(tzList, ELM_OBJECT_SELECT_MODE_ALWAYS); evas_object_size_hint_fill_set(tzList, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(tzList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(tzList); Swallow(tzList, "timezone_list.swallow"); for(unsigned int i = 0; i < tz.timeZone.size(); i++) { GenlistItemSimple *_item; _item = new GenlistItemSimple(evas, tzList, tz.timeZone[i].key, true); _item->Append(tzList); } }
static Evas_Object * _widget_colorselector_create(const char *style) { Evas_Object *o; o = elm_colorselector_add(win); EXPAND(o); FILL(o); elm_object_style_set(o, style); elm_colorselector_color_set(o, 255, 160, 132, 180); elm_colorselector_palette_color_add(o, 255, 90, 18, 255); elm_colorselector_palette_color_add(o, 255, 213, 0, 255); elm_colorselector_palette_color_add(o, 146, 255, 11, 255); elm_colorselector_palette_color_add(o, 9, 186, 10, 255); elm_colorselector_palette_color_add(o, 86, 201, 242, 255); elm_colorselector_palette_color_add(o, 18, 83, 128, 255); elm_colorselector_palette_color_add(o, 140, 53, 238, 255); elm_colorselector_palette_color_add(o, 255, 145, 145, 255); elm_colorselector_palette_color_add(o, 255, 59, 119, 255); elm_colorselector_palette_color_add(o, 133, 100, 69, 255); elm_colorselector_palette_color_add(o, 255, 255, 119, 255); elm_colorselector_palette_color_add(o, 133, 100, 255, 255); evas_object_show(o); return o; }
static void alert(const char *text) { Evas_Object *win, *bx, *lb, *bt; win = window; inwin3 = elm_win_inwin_add(win); elm_object_style_set(inwin3, "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); lb = elm_label_add(win); evas_object_size_hint_weight_set(lb, 1.0, 1.0); evas_object_size_hint_align_set(lb, -1.0, 0.5); elm_label_label_set(lb, text); elm_box_pack_end(bx, lb); evas_object_show(lb); 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_alert_ok, NULL); evas_object_show(bt); elm_win_inwin_content_set(inwin3, bx); evas_object_show(bx); elm_win_inwin_activate(inwin3); }
void ApplicationController::onMenuRebootClick() { Evas_Object *table = createPaddingTable(evas, layout, 260, 200); Evas_Object *glist = elm_genlist_add(layout); elm_object_style_set(glist, "calaos"); elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS); evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(glist); Evas_Object *popup = elm_ctxpopup_add(layout); elm_object_style_set(popup, "calaos"); evas_object_size_hint_min_set(popup, 300, 240); GenlistItemSimple *item; item = new GenlistItemSimple(evas, glist, _("Restart application only"), true); item->Append(glist); item->item_selected.connect([this, popup](void *) { elm_ctxpopup_dismiss(popup); menuView->CloseLinkMenu(); system("systemctl restart calaos-home"); }); item = new GenlistItemSimple(evas, glist, _("Reboot machine"), true); item->Append(glist); item->item_selected.connect([this, popup](void *) { elm_ctxpopup_dismiss(popup); menuView->CloseLinkMenu(); system("sync"); system("reboot"); }); elm_table_pack(table, glist, 1, 1, 1, 1); elm_object_content_set(popup, table); Evas_Coord x,y; evas_pointer_canvas_xy_get(evas, &x, &y); evas_object_move(popup, x, y); evas_object_show(popup); }
static void _btn_selected(void *data, Evas_Object *obj, void *event_info) { Evas_Object *btn = data; const char *txt = elm_object_item_text_get(event_info); elm_object_style_set(btn, txt); }
ActivityScenariosView::ActivityScenariosView(Evas *_e, Evas_Object *_parent): ActivityView(_e, _parent, "calaos/page/scenarios"), view_mode(VIEW_MODE_ALL) { setPartText("header.label", _("Scenario management")); addCallback("button.*", "pressed", sigc::mem_fun(*this, &ActivityScenariosView::buttonPressed)); schedule_list = elm_genlist_add(parent); Swallow(schedule_list, "scenario_schedule.list"); elm_object_style_set(schedule_list, "calaos"); elm_genlist_homogeneous_set(schedule_list, true); evas_object_show(schedule_list); scenario_list = elm_genlist_add(parent); Swallow(scenario_list, "scenario.list"); elm_object_style_set(scenario_list, "calaos"); elm_genlist_homogeneous_set(scenario_list, true); evas_object_show(scenario_list); Evas_Object *btn = edje_object_part_external_object_get(edje, "button.calendar.today"); elm_object_text_set(btn, _("Today")); btn = edje_object_part_external_object_get(edje, "button.create"); elm_object_text_set(btn, _("Create a new scenario")); btn = edje_object_part_external_object_get(edje, "button.list.all"); elm_object_text_set(btn, _("All")); btn = edje_object_part_external_object_get(edje, "button.list.light"); elm_object_text_set(btn, _("Lights")); btn = edje_object_part_external_object_get(edje, "button.list.shutters"); elm_object_text_set(btn, _("Shutters")); btn = edje_object_part_external_object_get(edje, "button.list.schedule"); elm_object_text_set(btn, _("Scheduled")); //default to today time_t t = time(0); currDate = *localtime(&t); if (CalaosModel::Instance().getScenario()) scenarioChangeCon = CalaosModel::Instance().getScenario()->scenario_change.connect([=](Scenario *) { reloadCalendar(); }); }
Evas_Object * _content_new(Evas_Object *parent, const char *img) { Evas_Object *photo = elm_photo_add(parent); elm_photo_file_set(photo, img); elm_photo_fill_inside_set(photo, EINA_TRUE); elm_object_style_set(photo, "shadow"); return photo; }
Evas_Object *GenlistItemAlbumHeader::getPartItem(Evas_Object *obj, string part) { Evas_Object *o = NULL; if (part == "calaos.button.play") { o = elm_button_add(parent); Evas_Object *icon = elm_icon_add(o); elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/play"); elm_object_style_set(o, "calaos/action_button/blue"); elm_object_content_set(o, icon); evas_object_smart_callback_add(o, "clicked", _item_button_Play, this); } else if (part == "calaos.button.add") { o = elm_button_add(parent); elm_object_style_set(o, "calaos/action_button/label"); elm_object_text_set(o, "Ajouter"); evas_object_smart_callback_add(o, "clicked", _item_button_Add, this); } else if (part == "calaos.cover") { if (cover_downloaded && ecore_file_exists(cover_fname.c_str())) { o = elm_icon_add(parent); elm_image_file_set(o, cover_fname.c_str(), NULL); elm_image_preload_disabled_set(o, false); elm_object_item_signal_emit(item, "show,cover", "calaos"); } else { if (!dltimer) { dltimer = new EcoreTimer(0.2, (sigc::slot<void>) sigc::bind(sigc::mem_fun(*player, &AudioPlayer::getDBAlbumCoverItem), album_infos, sigc::mem_fun(*this, &GenlistItemAlbumHeader::albumItemCoverGet_cb), AudioPlayer::AUDIO_COVER_SIZE_MEDIUM)); } } } return o; }
static Evas_Object * _widget_check_create(const char *style) { Evas_Object *o; o = elm_check_add(win); EXPAND(o); if (style) elm_object_style_set(o, style); evas_object_show(o); return o; }
static Evas_Object * _widget_bg_create(const char *style) { Evas_Object *bg; bg = elm_bg_add(win); EXPAND(bg); FILL(bg); if (style) elm_object_style_set(bg, style); evas_object_show(bg); return bg; }
/* CREATION */ static Evas_Object * create_button(Evas_Object *parent, const char *style) { Evas_Object *button = elm_button_add(parent); elm_object_style_set(button, style); /* */ evas_object_show(button); return button; }
/* get our images to make slideshow items */ static Evas_Object * _get(void *data, Evas_Object *obj) { Evas_Object *photo = elm_photo_add(obj); elm_photo_file_set(photo, data); elm_photo_fill_inside_set(photo, EINA_TRUE); elm_object_style_set(photo, "shadow"); return photo; }
static void _create_view_layout(struct appdata *ad) { Evas_Object *list; Evas_Object *btn; list = _create_list_winset(ad->win_main, ad); btn = elm_button_add(ad->navi); elm_object_style_set(btn, "naviframe/end_btn/default"); evas_object_smart_callback_add(btn, "clicked", _quit_cb, ad->win_main); elm_naviframe_item_push(ad->navi, _("Tizen UI"), btn, NULL, list, NULL); }
static Evas_Object * _widget_button_create(const char* style) { Evas_Object *btn; btn = elm_button_add(win); EXPAND(btn); ALIGN(btn, EVAS_HINT_FILL, 0); elm_object_style_set(btn, style); elm_object_text_set(btn, "THIS IS A BUTTON TEST"); evas_object_show(btn); return btn; }
void ApplicationController::onMenuAddWidgetClick() { Evas_Object *table = createPaddingTable(evas, layout, 260, 200); Evas_Object *glist = elm_genlist_add(layout); elm_object_style_set(glist, "calaos"); elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS); evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(glist); Evas_Object *popup = elm_ctxpopup_add(layout); elm_object_style_set(popup, "calaos"); evas_object_size_hint_min_set(popup, 300, 240); vector<ModuleDef> mods = ModuleManager::Instance().getAvailableModules(); for (uint i = 0;i < mods.size();i++) { ModuleDef def = mods[i]; GenlistItemWidget *item = new GenlistItemWidget(evas, glist, def); item->Append(glist); item->item_selected.connect([this,i,popup](void *) { vector<ModuleDef> m = ModuleManager::Instance().getAvailableModules(); widgetsController->AddWidget(m[i], 200, 200); elm_ctxpopup_dismiss(popup); menuView->CloseLinkMenu(); }); } elm_table_pack(table, glist, 1, 1, 1, 1); elm_object_content_set(popup, table); Evas_Coord x,y; evas_pointer_canvas_xy_get(evas, &x, &y); evas_object_move(popup, x, y); evas_object_show(popup); }
static void btn_style_click_cb(void *data, Evas_Object *btn, void *ev) { const char *styles[] = { "chucknorris", "default", "anchor" }; static int sel_style = 0; sel_style = (sel_style + 1) % 3; elm_object_style_set(btn, styles[sel_style]); }