static void frame_number_add_show(struct MessageNewViewData *data) { struct Window *win = data->win; window_layout_set(win, MESSAGE_FILE, "recipient_number_add"); window_text_set(win, "title", D_("Add a Number")); data->bt1 = elm_button_add(window_evas_object_get(win)); elm_button_label_set(data->bt1, D_("Back")); evas_object_smart_callback_add(data->bt1, "clicked", frame_number_add_back_clicked, data); window_swallow(win, "button_back", data->bt1); evas_object_show(data->bt1); data->bt2 = elm_button_add(window_evas_object_get(win)); elm_button_label_set(data->bt2, D_("Add")); evas_object_smart_callback_add(data->bt2, "clicked", frame_number_add_add_clicked, data); window_swallow(win, "button_add", data->bt2); evas_object_show(data->bt2); data->entry = elm_entry_add(window_evas_object_get(win)); evas_object_show(data->entry); elm_widget_focus_set(data->entry, 1); data->sc = elm_scroller_add(window_evas_object_get(win)); elm_scroller_content_set(data->sc, data->entry); window_swallow(win, "entry", data->sc); evas_object_show(data->sc); window_kbd_show(win, KEYBOARD_NUMERIC); }
static void add_layout_to_conformant (void *data, Evas_Object *lay_in, const char *title) { Evas_Object *scroller = NULL; Evas_Object *win = NULL; Evas_Object *conform = NULL; struct appdata *ad = NULL; ad = (struct appdata *) data; win = ad->win_main; // Enabling illume notification property for window elm_win_conformant_set (win, EINA_TRUE); // Creating conformant widget conform = elm_conformant_add (win); evas_object_size_hint_weight_set (conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (conform); scroller = elm_scroller_add (ad->naviframe); elm_scroller_bounce_set (scroller, EINA_FALSE, EINA_TRUE); evas_object_show (scroller); elm_object_content_set (scroller, lay_in); elm_object_content_set (conform, scroller); elm_naviframe_item_push (ad->naviframe, title, NULL, NULL, conform, NULL); }
static Evas_Object* create_scroller(Evas_Object *parent) { Evas_Object *scroller = elm_scroller_add(parent); 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); return scroller; }
/** * @brief Positive test case of elm_scroller_bounce_set() */ static void utc_UIFW_elm_scroller_bounce_set_func_01(void) { Evas_Object *test_scroller = NULL; test_scroller = elm_scroller_add(main_win); // Current return type of this API is "Void" elm_scroller_bounce_set(test_scroller, EINA_FALSE, EINA_TRUE); tet_result(TET_PASS); tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: PASS, Setting bouncing behavior has succeed."); }
/** * @brief Positive test case of elm_scroller_policy_set() */ static void utc_UIFW_elm_scroller_policy_set_func_01(void) { Evas_Object *test_scroller = NULL; test_scroller = elm_scroller_add(main_win); // Current return type of this API is "Void" elm_scroller_policy_set(test_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); tet_result(TET_PASS); tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: PASS, Set the scroller scrollbar policy."); }
SH_API Evas_Object * create_scroller(Evas_Object *parent, Eina_Bool scroller_has_one_line) { Evas_Object *scroller; scroller = elm_scroller_add(parent); evas_object_size_hint_weight_set(scroller, 1.0, 1.0); evas_object_size_hint_align_set(scroller, -1.0, -1.0); if (scroller_has_one_line) elm_scroller_content_min_limit(scroller, 0, 1); return scroller; }
static Evas_Object * _edi_content_provider_image_add(Evas_Object *parent, Edi_Mainview_Item *item) { Evas_Object *img, *scroll; scroll = elm_scroller_add(parent); evas_object_size_hint_weight_set(scroll, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(scroll, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(scroll); img = elm_image_add(scroll); elm_image_file_set(img, item->path, NULL); elm_image_no_scale_set(img, EINA_TRUE); elm_object_content_set(scroll, img); evas_object_show(img); return scroll; }
/** * @brief Positive test case of elm_scroller_policy_get() */ static void utc_UIFW_elm_scroller_policy_get_func_01(void) { Elm_Scroller_Policy policy_h; Elm_Scroller_Policy policy_v; Evas_Object *test_scroller = NULL; test_scroller = elm_scroller_add(main_win); // Current return type of this API is "Void" elm_scroller_policy_get(test_scroller, &policy_h, &policy_v); switch(policy_h) { case ELM_SCROLLER_POLICY_AUTO: case ELM_SCROLLER_POLICY_ON: case ELM_SCROLLER_POLICY_OFF: case ELM_SCROLLER_POLICY_LAST: { switch(policy_v) { case ELM_SCROLLER_POLICY_AUTO: case ELM_SCROLLER_POLICY_ON: case ELM_SCROLLER_POLICY_OFF: case ELM_SCROLLER_POLICY_LAST: tet_result(TET_PASS); tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: PASS, Get the scroller scrollbar policy."); break; default: tet_result(TET_FAIL); tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: FAIL, Getting the scroller scrollbar policy has failed."); } } break; default: tet_result(TET_FAIL); tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: FAIL, Getting the scroller scrollbar policy has failed."); } }
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); }
static void frame_content_show(struct MessageNewViewData *data) { struct Window *win = data->win; elm_layout_file_set(win->layout, MESSAGE_FILE, "content_edit"); data->bt1 = elm_button_add(window_evas_object_get(win)); elm_button_label_set(data->bt1, D_("Close")); evas_object_smart_callback_add(data->bt1, "clicked", frame_content_close_clicked, data); window_swallow(win, "button_close", data->bt1); evas_object_show(data->bt1); data->bt2 = elm_button_add(window_evas_object_get(win)); elm_button_label_set(data->bt2, D_("Continue")); evas_object_smart_callback_add(data->bt2, "clicked", frame_content_continue_clicked, data); window_swallow(win, "button_continue", data->bt2); evas_object_show(data->bt2); data->sc = elm_scroller_add(window_evas_object_get(win)); elm_scroller_policy_set(data->sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON); data->entry = elm_entry_add(window_evas_object_get(win)); evas_object_size_hint_weight_set(data->entry, 1.0, 1.0); evas_object_size_hint_align_set(data->entry, -1.0, -1.0); evas_object_smart_callback_add(data->entry, "changed", frame_content_content_changed, data); if (data->content != NULL) { elm_entry_entry_set(data->entry, data->content); } elm_scroller_content_set(data->sc, data->entry); evas_object_show(data->entry); window_swallow(win, "entry", data->sc); evas_object_show(data->sc); elm_object_focus(data->entry); }
static void on_chats(void *data, Evas_Object *obj, void *event_info) { Evas_Object *sc, *bx2; if (content) evas_object_del(content); 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(box, sc); evas_object_show(sc); content = sc; bx2 = elm_box_add(window); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); elm_scroller_content_set(sc, bx2); evas_object_show(bx2); /* FIXME: delete content and add a scrolled list of everyone who has sent * you and sms or that you have sent one to - in order of most recent */ }
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); }
static void on_trash(void *data, Evas_Object *obj, void *event_info) { Evas_Object *sc, *bx2; Eina_List *l, *mlist = NULL; int from, num, i; if (content) evas_object_del(content); 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(box, sc); evas_object_show(sc); content = sc; bx2 = elm_box_add(window); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); elm_scroller_content_set(sc, bx2); evas_object_show(bx2); tzset(); for (l = (Eina_List *)data_message_all_list(); l; l = l->next) { // FIXME: use filter mlist = eina_list_append(mlist, l->data); } // sort newest first mlist = eina_list_sort(mlist, eina_list_count(mlist), _sort_msg_newest); // FIXME: from and num are inputs from = 0; // from message # 0 num = 50; // 50 messages max; for (l = mlist, i = 0; l; l = l->next, i++) { Data_Message *msg = l->data; if (!(msg->flags & DATA_MESSAGE_TRASH)) continue; if (i >= from) { if (i == from) { if (l->prev) { // FIXME: add a "newer" button } } Evas_Object *msgui = _create_message(window, msg); elm_box_pack_end(bx2, msgui); evas_object_show(msgui); } if (i >= (from + num - 1)) { if (l->next) { // FIXME: add a "older" button } break; } } eina_list_free(mlist); }
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); } } }
int message_show_view_init(char* path, GHashTable *properties) { struct MessageShowViewData *view; Evas_Object *win, *ico, *box, *obj; int ret; GVariant *tmp; const char *direction = NULL; Eina_Bool in_msg = EINA_FALSE; /* path MUST always be set! It will be freed by destroying the messageviews hashtable in here, thus must be a copy */ if (!path) { g_warning("Trying to initialize a message view without path!"); return 1; } g_debug("Initializing the contact view for '%s'", path); view = malloc(sizeof(struct MessageShowViewData)); if (!view) { g_critical("Failed to allocate message view for '%s'", path); if (properties) { g_hash_table_unref(properties); } free(path); return 1; } ret = ui_utils_view_init(VIEW_PTR(*view), ELM_WIN_BASIC, D_("Message"), NULL, NULL, _destroy_cb); if (ret) { g_critical("Failed to init message view for '%s'", path); if (properties) { g_hash_table_unref(properties); } free(view); free(path); return ret; } /* cache the views to open only one view per message */ if (messageviews == NULL) { messageviews = g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL); } g_hash_table_insert(messageviews, path, view); view->path = path; view->number = NULL; view->name = NULL; view->photopath = NULL; elm_theme_extension_add(NULL, phoneui_theme); win = ui_utils_view_window_get(VIEW_PTR(*view)); ui_utils_view_delete_callback_set(VIEW_PTR(*view), _delete_cb); ui_utils_view_layout_set(VIEW_PTR(*view), phoneui_theme, "phoneui/messages/show"); GList *keys = g_hash_table_get_keys(properties); for (; keys; keys = keys->next) { tmp = g_hash_table_lookup(properties, keys->data); if (tmp) { g_debug("--- %s: %s", (char *)keys->data, g_variant_print(tmp, TRUE)); } } tmp = g_hash_table_lookup(properties, "Peer"); if (!tmp) { tmp = g_hash_table_lookup(properties, "Sender"); } if (!tmp) { tmp = g_hash_table_lookup(properties, "Recipient"); } if (tmp) { view->number = g_variant_dup_string(tmp, NULL); g_debug("Found number %s - starting lookup", view->number); // FIXME: use new @Contacts feature from opimd whenever it is // clear how to do that :P phoneui_utils_contact_lookup(view->number, _common_name_callback, common_utils_object_ref(view)); ui_utils_view_text_set(VIEW_PTR(*view), "text_number", view->number); } tmp = g_hash_table_lookup(properties, "Timestamp"); if (tmp) { char *date = common_utils_timestamp_to_date( (long)g_variant_get_int32(tmp)); if (date) { g_debug("Found date %s", date); ui_utils_view_text_set(VIEW_PTR(*view), "text_date", date); free(date); } } view->photo = elm_icon_add(win); evas_object_size_hint_aspect_set(view->photo, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); elm_image_file_set(view->photo, phoneui_theme, "icon/contact"); ui_utils_view_swallow(VIEW_PTR(*view), "photo", view->photo); evas_object_show(view->photo); ico = elm_icon_add(win); tmp = g_hash_table_lookup(properties, "Direction"); if (tmp) { direction = g_variant_get_string(tmp, NULL); if (strcmp(direction, "in") == 0) { g_debug("Setting status icon for an incoming message"); in_msg = EINA_TRUE; elm_image_file_set(ico, phoneui_theme, "icon/phonelog-incoming"); } else { g_debug("Setting status icon for a sent message"); in_msg = EINA_FALSE; elm_image_file_set(ico, phoneui_theme, "icon/phonelog-outgoing"); } } ui_utils_view_swallow(VIEW_PTR(*view), "icon_status", ico); evas_object_show(ico); const char *content = NULL; tmp = g_hash_table_lookup(properties, "Content"); if (tmp) { content = elm_entry_utf8_to_markup(g_variant_get_string(tmp, NULL)); } view->sc_content = elm_scroller_add(win); elm_scroller_bounce_set(view->sc_content, EINA_FALSE, EINA_FALSE); view->content = elm_entry_add(win); elm_entry_anchor_hover_style_set(view->content, "popout"); elm_entry_anchor_hover_parent_set(view->content, win); evas_object_size_hint_weight_set(view->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); if (content) { elm_object_text_set(view->content, content); } elm_object_content_set(view->sc_content, view->content); evas_object_show(view->content); ui_utils_view_swallow(VIEW_PTR(*view), "text_content", view->sc_content); evas_object_show(view->sc_content); obj = elm_button_add(win); elm_object_text_set(obj, D_("Close")); evas_object_smart_callback_add(obj, "clicked", _close_clicked, view); ui_utils_view_swallow(VIEW_PTR(*view), "button_close", obj); evas_object_show(obj); // Options button with hover view->hv = elm_hover_add(win); obj = elm_button_add(win); elm_object_text_set(obj, D_("Options")); evas_object_smart_callback_add(obj, "clicked", _hover_bt_1, view->hv); ui_utils_view_swallow(VIEW_PTR(*view), "button_options", obj); evas_object_show(obj); elm_hover_parent_set(view->hv, win); elm_hover_target_set(view->hv, obj); box = elm_box_add(win); elm_box_horizontal_set(box, 0); elm_box_homogeneous_set(box, 1); evas_object_show(box); obj = elm_button_add(win); elm_object_text_set(obj, D_("Delete")); evas_object_size_hint_min_set(obj, 140, 80); evas_object_smart_callback_add(obj, "clicked", _delete_clicked, view); evas_object_show(obj); elm_box_pack_end(box, obj); if (in_msg) { obj = elm_button_add(win); elm_object_text_set(obj, D_("Call")); evas_object_size_hint_min_set(obj, 140, 80); evas_object_smart_callback_add(obj, "clicked", _call_clicked, view); evas_object_show(obj); elm_box_pack_end(box, obj); } obj = elm_button_add(win); elm_object_text_set(obj, D_("Add Contact")); evas_object_size_hint_min_set(obj, 140, 80); evas_object_smart_callback_add(obj, "clicked", _new_contact_clicked, view); evas_object_show(obj); elm_box_pack_end(box, obj); view->add_contact_bt = obj; obj = elm_button_add(win); elm_object_text_set(obj, D_("Forward")); evas_object_size_hint_min_set(obj, 140, 80); evas_object_smart_callback_add(obj, "clicked", _forward_clicked, view); evas_object_show(obj); elm_box_pack_end(box, obj); elm_object_part_content_set(view->hv, "top", box); obj = elm_button_add(win); elm_object_text_set(obj, D_("Answer")); evas_object_smart_callback_add(obj, "clicked", _answer_clicked, view); ui_utils_view_swallow(VIEW_PTR(*view), "button_answer", obj); evas_object_show(obj); if (in_msg) { g_debug("going to set read status for the message"); phoneui_utils_message_set_read_status(view->path, 1, NULL, NULL); g_debug("done - destroying properties now"); } g_hash_table_destroy(properties); g_debug("done"); return 0; }
Scroller::Scroller (Evasxx::Object &parent) { o = elm_scroller_add (parent.obj ()); elmInit (); }
/* ad-hoc network .-box-------------------------------------------------------------------. | .-scroller----------------------------------------------------------. | | | .-table---------------------------------------------------------. | | | | | Crate an Ad-Hoc Network | | | | | | ESSID: [...................................] | | | | | | IP: [...................................] | | | | | | Channel: [...................................] | | | | | | [] Activate Internet Connection Sharing | | | | | | [] Use Encryption (WEP only) | | | | | | Key: [...................................] | | | | | `---------------------------------------------------------------' | | | `-------------------------------------------------------------------' | | .-box---------------------------------------------------------------. | | | [Cancel] [OK] | | | `-------------------------------------------------------------------' | `-----------------------------------------------------------------------' */ void wicd_adhoc(void) { Evas_Object *bx, *sc, *tb, *ob, *bx2; bx = elm_box_add(wicdelm->win); elm_box_homogeneous_set(bx, EINA_FALSE); elm_box_horizontal_set(bx, EINA_FALSE); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bx); wicdelm->adhoc.page = bx; sc = elm_scroller_add(wicdelm->win); elm_scroller_content_min_limit(sc, EINA_TRUE, EINA_FALSE); elm_scroller_policy_set(sc , ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE); elm_box_pack_end(bx, sc); evas_object_show(sc); // table tb = elm_table_add(wicdelm->win); elm_table_homogeneous_set(tb, EINA_FALSE); evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); elm_object_content_set(sc, tb); evas_object_show(tb); ob = elm_label_add(wicdelm->win); elm_object_text_set(ob, "<b>Create an Ad-Hoc Network</b>"); evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5); elm_table_pack(tb, ob, 0, 0, 2, 1); evas_object_show(ob); ob = elm_label_add(wicdelm->win); elm_object_text_set(ob, "ESSID:"); evas_object_size_hint_weight_set(ob, 0.0, 0.0); evas_object_size_hint_align_set(ob, 0.0, 0.5); elm_table_pack(tb, ob, 0, 1, 1, 1); evas_object_show(ob); ob = elm_entry_add(wicdelm->win); elm_entry_scrollable_set(ob, EINA_TRUE); elm_entry_single_line_set(ob, EINA_TRUE); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0); evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0); elm_table_pack(tb, ob, 1, 1, 1, 1); evas_object_show(ob); evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL); wicdelm->adhoc.essid = ob; ob = elm_label_add(wicdelm->win); elm_object_text_set(ob, "IP:"); evas_object_size_hint_weight_set(ob, 0.0, 0.0); evas_object_size_hint_align_set(ob, 0.0, 0.5); elm_table_pack(tb, ob, 0, 2, 1, 1); evas_object_show(ob); ob = elm_entry_add(wicdelm->win); elm_entry_scrollable_set(ob, EINA_TRUE); elm_entry_single_line_set(ob, EINA_TRUE); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0); evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0); elm_table_pack(tb, ob, 1, 2, 1, 1); evas_object_show(ob); evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL); wicdelm->adhoc.ip = ob; ob = elm_label_add(wicdelm->win); elm_object_text_set(ob, "Channel:"); evas_object_size_hint_weight_set(ob, 0.0, 0.0); evas_object_size_hint_align_set(ob, 0.0, 0.5); elm_table_pack(tb, ob, 0, 3, 1, 1); evas_object_show(ob); ob = elm_slider_add(wicdelm->win); elm_slider_min_max_set(ob, 1.0, 14.0); elm_slider_indicator_format_set(ob, "%02.0f"); elm_slider_unit_format_set(ob, "%02.0f"); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0); evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0); elm_table_pack(tb, ob, 1, 3, 1, 1); evas_object_show(ob); evas_object_smart_callback_add(ob, "delay,changed", _changed_cb, NULL); wicdelm->adhoc.channel = ob; ob = elm_check_add(wicdelm->win); elm_object_text_set(ob, "Share Internet"); evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5); elm_table_pack(tb, ob, 0, 4, 2, 1); evas_object_show(ob); evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL); wicdelm->adhoc.shareInternet = ob; ob = elm_check_add(wicdelm->win); elm_object_text_set(ob, "WEP Encryption"); evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5); elm_table_pack(tb, ob, 0, 5, 2, 1); evas_object_show(ob); evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL); wicdelm->adhoc.useEncryption = ob; ob = elm_label_add(wicdelm->win); elm_object_text_set(ob, "Key:"); evas_object_size_hint_weight_set(ob, 0.0, 0.0); evas_object_size_hint_align_set(ob, 0.0, 0.5); elm_table_pack(tb, ob, 0, 6, 1, 1); evas_object_show(ob); ob = elm_entry_add(wicdelm->win); elm_entry_scrollable_set(ob, EINA_TRUE); elm_entry_single_line_set(ob, EINA_TRUE); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0); evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0); elm_table_pack(tb, ob, 1, 6, 1, 1); evas_object_show(ob); evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL); wicdelm->adhoc.key = ob; bx2 = elm_box_add(wicdelm->win); elm_box_homogeneous_set(bx2, EINA_TRUE); elm_box_horizontal_set(bx2, EINA_TRUE); evas_object_size_hint_align_set(bx2, 1.0, 1.0); evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0); elm_box_pack_end(bx, bx2); evas_object_show(bx2); ob = elm_button_add(wicdelm->win); elm_object_text_set(ob, "Cancel"); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0); evas_object_smart_callback_add(ob, "clicked", _cancel_cb, NULL); elm_box_pack_end(bx2, ob); evas_object_show(ob); ob = elm_button_add(wicdelm->win); elm_object_text_set(ob, "Ok"); evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0); evas_object_smart_callback_add(ob, "clicked", _ok_cb, NULL); elm_box_pack_end(bx2, ob); evas_object_show(ob); wicdelm->adhoc.item = elm_naviframe_item_simple_push(wicdelm->naviframe, bx); }
static void _account_set_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fr, *tb, *inwin, *lbl, *sc, *text, *bt, *hbox, *img, *entry; char buf[PATH_MAX]; inwin = elm_win_inwin_add(enlil_data->win->win); set_account.inwin = inwin; evas_object_show(inwin); fr = elm_frame_add(enlil_data->win->win); elm_frame_label_set(fr, D_("Set the Flick account.")); evas_object_size_hint_weight_set(fr, 1.0, 1.0); evas_object_size_hint_align_set(fr, 0.0, 0.0); evas_object_show(fr); tb = elm_table_add(enlil_data->win->win); elm_table_padding_set(tb, 10, 10); evas_object_size_hint_weight_set(tb, 1.0, 1.0); evas_object_size_hint_align_set(tb, -1.0, -1.0); evas_object_show(tb); //steps lbl = elm_label_add(enlil_data->win->win); elm_label_label_set( lbl, D_("<b>STEP 1 :</b> Open the web page in your favorite web browser.")); evas_object_size_hint_weight_set(lbl, 0.0, 0.0); evas_object_size_hint_align_set(lbl, -1.0, 0.0); evas_object_show(lbl); elm_table_pack(tb, lbl, 0, 0, 2, 1); entry = elm_scrolled_entry_add(enlil_data->win->win); elm_scrolled_entry_single_line_set(entry, EINA_TRUE); elm_scrolled_entry_entry_set(entry, enlil_flickr_auth_url_get()); evas_object_size_hint_weight_set(entry, 1.0, 0.0); evas_object_size_hint_align_set(entry, -1.0, 0.0); evas_object_show(entry); elm_table_pack(tb, entry, 0, 1, 2, 1); img = elm_image_add(obj); elm_image_file_set(img, Theme, "flickr/set_account_0"); evas_object_size_hint_weight_set(img, 1.0, 1.0); evas_object_size_hint_align_set(img, -1.0, -1.0); evas_object_show(img); elm_table_pack(tb, img, 0, 2, 2, 1); snprintf( buf, PATH_MAX, D_("<b>STEP 2 :</b> Authorize Enki to access to your account.")); lbl = elm_label_add(enlil_data->win->win); elm_label_label_set(lbl, buf); evas_object_size_hint_weight_set(lbl, 0.0, 0.0); evas_object_size_hint_align_set(lbl, -1.0, 0.0); evas_object_show(lbl); elm_table_pack(tb, lbl, 0, 3, 2, 1); img = elm_image_add(obj); elm_image_file_set(img, Theme, "flickr/set_account_1"); evas_object_size_hint_weight_set(img, 0.0, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(img, -1.0, -1.0); evas_object_show(img); elm_table_pack(tb, img, 0, 4, 2, 1); snprintf( buf, PATH_MAX, D_("<b>STEP 3 :</b> Copy the code in the followed text area.")); lbl = elm_label_add(enlil_data->win->win); elm_label_label_set(lbl, buf); evas_object_size_hint_weight_set(lbl, 0.0, 0.0); evas_object_size_hint_align_set(lbl, -1.0, 0.0); evas_object_show(lbl); elm_table_pack(tb, lbl, 0, 5, 2, 1); // lbl = elm_label_add(enlil_data->win->win); elm_label_label_set(lbl, D_("The 9-digit code : ")); evas_object_size_hint_weight_set(lbl, 0.0, 0.0); evas_object_size_hint_align_set(lbl, -1.0, 0.0); evas_object_show(lbl); elm_table_pack(tb, lbl, 0, 6, 1, 1); sc = elm_scroller_add(enlil_data->win->win); evas_object_size_hint_weight_set(sc, 1.0, 0.0); evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_scroller_content_min_limit(sc, EINA_FALSE, EINA_TRUE); elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); elm_scroller_bounce_set(sc, 0, 0); evas_object_show(sc); elm_table_pack(tb, sc, 1, 6, 1, 1); text = elm_entry_add(enlil_data->win->win); set_account.entry = text; elm_entry_entry_set(text, ""); elm_entry_single_line_set(text, 1); evas_object_size_hint_weight_set(text, EVAS_HINT_EXPAND, 1.0); evas_object_size_hint_align_set(text, 1.0, 0.5); elm_scroller_content_set(sc, text); evas_object_show(text); hbox = elm_box_add(enlil_data->win->win); elm_box_horizontal_set(hbox, 1); evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(hbox, 1.0, 0.0); evas_object_show(hbox); elm_table_pack(tb, hbox, 1, 7, 1, 1); bt = elm_button_add(enlil_data->win->win); elm_button_label_set(bt, D_("Cancel")); evas_object_smart_callback_add(bt, "clicked", _account_set_cancel_cb, NULL); evas_object_size_hint_align_set(bt, 1.0, 0.0); evas_object_show(bt); elm_box_pack_end(hbox, bt); bt = elm_button_add(enlil_data->win->win); elm_button_label_set(bt, D_("Apply")); evas_object_smart_callback_add(bt, "clicked", _account_set_apply_cb, text); evas_object_size_hint_align_set(bt, 1.0, 0.0); evas_object_show(bt); elm_box_pack_end(hbox, bt); elm_object_disabled_set(bt, EINA_TRUE); evas_object_smart_callback_add(text, "changed", _account_set_entry_changed_cb, bt); elm_frame_content_set(fr, tb); elm_win_inwin_content_set(inwin, fr); }
void create_gui(Evas_Object *win) { int i; char no[2], *tystr, buf[255]; Evas_Object *bg, *hbox, *prop_button, *sc, *ic, *bx1; Evas_Object *vbox, *bx, *hbox1, *bt, *save_button, *note_button; //add background bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); //add vbox vbox = elm_box_add(win); elm_win_resize_object_add(win, vbox); evas_object_size_hint_weight_set(vbox, 1.0, 1.0); evas_object_show(vbox); //add hbox to vbox hbox = elm_box_add(win); elm_box_horizontal_set(hbox, 1); evas_object_size_hint_weight_set(hbox, 1.0, 0.0); evas_object_size_hint_align_set(hbox, -1.0, 0.0); elm_box_pack_end(vbox, hbox); evas_object_show(hbox); //add hover for priority hv = elm_hover_add(win); //add box for hover bx = elm_box_add(win); elm_box_pack_end(hbox, bx); //evas_object_size_hint_weight_set(bx, 0.0, 1.0); //evas_object_size_hint_align_set(bx, 0.0, -1.0); evas_object_show(bx); pr_bt = elm_button_add(win); elm_object_text_set(pr_bt, "Pr"); evas_object_smart_callback_add(pr_bt, "clicked", my_hover_bt_1, hv); elm_box_pack_end(bx, pr_bt); evas_object_show(pr_bt); elm_hover_parent_set(hv, win); elm_hover_target_set(hv, pr_bt); bt = elm_button_add(win); elm_object_text_set(bt, "Pr"); elm_object_part_content_set(hv, "middle", bt); evas_object_show(bt); bx = elm_box_add(win); //add 5 buttons for (i=1; i<6; i++) { bt = elm_button_add(win); sprintf(no, "%d", i); elm_object_text_set(bt, no); elm_box_pack_end(bx, bt); tystr = strdup(no); evas_object_smart_callback_add(bt, "clicked", set_priority, (char *)tystr); evas_object_show(bt); } evas_object_show(bx); elm_object_part_content_set(hv, "bottom", bx); //add scroller for entry sc = elm_scroller_add(win); elm_scroller_content_min_limit(sc, 0, 1); elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); evas_object_size_hint_weight_set(sc, 1.0, 0.0); evas_object_size_hint_align_set(sc, -1.0, -1.0); elm_box_pack_end(hbox, sc); //add entry for task tk = elm_entry_add(win); elm_entry_single_line_set(tk ,1); elm_entry_entry_set(tk, "Task"); evas_object_size_hint_weight_set(tk, 1.0, 0.0); evas_object_size_hint_align_set(tk, -1.0, 0.0); elm_object_content_set(sc, tk); evas_object_show(tk); evas_object_show(sc); //add hover for date date_hs = elm_hover_add(win); //add box for hover bx1 = elm_box_add(win); elm_box_pack_end(hbox, bx1); evas_object_size_hint_weight_set(bx1, 0.0, 0.0); evas_object_size_hint_align_set(bx1, 0.0, -1.0); evas_object_show(bx1); date_bt = elm_button_add(win); elm_object_text_set(date_bt, "Date"); evas_object_smart_callback_add(date_bt, "clicked", my_hover_bt_1, date_hs); elm_box_pack_end(bx1, date_bt); evas_object_show(date_bt); elm_hover_parent_set(date_hs, win); elm_hover_target_set(date_hs, date_bt); bt = elm_button_add(win); elm_object_text_set(bt, "Date"); elm_object_part_content_set(date_hs, "middle", bt); evas_object_show(bt); bx1 = elm_box_add(win); add_dates(win, bx1, bt); evas_object_show(bx1); elm_object_part_content_set(date_hs, "bottom", bx1); //add save button save_button = elm_button_add(win); elm_object_text_set(save_button, "Save"); evas_object_size_hint_weight_set(save_button, 0.0, 0.0); evas_object_size_hint_align_set(save_button, 1.0, -1.0); elm_box_pack_end(hbox, save_button); evas_object_show(save_button); evas_object_smart_callback_add(save_button, "clicked", save_button_clicked, list); //add list to vbox now list = elm_genlist_add(win); evas_object_size_hint_weight_set(list, 1.0, 1.0); evas_object_size_hint_align_set(list, -1.0, -1.0); elm_list_multi_select_set(list, 0); elm_box_pack_end(vbox, list); elm_genlist_mode_set(list, ELM_LIST_LIMIT); evas_object_show(list); evas_object_smart_callback_add(list, "selected", task_select, list); //genlist class defs itc1.item_style = "default"; itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; //add hbox to vbox at pos 4 hbox1 = elm_box_add(win); elm_box_horizontal_set(hbox1, 1); evas_object_size_hint_weight_set(hbox1, 1.0, 0.0); evas_object_size_hint_align_set(hbox1, -1.0, 0.0); elm_box_pack_end(vbox, hbox1); evas_object_show(hbox1); //add new button to the hbox new_button = elm_button_add(win); elm_object_text_set(new_button, "Add"); evas_object_size_hint_weight_set(new_button, 1.0, 1.0); evas_object_size_hint_align_set(new_button, -1.0, -1.0); elm_box_pack_end(hbox1, new_button); evas_object_show(new_button); evas_object_smart_callback_add(new_button, "clicked", create_new_task, list); //add Properties button to the hbox prop_button = elm_button_add(win); elm_object_text_set(prop_button, "Details"); evas_object_size_hint_weight_set(prop_button, 1.0, 1.0); evas_object_size_hint_align_set(prop_button, -1.0, -1.0); elm_box_pack_end(hbox1, prop_button); evas_object_show(prop_button); evas_object_smart_callback_add(prop_button, "clicked", create_details_page, NULL); //add note button to the hbox note_button = elm_button_add(win); ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "/usr/share/e-tasks/note_butt.png"); elm_icon_file_set(ic, buf, NULL); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); elm_object_content_set(note_button, ic); evas_object_show(ic); //elm_object_text_set(note_button, "Note"); evas_object_size_hint_weight_set(note_button, 1.0, 1.0); evas_object_size_hint_align_set(note_button, -1.0, -1.0); elm_box_pack_end(hbox1, note_button); evas_object_show(note_button); evas_object_smart_callback_add(note_button, "clicked", note_button_clicked, list); //add hover for category select hs1 = elm_hover_add(win); //add box for hover bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 0.0, 0.0); elm_box_pack_end(hbox1, bx); evas_object_show(bx); sel_cat_bt = elm_button_add(win); elm_object_text_set(sel_cat_bt, " All Tasks "); evas_object_smart_callback_add(sel_cat_bt, "clicked", my_hover_bt_1, hs1); elm_box_pack_end(bx, sel_cat_bt); evas_object_show(sel_cat_bt); elm_hover_parent_set(hs1, win); elm_hover_target_set(hs1, sel_cat_bt); bt = elm_button_add(win); elm_object_text_set(bt, " All Tasks "); elm_object_part_content_set(hs1, "middle", bt); evas_object_show(bt); create_cat_hover (); // make window full screen evas_object_resize(win, 480, 640); }
Evas_Object* add_customer_inquire_seat_view(Evas_Object *parent){ Evas_Object *scroller, *grid, *bg, *layout, *label, *seat_layout, *map; train_seat_s *seat_s = calloc(1,sizeof(train_seat_s)); int i; strcpy(seat_s->train_number,"A0001"); seat_s->section_number = 'A'; seat_s->seat_number = 40; for(i = 0 ; i < seat_s->seat_number; i++){ seat_s->seat_empty[i] = true; } scroller = elm_scroller_add(parent); elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); grid = elm_grid_add(scroller); evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL); bg = elm_bg_add(grid); elm_win_resize_object_add(grid, bg); elm_object_content_set(grid, bg); elm_grid_pack(grid, bg, 0, 0, 100, 100); elm_bg_color_set(bg, 38, 116, 212); evas_object_show(bg); bg = elm_bg_add(grid); elm_object_content_set(grid, bg); elm_grid_pack(grid, bg, 5, 5, 10, 10); elm_bg_color_set(bg, 255, 255, 255); evas_object_show(bg); label = elm_label_add(grid); elm_object_text_set(label,seat_s->train_number); evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(label); elm_grid_pack(grid, label, 5, 5, 10, 10); // map = elm_map_add(grid); // elm_map_zoom_mode_set(map,ELM_MAP_ZOOM_MODE_MANUAL); // elm_map_zoom_set(map,12); // elm_map_region_bring_in(map,37.2,127.8); // elm_grid_pack(grid,map,5,5,90,90); // evas_object_show(map); // // table = elm_table_add(grid); // elm_table_padding_set(table,12,5); elm_object_content_set(scroller, grid); return scroller; }
static void _create_view_layout(Evas_Object *parent, char *layout_file, char *index_style, char it_style[][20], Eina_Bool even_num) { Evas_Object *layout, *scroller, *box, *left_right_rect, *img, *page_layout, *index; Elm_Object_Item *nf_it; char img_path[PATH_MAX]; int i, max_items; page_data *pd = (page_data *)calloc(1, sizeof(page_data)); /* Create Layout */ layout = elm_layout_add(parent); elm_layout_file_set(layout, ELM_DEMO_EDJ, layout_file); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(layout); evas_object_event_callback_add(layout, EVAS_CALLBACK_DEL, _layout_del_cb, pd); pd->main_layout = layout; /* Create Scroller */ scroller = elm_scroller_add(layout); elm_scroller_loop_set(scroller, EINA_FALSE, EINA_FALSE); evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); elm_scroller_page_scroll_limit_set(scroller, 1, 0); elm_object_scroll_lock_y_set(scroller, EINA_TRUE); elm_object_part_content_set(layout, "scroller", scroller); evas_object_show(scroller); evas_object_smart_callback_add(scroller, "scroll", _scroll, pd); pd->scroller = scroller; /* Create Box */ box = elm_box_add(scroller); elm_box_horizontal_set(box, EINA_TRUE); elm_object_content_set(scroller, box); evas_object_show(box); pd->box = box; /* Create Rect object for page_layout center align in Box */ left_right_rect = evas_object_rectangle_add(evas_object_evas_get(box)); elm_box_pack_end(box, left_right_rect); /* Create Pages */ if (even_num) max_items = NUM_INDEX_CIRCLE_EVEN; else max_items = NUM_ITEMS; for (i = 0; i < max_items; ++i) { page_layout = elm_layout_add(box); pd->page_layout[i] = page_layout; evas_object_size_hint_weight_set(page_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(page_layout, 0, EVAS_HINT_FILL); elm_layout_theme_set(page_layout, "layout", "body_thumbnail", "default"); evas_object_show(page_layout); img = elm_image_add(page_layout); snprintf(img_path, sizeof(img_path), "%s/100_%d.jpg", ICON_DIR, (i % 6) + 1); elm_image_file_set(img, img_path, NULL); elm_object_part_content_set(page_layout, "elm.icon", img); /* Make unselect state all of the pages except first one */ if (i) elm_object_signal_emit(page_layout, "elm,state,thumbnail,unselect", "elm"); elm_box_pack_end(box, page_layout); } /*Add resize callback for get a actual size of layout and main layout */ evas_object_event_callback_add(pd->page_layout[0], EVAS_CALLBACK_RESIZE, _layout_resize_cb, pd); elm_box_pack_end(box, left_right_rect); pd->left_right_rect = left_right_rect; /* Add animator for page transfer effect */ ecore_animator_add(animator_cb, pd); /* Create Index */ index = elm_index_add(layout); elm_object_style_set(index, index_style); evas_object_size_hint_weight_set(index, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(index, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_index_horizontal_set(index, EINA_TRUE); elm_index_autohide_disabled_set(index, EINA_TRUE); elm_object_part_content_set(layout, "controller", index); for (i = 0; i < max_items; ++i) { pd->it[i] = elm_index_item_append(index, NULL, NULL, (void *) i); if (it_style) elm_object_item_style_set(pd->it[i], it_style[i]); } pd->min_page = 0; pd->max_page = max_items - 1; elm_index_level_go(index, 0); elm_index_item_selected_set(pd->it[0], EINA_TRUE); pd->cur_page = 0; pd->index = index; pd->last_it = pd->it[0]; evas_object_event_callback_add(index, EVAS_CALLBACK_MOUSE_DOWN, _on_index_mouse_down_cb, pd); evas_object_event_callback_add(index, EVAS_CALLBACK_MOUSE_MOVE, _on_index_mouse_move_cb, pd); evas_object_event_callback_add(index, EVAS_CALLBACK_MOUSE_UP, _on_index_mouse_up_cb, pd); nf_it = elm_naviframe_item_push(parent, NULL, NULL, NULL, layout, NULL); elm_naviframe_item_title_enabled_set(nf_it, EINA_FALSE, EINA_FALSE); }