SH_API int _read_stdin_entry(void *data, Ecore_Fd_Handler *fd_handler) { char *buffer; char *s; char c; int i = 0; Evas_Object *obj = data; if (!_stdin_prepare(fd_handler)) return 0; // allocate initial buffer buffer = malloc(sizeof(char)); // get the buffer do { c = getc(stdin); buffer[i] = c; buffer = realloc(buffer, i + sizeof(buffer)); i++; } while (c != EOF); // terminate the string. buffer[i - 1] = '\0'; // add into entry, but before convert to html markup s = elm_entry_utf8_to_markup(buffer); elm_entry_entry_set(obj, s); // free the the pointers, delete handler when we don't need it E_FREE(buffer); E_FREE(s); ecore_main_fd_handler_del(fd_handler); return 0; }
void Add_To_Most_Visited_Sites_View::__history_item_clicked_cb(void *data, Evas_Object *obj, void *event_info) { BROWSER_LOGD("[%s]", __func__); if (!data) return; Add_To_Most_Visited_Sites_View *add_to_most_visited_sites_view = NULL; add_to_most_visited_sites_view = (Add_To_Most_Visited_Sites_View *)data; Elm_Object_Item *seleted_item = elm_genlist_selected_item_get(obj); Elm_Object_Item *index_item = elm_genlist_first_item_get(obj); int index = 0; /* calculate the index of the selected item */ while (index_item != seleted_item) { /* Do not count date label item */ if (elm_genlist_item_select_mode_get(index_item) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) index++; index_item = elm_genlist_item_next_get(index_item); } Evas_Object *entry = br_elm_editfield_entry_get(add_to_most_visited_sites_view->m_url_edit_field); char *mark_up = elm_entry_utf8_to_markup(add_to_most_visited_sites_view->m_history_list[index]->url.c_str()); if (mark_up) { elm_entry_entry_set(entry, mark_up); free(mark_up); } }
static void _insert_contacts_add_number_callback(const char *number, void *data) { char *content; struct MessageNewViewData *view; int len; view = (struct MessageNewViewData *)data; content = elm_entry_markup_to_utf8(elm_entry_entry_get(view->content_entry)); len = phone_utils_gsm_sms_strlen(content); // Make space for text, number and ending null character content = realloc(content, len + strlen(number) + 1); // Add the number to the end of the content sprintf(content + len, "%s ", number); if (view->content) { free(view->content); } view->content = content; if (view->content != NULL) { elm_entry_entry_set(view->content_entry, elm_entry_utf8_to_markup(view->content)); } }
/** * @brief Cuts text content from entry to clipboard * * @param text an AtkEditableText * @param start_pos start position of cursor * @param end_pos end position of cursor */ static void eail_multibuttonentry_cut_text(AtkEditableText *text, gint start_pos, gint end_pos) { Evas_Object *widget; Evas_Object *entry; const char *entry_text; char *tmp; GString *s; widget = eail_widget_get_widget(EAIL_WIDGET(text)); if (!widget || !elm_multibuttonentry_editable_get(widget)) return; entry = elm_multibuttonentry_entry_get(widget); entry_text = elm_entry_entry_get(entry); tmp = eail_get_substring(entry_text, start_pos, end_pos); eail_clipboard_set_text(tmp); g_free(tmp); s = g_string_new(entry_text); s = g_string_erase(s, start_pos, end_pos - start_pos); elm_entry_entry_set(entry, s->str); g_string_free(s, TRUE); }
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; }
SH_API Evas_Object * create_entry(Evas_Object *parent, Eina_Bool entry_has_one_line, const char *entry_text, Eina_Bool entry_hide_text, Eina_Bool entry_line_nowrap, Eina_Bool entry_editable) { Evas_Object *entry; char *s = NULL; if (entry_text) s = elm_entry_utf8_to_markup(entry_text); entry = elm_entry_add(parent); if (entry_line_nowrap) elm_entry_line_wrap_set(entry, 0); else elm_entry_line_wrap_set(entry, 1); if (s) { elm_entry_entry_set(entry, s); E_FREE(s); } elm_entry_password_set(entry, entry_hide_text); evas_object_size_hint_weight_set(entry, 1.0, 1.0); evas_object_size_hint_align_set(entry, -1.0, -1.0); elm_entry_single_line_set(entry, entry_has_one_line); elm_entry_editable_set(entry, entry_editable); return entry; }
static void _init_content_page(struct MessageNewViewData *view) { Evas_Object *win, *btn; win = ui_utils_view_window_get(VIEW_PTR(*view)); view->layout_content = elm_layout_add(win); elm_win_resize_object_add(win, view->layout_content); evas_object_size_hint_weight_set(view->layout_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_layout_file_set(view->layout_content, phoneui_theme, "phoneui/messages/new/content"); evas_object_show(view->layout_content); edje_object_part_text_set(elm_layout_edje_get(view->layout_content), "content_title", D_("Enter your message")); view->content_entry = elm_entry_add(win); elm_entry_scrollable_set(view->content_entry, EINA_TRUE); evas_object_smart_callback_add(view->content_entry, "changed", _content_changed, view); if (view->content != NULL) { elm_entry_entry_set(view->content_entry, elm_entry_utf8_to_markup(view->content)); } evas_object_show(view->content_entry); elm_object_part_content_set(view->layout_content, "content_entry", view->content_entry); elm_object_focus_set(view->content_entry, EINA_TRUE); btn = elm_button_add(win); elm_object_text_set(btn, D_("Insert")); evas_object_smart_callback_add(btn, "clicked", _content_button_insert_clicked, view); elm_object_part_content_set(view->layout_content, "content_button_insert", btn); evas_object_show(btn); btn = elm_button_add(win); elm_object_text_set(btn, D_("Close")); evas_object_smart_callback_add(btn, "clicked", _content_button_close_clicked, view); elm_object_part_content_set(view->layout_content, "content_button_close", btn); evas_object_show(btn); btn = elm_button_add(win); elm_object_text_set(btn, D_("Continue")); evas_object_smart_callback_add(btn, "clicked", _content_button_continue_clicked, view); elm_object_part_content_set(view->layout_content, "content_button_continue", btn); evas_object_show(btn); elm_naviframe_item_simple_push(view->pager, view->layout_content); }
EAPI int elm_main(int argc, char **argv) { Evas_Object *win, *o, *bg, *box; Ecore_Event_Handler *handle_key_up, *handle_key_down; win = elm_win_add(NULL, "elm_event", ELM_WIN_BASIC); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); o = elm_bg_add(win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, o); evas_object_show(o); box = elm_box_add(win); elm_box_horizontal_set(box, EINA_FALSE); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, box); evas_object_show(box); o = elm_entry_add(win); elm_entry_single_line_set(o, EINA_TRUE); elm_entry_entry_set(o, "123ab456"); elm_box_pack_end(box, o); evas_object_show(o); o = elm_button_add(win); elm_object_text_set(o, "Test"); elm_box_pack_end(box, o); evas_object_show(o); handle_key_up = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _input_event_cb, NULL); handle_key_down = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _input_event_cb, NULL); evas_object_resize(win, 300, 300); evas_object_show(win); elm_run(); if (handle_key_up) ecore_event_handler_del(handle_key_up); if (handle_key_down) ecore_event_handler_del(handle_key_down); elm_shutdown(); return 0; }
static void delete_string(Evas_Object *entry) { const char *temp; char *ch = NULL; char tempCh; int len; int i, j = 0; temp = elm_entry_entry_get(entry); if (!temp) return; ch = strdup(temp); len = strlen(ch); if (len > 0) { ch[len-1] = ch[len]; elm_entry_entry_set(entry, ch); } else elm_entry_entry_set(entry, ""); }
static void utc_UIFW_elm_entry_cursor_down_func_01(void) { test_eo = NULL; Eina_Bool flag = EINA_FALSE; test_eo = elm_entry_add(test_win); elm_entry_entry_set(test_eo, "a<br>b<br>c"); elm_entry_cursor_up(test_eo); flag = elm_entry_cursor_down(test_eo); TET_CHECK_PASS(EINA_FALSE, flag); tet_result(TET_PASS); tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_entry_cursor_down"); }
static void _initialize_and_show_buttons(Evas_Object *win) { Evas_Object *bg = NULL, *entry = NULL; 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); entry = elm_entry_add(win); elm_entry_entry_set(entry, EAIL_TEST_ENTRY_NAME); evas_object_resize(entry, 100, 60); evas_object_move(entry, 50, 20); evas_object_show(entry); }
/** * @brief Sets text contents of text * * @param text an AtkEditableText * @param string new text to be set */ static void eail_multibuttonentry_set_text_contents(AtkEditableText *text, const gchar *string) { Evas_Object *entry; Evas_Object *widget; widget = eail_widget_get_widget(EAIL_WIDGET(text)); if (!widget) return; entry = elm_multibuttonentry_entry_get(widget); if (!entry) return; if (elm_multibuttonentry_editable_get(widget)) elm_entry_entry_set(entry, string); }
/** * @brief Deletes text between start_pos and end_pos but not * including end_pos * * @param text an AtkEditableText * @param start_pos start position * @param end_pos end position */ static void eail_multibuttonentry_delete_text(AtkEditableText *text, gint start_pos, gint end_pos) { Evas_Object *widget; Evas_Object *entry; GString *s; widget = eail_widget_get_widget(EAIL_WIDGET(text)); if (!widget || !elm_multibuttonentry_editable_get(widget)) return; entry = elm_multibuttonentry_entry_get(widget); s = g_string_new(elm_entry_entry_get(entry)); s = g_string_erase(s, start_pos, end_pos-start_pos); elm_entry_entry_set(entry, s->str); g_string_free(s, TRUE); }
static void __common_utils_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info) { INFO_LOG(UG_NAME_NORMAL, "__common_utils_entry_unfocused_cb entered"); if (elm_entry_is_empty(obj)) { const char *guide_txt = elm_object_part_text_get(data, "elm.guidetext"); INFO_LOG(UG_NAME_NORMAL, "entry is empty"); if (guide_txt && strlen(guide_txt)) { /* If guide text exists then show it */ elm_object_signal_emit(data, "elm,state,guidetext,show", "elm"); } else { /* If default entry text exists then show it */ char *default_entry_txt = NULL; default_entry_txt = evas_object_data_get(data, COMMON_UTILS_DEFAULT_ENTRY_TEXT_KEY); if (default_entry_txt && strlen(default_entry_txt)) { elm_entry_entry_set(obj, default_entry_txt); } } } elm_object_signal_emit(data, "elm,state,eraser,hide", "elm"); }
/** * @brief Pastes text content from clipboard into entry * * @param text an AtkEditableText * @param position start position of cursor */ static void eail_multibuttonentry_paste_text(AtkEditableText *text, gint position) { Evas_Object *widget; Evas_Object *entry = NULL; GString *s; const char *tmp; widget = eail_widget_get_widget(EAIL_WIDGET(text)); if (!widget || !elm_multibuttonentry_editable_get(entry)) return; entry = elm_multibuttonentry_entry_get(widget); s = g_string_new(elm_entry_entry_get(entry)); tmp = eail_clipboard_get_text(); s = g_string_insert(s, position, tmp); elm_entry_entry_set(entry, s->str); g_string_free(s, TRUE); }
/** * @brief Inserts text at given position * * @param text an AtkEditableText * @param string string to insert * @param length string length * @param [out] position at witch text is inserted. * After the call it points at the position after the newly inserted text. */ static void eail_multibuttonentry_insert_text(AtkEditableText *text, const gchar *string, gint length, gint *position) { Evas_Object *widget; Evas_Object *entry; GString *s; widget = eail_widget_get_widget(EAIL_WIDGET(text)); if (!widget || !elm_multibuttonentry_editable_get(widget)) return; entry = elm_multibuttonentry_entry_get(widget); s = g_string_new(elm_entry_entry_get(entry)); s = g_string_insert_len(s, *position, string, length); elm_entry_entry_set(entry, s->str); g_string_free(s, TRUE); *position += length; }
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); }
void task_select(void *data, Evas_Object *obj, void *event_info) { char tystr[2]; char te_data[255], *task_entry; Elm_Object_Item *item; _Task *tsk=NULL; //for entries, get entry data and check agianst previous task text, date //if changed - write if (last_rec != -1) { //cater for initial null data sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk)); task_entry = strtok(te_data, "<"); tsk = (_Task *)elm_object_item_data_get(task_list[last_rec]); if (strcmp(task_entry, tsk->text) != 0) { sprintf(tsk->text, "%s", task_entry); WRITE = 1; } } if (WRITE == 1) { elm_genlist_item_update(task_list[last_rec]); update_record(tsk->no); WRITE = 0; } Evas_Object *li = data; item = (Elm_Object_Item *)elm_genlist_selected_item_get(li); tsk = (_Task *)elm_object_item_data_get(item); last_rec = tsk->no; elm_object_text_set(cat_bt, tsk->cat); sprintf(tystr, "%d", tsk->pr); elm_object_text_set(pr_bt, tystr); elm_object_text_set(date_bt, tsk->date); elm_entry_entry_set(tk, tsk->text); if (strcmp(tsk->text, "Task") == 0) elm_entry_select_all(tk); }
static void reverse_string(Evas_Object *entry) { const char *temp; char *ch = NULL; char tempCh; int len; int i, j = 0; temp = elm_entry_entry_get(entry); if (!temp) return; ch = strdup(temp); len = strlen(ch); for(i = len-2; i >= len/2; i--) { tempCh = ch[i]; ch[i] = ch[j]; ch[j++] = tempCh; } elm_entry_entry_set(entry, ch); }
void shelm_about_dialog() { Evas_Object *window, *background, *frame, *box, *icon, *label, *sublabel, *scroller, *textinfo, *buttonbar, *button_close; char buf[PATH_MAX]; window = create_window("shellementary-about", _("About Shellementary"), destroy); background = create_background(window, NULL, EINA_TRUE); elm_win_resize_object_add(window, background); evas_object_show(background); frame = create_frame(window, EINA_FALSE); elm_win_resize_object_add(window, frame); evas_object_show(frame); box = create_box(window, EINA_FALSE); elm_object_content_set(frame, box); evas_object_show(box); snprintf(buf, sizeof(buf), "%s/logo.png", PACKAGE_DATA_DIR); icon = create_icon(window, buf); elm_box_pack_start(box, icon); evas_object_show(icon); snprintf(buf, sizeof(buf), "<b>Shellementary %s</>", PACKAGE_VERSION); label = create_label(window, buf); elm_object_scale_set(label, 1.6); elm_box_pack_end(box, label); evas_object_show(label); sublabel = create_label(window, _("<b>Display dialogs from shell scripts</><br>Written as a zenity replacement, supports the same arguments<br><b>http://svn.enlightenment.org/svn/e/trunk/PROTO/shellementary</><br>Based on great Elementary toolkit by <b>raster</> and C programming language.<br><b>License:</> MIT")); elm_box_pack_end(box, sublabel); evas_object_show(sublabel); scroller = create_scroller(window, EINA_TRUE); elm_box_pack_end(box, scroller); evas_object_show(scroller); textinfo = create_entry(window, EINA_TRUE, NULL, EINA_FALSE, EINA_FALSE, EINA_FALSE); elm_entry_entry_set(textinfo, _("<b>Author:</> quaker ([email protected])<br>" "<br>" "<b>Credits:</><br>" "<b>Carsten Haitzler (raster)</> " "for Enlightenment DR17, great Elementary toolkit and help with developenment<br>" "<b>Christopher Michael (devilhorns)</> " "for help with developenment<br>")); elm_object_content_set(scroller, textinfo); evas_object_show(textinfo); buttonbar = create_box(window, EINA_TRUE); elm_box_pack_end(box, buttonbar); evas_object_show(buttonbar); snprintf(buf, sizeof(buf), "%s/icon-cancel.png", PACKAGE_DATA_DIR); button_close = create_button(window, buf, _("Close")); evas_object_smart_callback_add(button_close, "clicked", destroy, NULL); elm_box_pack_end(buttonbar, button_close); evas_object_show(button_close); evas_object_show(window); }
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); } } }
void note_clear(void *data, Evas_Object *obj, void *event_info) { Evas_Object *en = data; elm_entry_entry_set(en, ""); }
void EditBoxImplTizen::openKeyboard() { if (s_keypadWin) { return; } if (_delegate != NULL) { _delegate->editBoxEditingDidBegin(_editBox); } #if CC_ENABLE_SCRIPT_BINDING EditBox* pEditBox = this->getEditBox(); if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) { CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); } #endif Evas_Object* parent = Application::getInstance()->_win; GLView* glView = Director::getInstance()->getOpenGLView(); Size frameSize = glView->getFrameSize(); s_keypadWin = elm_win_add(parent, "cocos2d-x", ELM_WIN_BASIC); elm_win_autodel_set(s_keypadWin, EINA_TRUE); elm_win_conformant_set(s_keypadWin, EINA_TRUE); elm_win_alpha_set(s_keypadWin, EINA_TRUE); evas_object_show(s_keypadWin); eext_object_event_callback_add(s_keypadWin, EEXT_CALLBACK_BACK, entry_back_cb, this); int rots[2]; rots[0] = (int)(elm_win_rotation_get(parent)); rots[1] = rots[0] + 180 % 360; elm_win_wm_rotation_available_rotations_set(s_keypadWin, rots, 2); Evas_Object* bgFull = elm_bg_add(s_keypadWin); evas_object_color_set(bgFull, 0, 0, 0, 0xa0); evas_object_resize(bgFull, frameSize.width, frameSize.height); evas_object_show(bgFull); int height = frameSize.height / 10; Evas_Object* rectangle = elm_bg_add(bgFull); evas_object_resize(rectangle, frameSize.width, height); evas_object_move(rectangle, 0, height); evas_object_color_set(rectangle, 0xff, 0xff, 0xff, 0xff); evas_object_show(rectangle); Evas_Object* title = elm_entry_add(rectangle); evas_object_resize(title, frameSize.width, height); auto text = _placeHolder.c_str(); auto richText = (char*)malloc(strlen(text) + 50); sprintf(richText,"<color=#ffffff>%s</>", text); elm_entry_entry_set(title, richText); elm_entry_editable_set(title, EINA_FALSE); //elm_entry_drag_disabled_set(title, EINA_TRUE); //elm_entry_drop_disabled_set(title, EINA_TRUE); evas_object_show(title); free(richText); Evas_Object* entry = elm_entry_add(bgFull); elm_object_focus_set(entry, EINA_TRUE); evas_object_resize(entry, frameSize.width, height); evas_object_move(entry, 0, height); elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); elm_entry_entry_set(entry, _text.c_str()); evas_object_show(entry); elm_object_focus_set(entry, EINA_TRUE); eext_entry_selection_back_event_allow_set(entry, EINA_TRUE); Elm_Entry_Filter_Limit_Size limit_size = { 0, }; limit_size.max_char_count = _maxLength; elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_size); elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); elm_entry_prediction_allow_set(entry, EINA_FALSE); evas_object_smart_callback_add(entry, "activated", entry_activated_cb, this); switch(_editBoxInputFlag) { case EditBox::InputFlag::PASSWORD: elm_entry_password_set(entry, EINA_TRUE); elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_EMAIL); break; case EditBox::InputFlag::SENSITIVE: elm_entry_input_hint_set(entry, ELM_INPUT_HINT_SENSITIVE_DATA); break; case EditBox::InputFlag::INITIAL_CAPS_WORD: elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_WORD); break; case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_SENTENCE); break; case EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS: elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_ALLCHARACTER); break; } switch(_editBoxInputMode) { case EditBox::InputMode::ANY: break; case EditBox::InputMode::EMAIL_ADDRESS: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_EMAIL); break; case EditBox::InputMode::NUMERIC: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER); break; case EditBox::InputMode::PHONE_NUMBER: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_PHONENUMBER); break; case EditBox::InputMode::URL: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_URL); break; case EditBox::InputMode::DECIMAL: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_HEX); //fixme? break; case EditBox::InputMode::SINGLE_LINE: break; } }
void create_details_page(void *data, Evas_Object *obj, void *event_info) { Evas_Object *bg, *tb, *lb, *bt; Evas_Object *det_hv, *bx, *c_date_hs, *c_date_bt, *fr1, *fr, *bt_done; int i; char no[2], dt[10]; static Details det[15]; time_t curtime, tm; struct tm *loctime; //get the time curtime = time (NULL); //check task selected - otherwise return Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list); if(!item) return; _Task *tsk = (_Task *)elm_object_item_data_get(item); det_page = elm_win_add(NULL, "inwin", ELM_WIN_BASIC); elm_win_title_set(det_page, "Task Details"); elm_win_autodel_set(det_page, 1); bg = elm_bg_add(det_page); elm_win_resize_object_add(det_page, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); tb = elm_table_add(det_page); elm_win_resize_object_add(det_page, tb); 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); //add a frame fr = elm_frame_add(det_page); elm_object_style_set(fr, "outdent_top"); evas_object_size_hint_align_set(fr, 0.5, -1.0); elm_table_pack(tb, fr, 0, 0, 3, 1); evas_object_show(fr); //add a label to frame lb = elm_label_add(det_page); elm_object_text_set(lb,"Edit Task Details"); evas_object_size_hint_align_set(lb, 0.5, -1.0); elm_object_content_set(fr, lb); evas_object_show(lb); //add a label lb = elm_label_add(det_page); elm_object_text_set(lb,"Task:"); evas_object_size_hint_align_set(lb, 1.0, 0.5); elm_table_pack(tb, lb, 0, 1, 1, 1); evas_object_show(lb); //add an entry entry = elm_entry_add(det_page); elm_entry_single_line_set(entry, 1); elm_entry_editable_set(entry, 1); elm_entry_entry_set(entry, tsk->text); elm_entry_line_wrap_set(entry, 0); elm_table_pack(tb, entry, 1, 1, 2, 1); evas_object_show(entry); //add a label to hbox lb = elm_label_add(det_page); elm_object_text_set(lb,"Priority:"); evas_object_size_hint_align_set(lb, 1.0, 0.5); elm_table_pack(tb, lb, 0, 2, 1, 1); evas_object_show(lb); //add hover for priority det_hv = elm_hover_add(det_page); //add box for hover bx = elm_box_add(det_page); elm_table_pack(tb, bx, 1, 2, 2, 1); evas_object_show(bx); c_pr_bt = elm_button_add(det_page); sprintf(no, "%d", tsk->pr); elm_object_text_set(c_pr_bt, no); evas_object_smart_callback_add(c_pr_bt, "clicked", my_hover_bt_1, det_hv); elm_box_pack_end(bx, c_pr_bt); evas_object_show(c_pr_bt); elm_hover_parent_set(det_hv, det_page); elm_hover_target_set(det_hv, c_pr_bt); bt = elm_button_add(det_page); elm_object_text_set(bt, "Pr"); elm_object_part_content_set(det_hv, "middle", bt); evas_object_show(bt); bx = elm_box_add(det_page); //add 5 buttons for (i=1; i<6; i++) { det[i].item = item; det[i].hover = det_hv; det[i].button = c_pr_bt; bt = elm_button_add(det_page); sprintf(no, "%d", i); elm_object_text_set(bt, no); elm_box_pack_end(bx, bt); det[i].data = strdup(no); evas_object_smart_callback_add(bt, "clicked", set_create_priority, &det[i]); evas_object_show(bt); } evas_object_show(bx); elm_object_part_content_set(det_hv, "bottom", bx); //add a label to hbox lb = elm_label_add(det_page); elm_object_text_set(lb,"Category:"); evas_object_size_hint_align_set(lb, 1.0, 0.5); elm_table_pack(tb, lb, 0, 3, 1, 1); evas_object_show(lb); hs = elm_hover_add(det_page); //add box for hover bx = elm_box_add(det_page); elm_table_pack(tb, bx, 1, 3, 2, 1); evas_object_show(bx); cat_bt = elm_button_add(det_page); elm_object_text_set(cat_bt, tsk->cat); evas_object_smart_callback_add(cat_bt, "clicked", my_hover_bt_1, hs); elm_box_pack_end(bx, cat_bt); evas_object_show(cat_bt); elm_hover_parent_set(hs, det_page); elm_hover_target_set(hs, cat_bt); bt = elm_button_add(det_page); elm_object_text_set(bt, "Category"); elm_object_part_content_set(hs, "middle", bt); evas_object_show(bt); bx = elm_box_add(det_page); //add categories add_hs_items (det_page, bx, bt, 0); evas_object_show(bx); elm_object_part_content_set(hs, "bottom", bx); //add a label to hbox lb = elm_label_add(det_page); elm_object_text_set(lb, "Date:"); evas_object_size_hint_align_set(lb, 1.0, 0.5); elm_table_pack(tb, lb, 0, 4, 1, 1); evas_object_show(lb); //add hover for date c_date_hs = elm_hover_add(det_page); //add box for hover bx = elm_box_add(det_page); elm_table_pack(tb, bx, 1, 4, 2, 1); evas_object_show(bx); c_date_bt = elm_button_add(det_page); elm_object_text_set(c_date_bt, tsk->date); evas_object_smart_callback_add(c_date_bt, "clicked", my_hover_bt_1, c_date_hs); elm_box_pack_end(bx, c_date_bt); evas_object_show(c_date_bt); elm_hover_parent_set(c_date_hs, det_page); elm_hover_target_set(c_date_hs, c_date_bt); bt = elm_button_add(det_page); elm_object_text_set(bt, "Date"); elm_object_part_content_set(c_date_hs, "middle", bt); evas_object_show(bt); bx = elm_box_add(det_page); //add dates det[6].item = item; det[6].hover = c_date_hs; det[6].button = c_date_bt; sprintf(dt, "No Date"); bt = elm_button_add(det_page); elm_object_text_set(bt,dt); elm_box_pack_end(bx, bt); det[6].data = strdup(dt); evas_object_smart_callback_add(bt, "clicked", set_create_date, &det[6]); evas_object_show(bt); for(i=0; i<7; i++) { det[7+i].item = item; det[7+i].hover = c_date_hs; det[7+i].button = c_date_bt; tm = curtime + (i * 86400); loctime = localtime (&tm); strftime(dt, 7, "%d-%m", loctime); bt = elm_button_add(det_page); elm_object_text_set(bt,dt); elm_box_pack_end(bx, bt); det[7+i].data = strdup(dt); evas_object_smart_callback_add(bt, "clicked", set_create_date, &det[7+i]); evas_object_show(bt); } det[14].item = item; det[14].hover = c_date_hs; det[14].button = c_date_bt; sprintf(dt, "Calendar"); bt = elm_button_add(det_page); elm_object_text_set(bt,dt); elm_box_pack_end(bx, bt); det[14].data = strdup(dt); evas_object_smart_callback_add(bt, "clicked", set_create_date, &det[14]); evas_object_show(bt); evas_object_show(bx); elm_object_part_content_set(c_date_hs, "bottom", bx); //add a label lb = elm_label_add(det_page); elm_object_text_set(lb,"Note:"); evas_object_size_hint_align_set(lb, 1.0, 0.5); elm_table_pack(tb, lb, 0, 5, 1, 1); evas_object_show(lb); //add an entry note_entry = elm_entry_add(det_page); elm_entry_single_line_set(note_entry, 1); elm_entry_editable_set(note_entry, 1); if(strcmp(tsk->note, "") != 0) elm_entry_entry_set(note_entry, tsk->note); else { elm_entry_entry_set(note_entry, "Note"); elm_entry_select_all(note_entry); } elm_entry_line_wrap_set(note_entry, 0); elm_table_pack(tb, note_entry, 1, 5, 2, 1); evas_object_show(note_entry); /*lb = elm_label_add(det_page); elm_object_text_set(lb,"Note:"); elm_table_pack(tb, lb, 1, 5, 2, 1); evas_object_show(lb);*/ //add a frame fr1 = elm_frame_add(det_page); elm_object_style_set(fr1, "outdent_bottom"); evas_object_size_hint_weight_set(fr1, -1.0, 0.0); evas_object_size_hint_align_set(fr1, -1.0, -1.0); elm_table_pack(tb, fr1, 0, 6, 3, 1); evas_object_show(fr1); //add done button bt_done = elm_button_add(det_page); elm_object_text_set(bt_done, "Done"); evas_object_size_hint_weight_set(bt_done, 1.0, 0.0); evas_object_size_hint_align_set(bt_done, -1.0, -1.0); elm_table_pack(tb, bt_done, 0, 7, 1, 1); evas_object_show(bt_done); evas_object_smart_callback_add(bt_done, "clicked", det_page_done, (_Task *)tsk); //add del button bt = elm_button_add(det_page); elm_object_text_set(bt, "Delete"); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_table_pack(tb, bt, 1, 7, 1, 1); evas_object_show(bt); evas_object_smart_callback_add(bt, "clicked", det_page_del, (_Task *)tsk); //add yes button //bt = elm_button_add(det_page); //evas_object_size_hint_weight_set(bt, 1.0, 1.0); //evas_object_size_hint_align_set(bt, -1.0, -1.0); //elm_object_text_set(bt, "Note"); //elm_box_pack_end(hbox1, bt); //evas_object_show(bt); //evas_object_smart_callback_add(bt, "clicked", det_page_add, entry); //add close button bt = elm_button_add(det_page); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_object_text_set(bt, "Cancel"); elm_table_pack(tb, bt, 2, 7, 1, 1); evas_object_show(bt); evas_object_smart_callback_add(bt, "clicked", cat_win_del, det_page); evas_object_resize(det_page, 480, 640); evas_object_show(det_page); }
static void __common_utils_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { elm_entry_entry_set(data, ""); }
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); }
void note_button_clicked(void *data, Evas_Object *obj, void *event_info) { Evas_Object *bg, *bx, *bx2, *bt, *en; //char buf[PATH_MAX]; Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list); if(!item) return; _Task *tsk = (_Task *)elm_object_item_data_get(item); note_win = elm_win_add(NULL, "note", ELM_WIN_BASIC); elm_win_title_set(note_win, "Note"); elm_win_autodel_set(note_win, 1); bg = elm_bg_add(note_win); elm_win_resize_object_add(note_win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); bx = elm_box_add(note_win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(note_win, bx); evas_object_show(bx); en = elm_entry_add(note_win); elm_entry_line_wrap_set(en, 0); evas_object_size_hint_weight_set(en, 1.0, 1.0); evas_object_size_hint_align_set(en, -1.0, -1.0); elm_box_pack_end(bx, en); elm_entry_entry_set(en, tsk->note); evas_object_show(en); bx2 = elm_box_add(note_win); 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); bt = elm_button_add(note_win); elm_object_text_set(bt, "Clear"); evas_object_smart_callback_add(bt, "clicked", note_clear, en); evas_object_size_hint_align_set(bt, -1.0, -1.0); evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); //bt = elm_button_add(note_win); //elm_object_text_set(bt, "Save"); //evas_object_smart_callback_add(bt, "clicked", my_entry_bt_2, en); //evas_object_size_hint_align_set(bt, -1.0, -1.0); //evas_object_size_hint_weight_set(bt, 1.0, 0.0); //elm_box_pack_end(bx2, bt); //evas_object_show(bt); bt = elm_button_add(note_win); elm_object_text_set(bt, "Cancel"); evas_object_smart_callback_add(bt, "clicked", cat_win_del, note_win); evas_object_size_hint_align_set(bt, -1.0, -1.0); evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); bt = elm_button_add(note_win); elm_object_text_set(bt, "Done"); evas_object_smart_callback_add(bt, "clicked", note_done, en); evas_object_size_hint_align_set(bt, -1.0, -1.0); evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); elm_box_pack_end(bx, bx2); evas_object_show(bx2); evas_object_show(note_win); evas_object_resize(note_win, 480, 640); }
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); }
static Evas_Object * _create_dialog ( const gchar *username) { Evas_Object *dialog, *bg, *box, *frame, *content_box; Evas_Object *button_frame, *pad_frame, *button_box; Evas_Object *cancel_button, *ok_button; g_free (main_dialog); main_dialog = g_malloc0 (sizeof (MainDialog)); /* main window */ dialog = elm_win_add (NULL, "dialog", ELM_WIN_BASIC); elm_win_title_set (dialog, "Enter user password"); elm_win_center (dialog, EINA_TRUE, EINA_TRUE); evas_object_smart_callback_add (dialog, "delete,request", _on_close_dialog_clicked, dialog); main_dialog->dialog = dialog; /* window background */ bg = elm_bg_add (dialog); evas_object_size_hint_weight_set (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (bg); elm_win_resize_object_add (dialog, bg); box = elm_box_add (dialog); evas_object_size_hint_min_set (box, 200, 200); evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (box); elm_win_resize_object_add (dialog, box); frame = elm_frame_add (dialog); elm_object_style_set (frame, "pad_small"); evas_object_size_hint_weight_set (frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (frame, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show (frame); elm_box_pack_start (box, frame); content_box = elm_box_add (dialog); elm_box_padding_set (content_box, 0, 3); evas_object_size_hint_weight_set (content_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (content_box, 0.0, 0.0); evas_object_show (content_box); elm_object_part_content_set (frame, NULL, content_box); main_dialog->username_entry = _add_entry (dialog, content_box, "Username:"******"Password:"******"outdent_bottom"); evas_object_size_hint_weight_set (button_frame, 0.0, 0.0); evas_object_size_hint_align_set (button_frame, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show (button_frame); elm_box_pack_end (box, button_frame); pad_frame = elm_frame_add (dialog); elm_object_style_set (pad_frame, "pad_medium"); evas_object_show (pad_frame); elm_object_part_content_set (button_frame, NULL, pad_frame); button_box = elm_box_add (dialog); elm_box_horizontal_set (button_box, 1); elm_box_homogeneous_set (button_box, 1); evas_object_show (button_box); elm_object_part_content_set (pad_frame, NULL, button_box); /* Cancel button */ cancel_button = elm_button_add (dialog); elm_object_text_set (cancel_button, "Cancel"); evas_object_size_hint_weight_set (cancel_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (cancel_button, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add (cancel_button, "clicked", _on_close_dialog_clicked, dialog); evas_object_show (cancel_button); elm_box_pack_end (button_box, cancel_button); /* OK button */ ok_button = elm_button_add (dialog); elm_object_text_set (ok_button, "OK"); evas_object_size_hint_weight_set (ok_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (ok_button, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add (ok_button, "clicked", _on_ok_dialog_clicked, dialog); evas_object_show (ok_button); elm_box_pack_end (button_box, ok_button); return dialog; }
void create_second_page(void *data, Evas_Object *connect_button, void *ev) { struct appdata *ad = data; Elm_Object_Item *nf_it = NULL; Evas_Object *layout = elm_layout_add(ad->naviframe); // Outer Box Evas_Object* box = elm_box_add(layout); evas_object_size_hint_weight_set(box, EVAS_HINT_FILL, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_align_set(box, 0.5, 0.5); // Port Box Evas_Object* box2 = elm_box_add(layout); elm_box_horizontal_set(box2, EINA_TRUE); // Port Label Evas_Object* portLabel = elm_label_add(box); elm_object_text_set(portLabel, "<align = center>Port </align>"); elm_box_pack_end(box2, portLabel); evas_object_show(portLabel); // Port Entry portEntry = elm_entry_add(box2); elm_entry_entry_set(portEntry, "7777"); elm_entry_single_line_set(portEntry, EINA_FALSE); elm_entry_line_wrap_set(portEntry, ELM_WRAP_NONE); static Elm_Entry_Filter_Limit_Size portLimit_size = { .max_char_count = 5, .max_byte_count = 0 }; elm_entry_markup_filter_append(portEntry, elm_entry_filter_limit_size, &portLimit_size); elm_box_pack_end(box2, portEntry); evas_object_show(portEntry); evas_object_show(box2); evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, 0.3); evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, box2); // IP Box Evas_Object* box1 = elm_box_add(layout); elm_box_horizontal_set(box1, EINA_TRUE); // IP Label Evas_Object* ipLabel = elm_label_add(box1); elm_object_text_set(ipLabel, "<align = center>IP </align>"); elm_box_pack_end(box1, ipLabel); evas_object_show(ipLabel); static Elm_Entry_Filter_Limit_Size ipLimit_size = { .max_char_count = 3, // 3글자 까지 .max_byte_count = 0 }; // IP Entry ipEntry1 = elm_entry_add(box1); //elm_entry_entry_set(ipEntry1, "127"); elm_entry_single_line_set(ipEntry1, EINA_FALSE); elm_entry_line_wrap_set(ipEntry1, ELM_WRAP_NONE); elm_entry_markup_filter_append(ipEntry1, elm_entry_filter_limit_size, &ipLimit_size); elm_box_pack_end(box1, ipEntry1); evas_object_show(ipEntry1); // IP Label Evas_Object* ipPeriod1 = elm_label_add(box1); elm_object_text_set(ipPeriod1, "<align = center>.</align>"); elm_box_pack_end(box1, ipPeriod1); evas_object_show(ipPeriod1); // IP Entry ipEntry2 = elm_entry_add(box1); //elm_entry_entry_set(ipEntry2, " 0"); elm_entry_single_line_set(ipEntry2, EINA_FALSE); elm_entry_line_wrap_set(ipEntry2, ELM_WRAP_NONE); elm_entry_markup_filter_append(ipEntry2, elm_entry_filter_limit_size, &ipLimit_size); elm_box_pack_end(box1, ipEntry2); evas_object_show(ipEntry2); // IP Label Evas_Object* ipPeriod2 = elm_label_add(box1); elm_object_text_set(ipPeriod2, "<align = center>.</align>"); elm_box_pack_end(box1, ipPeriod2); evas_object_show(ipPeriod2); // IP Entry ipEntry3 = elm_entry_add(box1); //elm_entry_entry_set(ipEntry3, " 0"); elm_entry_single_line_set(ipEntry3, EINA_FALSE); elm_entry_line_wrap_set(ipEntry3, ELM_WRAP_NONE); elm_entry_markup_filter_append(ipEntry3, elm_entry_filter_limit_size, &ipLimit_size); elm_box_pack_end(box1, ipEntry3); evas_object_show(ipEntry3); // IP Label Evas_Object* ipPeriod3 = elm_label_add(box1); elm_object_text_set(ipPeriod3, "<align = center>.</align>"); elm_box_pack_end(box1, ipPeriod3); evas_object_show(ipPeriod3); // IP Entry ipEntry4 = elm_entry_add(box1); //elm_entry_entry_set(ipEntry4, " 1"); elm_entry_single_line_set(ipEntry4, EINA_FALSE); elm_entry_line_wrap_set(ipEntry4, ELM_WRAP_NONE); elm_entry_markup_filter_append(ipEntry4, elm_entry_filter_limit_size, &ipLimit_size); elm_box_pack_end(box1, ipEntry4); evas_object_show(ipEntry4); evas_object_show(box1); evas_object_size_hint_weight_set(box1, EVAS_HINT_EXPAND, 0.3); evas_object_size_hint_align_set(box1, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, box1); // Connect Button Evas_Object* connection_button = elm_button_add(box); elm_object_style_set(connection_button, "bottom"); elm_object_text_set(connection_button, "Connection"); elm_object_part_content_set(layout, "elm.swallow.button", connection_button); //evas_object_size_hint_weight_set(connection_button, EVAS_HINT_EXPAND, 1.0); evas_object_size_hint_align_set(connection_button, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add(connection_button, "clicked", _connect_button_click_cb, NULL); elm_box_pack_end(box, connection_button); evas_object_show(connection_button); evas_object_show(box); elm_entry_input_panel_layout_set(ipEntry1,ELM_INPUT_PANEL_LAYOUT_NUMBERONLY); elm_entry_input_panel_layout_set(ipEntry2,ELM_INPUT_PANEL_LAYOUT_NUMBERONLY); elm_entry_input_panel_layout_set(ipEntry3,ELM_INPUT_PANEL_LAYOUT_NUMBERONLY); elm_entry_input_panel_layout_set(ipEntry4,ELM_INPUT_PANEL_LAYOUT_NUMBERONLY); elm_entry_input_panel_layout_set(portEntry,ELM_INPUT_PANEL_LAYOUT_NUMBERONLY); nf_it = elm_naviframe_item_push(ad->naviframe,"<color=#F5D6FFFF>Connection</color>", NULL, NULL, box, NULL); // evas_object_show(ad->win); }