Tabpanel_Item * tabpanel_item_add(Tabpanel *tab, const char *label, Evas_Object *content, TabLanelSelectCB select_cb, void *data) { Tabpanel_Item *item = calloc(1, sizeof(Tabpanel_Item)); tab->items = eina_list_append(tab->items, item); item->tab = tab; item->item_tb = elm_toolbar_item_append(tab->tabs, NULL, label, _tb_select_cb, item); item->content = content; item->del = EINA_FALSE; if (content) elm_pager_content_push(tab->panels, content); item->data = data; item->select_cb = select_cb; elm_toolbar_item_selected_set(item->item_tb, EINA_TRUE); if (tab->from_edje && eina_list_count(tab->items) > 1) edje_object_signal_emit( tab->parent, "toolbar,show", ""); return item; }
/* Main_Menu */ static void _button_clicked_setting_cb(void *data, Evas_Object *obj, void *event_info) { Em_Smart_Data *em = data; if (emusic_config_dialog_creat(em)) { elm_pager_content_push(em->pager, em->config_dialog); } else ERR("could not create configure dialog."); }
Evas_Object *tabpanel_create() { Evas_Object *vbox,*tb; vbox = elm_box_add(win); evas_object_size_hint_weight_set(vbox, 1.0, 1.0); evas_object_size_hint_align_set(vbox, -1.0, -1.0); evas_object_show(vbox); // tb = elm_toolbar_add(win); evas_object_size_hint_weight_set(tb, 0.0, 0.0); evas_object_size_hint_align_set(tb, -1.0, 0.0); evas_object_show(tb); elm_box_pack_end(vbox, tb); // // _pager = elm_pager_add(win); evas_object_size_hint_weight_set(_pager, 1.0, 1.0); evas_object_size_hint_align_set(_pager, -1.0, -1.0); elm_box_pack_end(vbox, _pager); evas_object_show(_pager); Evas_Object *presentation = presentation_create(); Evas_Object *slides_grid = slides_grid_create(); elm_pager_content_push(_pager, presentation); elm_pager_content_push(_pager, slides_grid); // Elm_Object_Item *item = elm_toolbar_item_append(tb, NULL, D_("Presentation"), _tb_presentation, presentation); elm_toolbar_item_append(tb, NULL, D_("Slides list"), _tb_slidelist, slides_grid); elm_toolbar_item_selected_set(item, EINA_TRUE); return vbox; }
void flickr_sync_update(Enlil_Album *album) { Enlil_Album_Data *album_data = enlil_album_user_data_get(album); Evas_Object *fr, *tb2, *lbl, *bt, *sep, *pb, *pager; Evas_Object *inwin = album_data->netsync.inwin.win; Evas_Object *tb = album_data->netsync.inwin.tb; int i = 0; Eina_List *l; Enlil_Photo *photo; int nb_photos; char buf[1024]; if (album_data->netsync.inwin.fr) evas_object_del( album_data->netsync.inwin.fr); // fr = elm_frame_add(inwin); album_data->netsync.inwin.fr = fr; elm_object_text_set(fr, D_("Synchronise an album with flickr")); evas_object_size_hint_weight_set(fr, 1.0, 1.0); evas_object_size_hint_align_set(fr, -1.0, -1.0); evas_object_show(fr); elm_table_padding_set(tb, 1, 1); elm_table_pack(tb, fr, 0, 0, 3, 1); tb2 = elm_table_add(inwin); evas_object_size_hint_weight_set(tb2, 1.0, 0.0); evas_object_size_hint_align_set(tb2, -1.0, 1.0); elm_table_padding_set(tb2, 15, 5); evas_object_show(tb2); elm_frame_content_set(fr, tb2); // if (album_data->netsync.album_netsync_notuptodate) { lbl = elm_label_add(inwin); elm_object_text_set(lbl, D_("Update the flickr album header.")); evas_object_show(lbl); elm_table_pack(tb2, lbl, 0, i, 1, 1); bt = elm_button_add(inwin); album_data->netsync.inwin.bt1 = bt; elm_object_text_set(bt, D_("Update")); evas_object_smart_callback_add(bt, "clicked", _netsync_notuptodate_cb, album); evas_object_size_hint_align_set(bt, 0.5, 0.5); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_show(bt); elm_table_pack(tb2, bt, 1, i, 1, 1); i++; sep = elm_separator_add(inwin); evas_object_show(sep); elm_table_pack(tb2, sep, 0, i, 2, 1); i++; } if (album_data->netsync.album_notinnetsync) { lbl = elm_label_add(inwin); elm_object_text_set(lbl, D_("The album is not in Flickr.")); evas_object_show(lbl); elm_table_pack(tb2, lbl, 0, i, 1, 1); bt = elm_button_add(inwin); album_data->netsync.inwin.bt2 = bt; elm_object_text_set(bt, D_("Add the album in Flickr")); evas_object_size_hint_align_set(bt, 0.5, 0.5); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_smart_callback_add(bt, "clicked", _album_notinnetsync_cb, album); evas_object_show(bt); elm_table_pack(tb2, bt, 1, i, 1, 1); i++; sep = elm_separator_add(inwin); evas_object_show(sep); elm_table_pack(tb2, sep, 0, i, 2, 1); i++; } if (album_data->netsync.album_local_notuptodate) { lbl = elm_label_add(inwin); elm_object_text_set(lbl, D_("Update the local album header.")); evas_object_show(lbl); elm_table_pack(tb2, lbl, 0, i, 1, 1); bt = elm_button_add(inwin); album_data->netsync.inwin.bt3 = bt; evas_object_size_hint_align_set(bt, 0.5, 0.5); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_smart_callback_add(bt, "clicked", _local_notuptodate_cb, album); elm_object_text_set(bt, D_("Update")); evas_object_show(bt); elm_table_pack(tb2, bt, 1, i, 1, 1); i++; sep = elm_separator_add(inwin); evas_object_show(sep); elm_table_pack(tb2, sep, 0, i, 2, 1); i++; } if (album_data->netsync.photos_notinlocal) { lbl = elm_label_add(inwin); elm_object_text_set(lbl, D_("Some photos are not in the local album.")); evas_object_show(lbl); elm_table_pack(tb2, lbl, 0, i, 1, 1); pager = elm_pager_add(inwin); album_data->netsync.inwin.notinlocal.pager = pager; evas_object_size_hint_align_set(pager, 0.5, 0.5); evas_object_size_hint_weight_set(pager, 1.0, 0.0); evas_object_show(pager); elm_table_pack(tb2, pager, 1, i, 1, 1); elm_object_style_set(pager, "fade_invisible"); bt = elm_button_add(inwin); album_data->netsync.inwin.notinlocal.bt = bt; album_data->netsync.inwin.bt4 = bt; evas_object_size_hint_align_set(bt, -1.0, 0.5); evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_object_text_set(bt, D_("Download Them All")); evas_object_smart_callback_add(bt, "clicked", _photos_notinlocal_cb, album); evas_object_show(bt); elm_pager_content_push(pager, bt); pb = elm_progressbar_add(inwin); album_data->netsync.inwin.notinlocal.pb = pb; evas_object_size_hint_align_set(pb, -1.0, 0.5); evas_object_size_hint_weight_set(pb, 1.0, 0.0); elm_progressbar_pulse_set(pb, EINA_TRUE); elm_object_text_set(pb, D_("Downloads in progress ...")); evas_object_show(pb); elm_pager_content_push(pager, pb); evas_object_size_hint_max_set(pb, 0, 0); if (album_data->netsync.inwin.notinlocal.is_updating) { elm_progressbar_pulse(pb, EINA_TRUE); elm_pager_content_promote(pager, pb); } else elm_pager_content_promote(pager, bt); i++; sep = elm_separator_add(inwin); evas_object_show(sep); elm_table_pack(tb2, sep, 0, i, 2, 1); i++; } nb_photos = 0; EINA_LIST_FOREACH(enlil_album_photos_get(album), l, photo) { Enlil_Photo_Data *photo_data = enlil_photo_user_data_get(photo); if (photo_data && photo_data->netsync.state == PHOTO_FLICKR_NOTINFLICKR) { nb_photos++; } }
void create_pager(Evas_Object *parent, Evas_Object *pg, Pginfo *info, Measurements_Lists *ml) { Evas_Object *ed, *converters_list, *layout; pg = elm_pager_add(parent); elm_win_resize_object_add(parent, pg); evas_object_size_hint_weight_set(pg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(pg, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(pg); info->pager = pg; /*main page*/ layout = elm_layout_add(parent); if (!elm_layout_file_set(layout, PACKAGE_DATA_DIR "/default.edj", "main")) { DBG("Can't load Edje Layout %s", PACKAGE_DATA_DIR "/default.edj"); return; } evas_object_show(layout); elm_pager_content_push(pg, layout); info->pg1 = layout; converters_list = elm_list_add(parent); elm_object_part_content_set(layout, "converters_list", converters_list); evas_object_size_hint_weight_set(converters_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_fill_set(converters_list, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(converters_list); populate_converters_list(converters_list, info); /* distance conerter*/ layout = elm_layout_add(parent); if (!elm_layout_file_set(layout, PACKAGE_DATA_DIR "/default.edj", "distance_converter")) { DBG("Can't load Edje Layout %s", PACKAGE_DATA_DIR "/default.edj"); return; } evas_object_show(layout); ed = elm_layout_edje_get(layout); edje_object_part_text_set(ed, "equal", ""); edje_object_part_text_set(ed, "input", ""); edje_object_part_text_set(ed, "output", ""); ml->list_in = elm_list_add(parent); elm_object_part_content_set(layout, "measurements_in", ml->list_in); evas_object_size_hint_weight_set(ml->list_in, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_fill_set(ml->list_in, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(ml->list_in); populate_measurements_list_in(ml->list_in, ed, info); ml->list_out = elm_list_add(parent); elm_object_part_content_set(layout, "measurements_out", ml->list_out); evas_object_size_hint_weight_set(ml->list_out, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_fill_set(ml->list_out, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(ml->list_out); populate_measurements_list_out(ml->list_out, ed, info); /* Set callback functions */ edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_1", on_number_button_clicked, "1"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_2", on_number_button_clicked, "2"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_3", on_number_button_clicked, "3"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_4", on_number_button_clicked, "4"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_5", on_number_button_clicked, "5"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_6", on_number_button_clicked, "6"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_7", on_number_button_clicked, "7"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_8", on_number_button_clicked, "8"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_9", on_number_button_clicked, "9"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_0", on_number_button_clicked, "0"); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_clear", on_number_button_clear, ml); edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_enter", on_number_button_enter, ml); edje_object_signal_callback_add(ed, "mouse,clicked,1", "back", back_page_1, info); elm_pager_content_push(pg, layout); info->pg2 = layout; elm_pager_content_promote(info->pager, info->pg1); }
/* Win */ int creat_win(Em_Smart_Data *em) { Evas_Object *obj, *win; win = elm_win_add(NULL, "e_music", ELM_WIN_BASIC); em->win = win; em->evas = evas_object_evas_get(win); em->layout = elm_layout_add(win); if (!em->layout) { ERR("could not create layout.\n"); evas_object_del(win); return 0; } evas_object_size_hint_weight_set(em->layout, 1.0, 1.0); elm_win_resize_object_add(win, em->layout); evas_object_show(em->layout); em->edje = elm_layout_edje_get(em->layout); if (!elm_layout_file_set(em->layout, emusic_config_theme_get(), "emusic/main")) { int err = edje_object_load_error_get(em->edje); const char *errmsg = edje_load_error_str(err); ERR("cannot load theme '%s', group '%s': %s\n", emusic_config_theme_get(), "emusic/main", errmsg); evas_object_del(win); return 0; } Evas_Object *pg = elm_pager_add(win); em->pager = pg; elm_layout_content_set(em->layout, "pager", pg); elm_object_style_set(pg, "slide_invisible"); evas_object_show(pg); if (emusic_playlist_toolbar_creat(em)) { elm_pager_content_push(pg, em->playlist_view); } else { ERR("could not create playlist dialog.\n"); } Evas_Object *notify = emusic_notify_creat(em); if (notify) { //edje_object_part_swallow(em->edje, _EDJE_PART_NOTIFY, notify); } else { ERR("could not create notify.\n"); } if (emusic_event_bg_creat(em)) { edje_object_part_swallow(em->edje, "event_bg", em->event_bg); } else { ERR("could not create event bg.\n"); } elm_win_title_set(win, "E_Music"); evas_object_smart_callback_add(win, "delete,request", _win_del, NULL); evas_object_resize(win, 800, 400); evas_object_show(win); return 1; }