Пример #1
0
PREFIX value ml_elm_segment_control_add(value v_parent)
{
        Evas_Object* segment_control = elm_segment_control_add(
                (Evas_Object*) v_parent);
        if(segment_control == NULL) caml_failwith("elm_segment_control_add");
        return (value) segment_control;
}
Пример #2
0
PREFIX value ml_elm_segment_control_add(value v_parent)
{
        Evas_Object* segment_control = elm_segment_control_add(
                Evas_Object_val(v_parent));
        if(segment_control == NULL) caml_failwith("elm_segment_control_add");
        return copy_Evas_Object(segment_control);
}
static void startup(void)
{
   tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
   elm_init(0, NULL);
   main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
   evas_object_show(main_win);
   segment_control = elm_segment_control_add(main_win);
   evas_object_show(segment_control);
}
/**
 * @brief Positive test case of elm_segment_control_item_del()
 */
static void utc_UIFW_elm_segment_control_item_del_func_01(void)
{
   Elm_Object_Item *item = NULL;
   Elm_Object_Item *it = NULL;
   Evas_Object *segment = NULL;

   segment = elm_segment_control_add(main_win);
   evas_object_show(segment);
   item = elm_segment_control_item_add(segment, NULL, "All");
   elm_segment_control_item_del(item);
   it = elm_segment_control_item_get(segment,0);
   if (it) {
      tet_infoline("elm_segment_control_item_del() failed in positive test case");
      tet_result(TET_FAIL);
      return;
   }
   tet_result(TET_PASS);
}
/**
 * @brief Positive test case of elm_segment_control_item_label_set()
 */
static void utc_UIFW_elm_segment_control_item_label_set_func_01(void)
{
   Elm_Object_Item *item = NULL;
   const char *label = NULL;
   Evas_Object *segment = NULL;
   int index;

   segment = elm_segment_control_add(main_win);
   evas_object_show(segment);
   item = elm_segment_control_item_add(segment, NULL, "test");
   elm_segment_control_item_label_set(item, "All");
   index = elm_segment_control_item_index_get(item);
   label = elm_segment_control_item_label_get(segment, index);
   if (!(strcmp(label,"All"))) {
      tet_result(TET_PASS);
      return;
   }
   tet_infoline("elm_segment_control_item_label_set() failed in positive test case");
   tet_result(TET_FAIL);
}
Пример #6
0
Evas_Object *
enna_browser_bar_add(Evas_Object *parent, Enna_File *file)
{
   Evas_Object *o_layout;
   Evas_Object *o_ic;
   Evas_Object *o_seg;
   Evas_Object *o_box;
   Evas_Object *o_entry;

   o_layout = elm_layout_add(parent);
   elm_layout_file_set(o_layout, enna_config_theme_get(), "enna/browser/header");
   evas_object_show(o_layout);

   o_box = elm_box_add(o_layout);
   elm_box_horizontal_set(o_box, EINA_TRUE);
   evas_object_show(o_box);
   evas_object_size_hint_align_set(o_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_size_hint_weight_set(o_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_box_padding_set(o_box, 8, 8);

   o_seg = elm_button_add(o_layout);
   o_ic = elm_icon_add(o_layout);
   evas_object_show(o_ic);
   elm_icon_standard_set(o_ic, "go-up");
   elm_object_content_set(o_seg, o_ic);
   elm_object_style_set(o_seg, "black");
   evas_object_show(o_seg);
   elm_box_pack_end(o_box, o_seg);
   evas_object_smart_callback_add(o_seg, "clicked", _up_clicked_cb, o_layout);
   evas_object_size_hint_min_set(o_seg, 40, 40);

   o_seg = elm_segment_control_add(o_layout);
   o_ic = elm_icon_add(o_layout);
   evas_object_show(o_ic);
   elm_icon_standard_set(o_ic, "go-previous");
   elm_segment_control_item_add(o_seg, o_ic, NULL);
   o_ic = elm_icon_add(o_layout);
   evas_object_show(o_ic);
   elm_icon_standard_set(o_ic, "go-next");
   elm_segment_control_item_add(o_seg, o_ic, NULL);
   evas_object_show(o_seg);
   evas_object_smart_callback_add(o_seg, "changed", _browse_icons_changed_cb, o_layout);
   evas_object_data_set(o_layout, "browse", o_seg);
   elm_box_pack_end(o_box, o_seg);
   evas_object_size_hint_min_set(o_seg, 80, 40);

   o_entry = elm_entry_add(o_layout);
   elm_entry_single_line_set(o_entry, EINA_TRUE);
   if (file) elm_object_text_set(o_entry, file->mrl);
   evas_object_size_hint_weight_set(o_entry, EVAS_HINT_EXPAND, 0.0);
   evas_object_size_hint_align_set(o_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(o_entry);
   elm_box_pack_end(o_box, o_entry);
   evas_object_data_set(o_layout, "entry", o_entry);
   evas_object_smart_callback_add(o_entry, "activated", _entry_activated_cb, o_layout);

   o_seg = elm_segment_control_add(o_layout);
   o_ic = elm_icon_add(o_layout);
   evas_object_show(o_ic);
   elm_icon_file_set(o_ic, enna_config_theme_get(), "icon/view_list");
   elm_segment_control_item_add(o_seg, o_ic, NULL);
   o_ic = elm_icon_add(o_layout);
   evas_object_show(o_ic);
   elm_icon_file_set(o_ic, enna_config_theme_get(), "icon/view_grid");
   elm_segment_control_item_add(o_seg, o_ic, NULL);
   evas_object_show(o_seg);
   elm_box_pack_end(o_box, o_seg);
   evas_object_smart_callback_add(o_seg, "changed", _view_mode_changed_cb, o_layout);
   evas_object_data_set(o_layout, "mode", o_seg);
   evas_object_size_hint_min_set(o_seg, 80, 40);


   o_seg = elm_button_add(o_layout);
   o_ic = elm_icon_add(o_layout);
   evas_object_show(o_ic);
   elm_icon_file_set(o_ic, enna_config_theme_get(), "icon/search");
   elm_object_content_set(o_seg, o_ic);
   elm_object_style_set(o_seg, "black");
   evas_object_show(o_seg);
   elm_box_pack_end(o_box, o_seg);
   evas_object_size_hint_min_set(o_seg, 40, 40);

   o_seg = elm_button_add(o_layout);
   o_ic = elm_icon_add(o_layout);
   evas_object_show(o_ic);
   elm_icon_file_set(o_ic, enna_config_theme_get(), "icon/settings");
   elm_object_content_set(o_seg, o_ic);
   elm_object_style_set(o_seg, "black");
   evas_object_show(o_seg);
   elm_box_pack_end(o_box, o_seg);
   evas_object_size_hint_min_set(o_seg, 40, 40);

   elm_object_part_content_set(o_layout, "enna.swallow.content", o_box);

   return o_layout;
}
Пример #7
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *sc, *ic;
   Elm_Object_Item *seg_it;
   int count, idx;

   win = elm_win_add(NULL, "segment_control", ELM_WIN_BASIC);
   elm_win_title_set(win, "Segment Control Example");
   evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);

   bg = elm_bg_add(win);
   elm_win_resize_object_add(win, bg);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(bg);

   sc = elm_segment_control_add(win);
   evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, sc);
   evas_object_show(sc);

   elm_segment_control_item_add(sc, NULL, "only text");

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "close");
   elm_segment_control_item_add(sc, ic, NULL);

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "home");
   elm_segment_control_item_add(sc, ic, "Home");

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "close");
   elm_segment_control_item_add(sc, ic, "");

   count = elm_segment_control_item_count_get(sc);
   elm_segment_control_item_insert_at(sc, NULL, "Inserted at", count - 1);

   seg_it = elm_segment_control_item_insert_at(sc, NULL, "To be deleted", 2);
   elm_object_item_del(seg_it);

   elm_segment_control_item_insert_at(sc, NULL, "To be deleted", 2);
   elm_segment_control_item_del_at(sc, 2);

   seg_it = elm_segment_control_item_get(sc, 0);
   elm_object_item_text_set(seg_it, "Only Text");

   count = elm_segment_control_item_count_get(sc);
   seg_it = elm_segment_control_item_get(sc, count / 2);
   elm_segment_control_item_selected_set(seg_it, EINA_TRUE);
   seg_it = elm_segment_control_item_selected_get(sc);
   idx = elm_segment_control_item_index_get(seg_it);
   printf("Item selected: %i\n", idx);

   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}