2009-08-13 15:41:43 -07:00
|
|
|
#include <Elementary.h>
|
2010-10-19 11:25:22 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2009-09-13 21:22:27 -07:00
|
|
|
#ifndef ELM_LIB_QUICKLAUNCH
|
2009-08-13 15:41:43 -07:00
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
tb_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-08-13 15:41:43 -07:00
|
|
|
{
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/panel_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(data, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
tb_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-08-13 15:41:43 -07:00
|
|
|
{
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(data, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
tb_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-08-13 15:41:43 -07:00
|
|
|
{
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/wood_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(data, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
tb_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-08-13 15:41:43 -07:00
|
|
|
{
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(data, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
tb_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-08-13 15:41:43 -07:00
|
|
|
{
|
|
|
|
elm_photo_file_set(data, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-10-19 11:25:22 -07:00
|
|
|
test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-08-13 15:41:43 -07:00
|
|
|
{
|
2010-10-20 14:30:00 -07:00
|
|
|
Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
|
2009-08-13 15:41:43 -07:00
|
|
|
Evas_Object *ph1, *ph2, *ph3, *ph4;
|
2009-08-25 15:46:19 -07:00
|
|
|
Elm_Toolbar_Item *item;
|
2009-10-11 06:37:01 -07:00
|
|
|
Elm_Menu_Item *menu_item;
|
2009-08-13 15:41:43 -07:00
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Toolbar");
|
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
tb = elm_toolbar_add(win);
|
2009-10-11 06:37:01 -07:00
|
|
|
elm_toolbar_homogenous_set(tb, 0);
|
[Elementary] Implement priority in Elm_Toolbar.
Toolbars can now be scrollable, non-scrollable, or hide icons selectively
according to a priority. This changed the API slightly, thus
elm_toolbar_scrollable_set(obj, 1)
Should be
elm_toolbar_mode_expand_set(obj, ELM_TOOLBAR_EXPAND_SCROLL)
Values for non-scrollable and scrollable remain the same, so if constants
aren't being used, just the function name should be changed.
The new mode, ELM_TOOLBAR_EXPAND_MENU, will create a menu of items when the
space isn't large enough to hold all the items. Which items will be kept on
the toolbar or which items will be added to the menu is controlled by the
priority of each item: higher ones will be kept if possible, lower ones will
be tratored on the first opportunity.
SVN revision: 53406
2010-10-14 08:27:25 -07:00
|
|
|
elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_MENU);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_size_hint_weight_set(tb, 0.0, 0.0);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
|
2009-10-06 13:14:46 -07:00
|
|
|
|
2009-08-13 15:41:43 -07:00
|
|
|
ph1 = elm_photo_add(win);
|
|
|
|
ph2 = elm_photo_add(win);
|
|
|
|
ph3 = elm_photo_add(win);
|
|
|
|
ph4 = elm_photo_add(win);
|
|
|
|
|
2010-10-14 15:21:43 -07:00
|
|
|
item = elm_toolbar_item_add(tb, "document-print", "Hello", tb_1, ph1);
|
2009-08-25 15:46:19 -07:00
|
|
|
elm_toolbar_item_disabled_set(item, EINA_TRUE);
|
[Elementary] Implement priority in Elm_Toolbar.
Toolbars can now be scrollable, non-scrollable, or hide icons selectively
according to a priority. This changed the API slightly, thus
elm_toolbar_scrollable_set(obj, 1)
Should be
elm_toolbar_mode_expand_set(obj, ELM_TOOLBAR_EXPAND_SCROLL)
Values for non-scrollable and scrollable remain the same, so if constants
aren't being used, just the function name should be changed.
The new mode, ELM_TOOLBAR_EXPAND_MENU, will create a menu of items when the
space isn't large enough to hold all the items. Which items will be kept on
the toolbar or which items will be added to the menu is controlled by the
priority of each item: higher ones will be kept if possible, lower ones will
be tratored on the first opportunity.
SVN revision: 53406
2010-10-14 08:27:25 -07:00
|
|
|
elm_toolbar_item_priority_set(item, 100);
|
2009-08-13 15:41:43 -07:00
|
|
|
|
2010-10-14 15:21:43 -07:00
|
|
|
item = elm_toolbar_item_add(tb, "folder-new", "World", tb_2, ph1);
|
[Elementary] Implement priority in Elm_Toolbar.
Toolbars can now be scrollable, non-scrollable, or hide icons selectively
according to a priority. This changed the API slightly, thus
elm_toolbar_scrollable_set(obj, 1)
Should be
elm_toolbar_mode_expand_set(obj, ELM_TOOLBAR_EXPAND_SCROLL)
Values for non-scrollable and scrollable remain the same, so if constants
aren't being used, just the function name should be changed.
The new mode, ELM_TOOLBAR_EXPAND_MENU, will create a menu of items when the
space isn't large enough to hold all the items. Which items will be kept on
the toolbar or which items will be added to the menu is controlled by the
priority of each item: higher ones will be kept if possible, lower ones will
be tratored on the first opportunity.
SVN revision: 53406
2010-10-14 08:27:25 -07:00
|
|
|
elm_toolbar_item_priority_set(item, -100);
|
2009-08-13 15:41:43 -07:00
|
|
|
|
2010-10-14 15:21:43 -07:00
|
|
|
item = elm_toolbar_item_add(tb, "object-rotate-right", "H", tb_3, ph4);
|
[Elementary] Implement priority in Elm_Toolbar.
Toolbars can now be scrollable, non-scrollable, or hide icons selectively
according to a priority. This changed the API slightly, thus
elm_toolbar_scrollable_set(obj, 1)
Should be
elm_toolbar_mode_expand_set(obj, ELM_TOOLBAR_EXPAND_SCROLL)
Values for non-scrollable and scrollable remain the same, so if constants
aren't being used, just the function name should be changed.
The new mode, ELM_TOOLBAR_EXPAND_MENU, will create a menu of items when the
space isn't large enough to hold all the items. Which items will be kept on
the toolbar or which items will be added to the menu is controlled by the
priority of each item: higher ones will be kept if possible, lower ones will
be tratored on the first opportunity.
SVN revision: 53406
2010-10-14 08:27:25 -07:00
|
|
|
elm_toolbar_item_priority_set(item, 150);
|
2009-08-13 15:41:43 -07:00
|
|
|
|
2010-10-14 15:21:43 -07:00
|
|
|
item = elm_toolbar_item_add(tb, "mail-send", "Comes", tb_4, ph4);
|
[Elementary] Implement priority in Elm_Toolbar.
Toolbars can now be scrollable, non-scrollable, or hide icons selectively
according to a priority. This changed the API slightly, thus
elm_toolbar_scrollable_set(obj, 1)
Should be
elm_toolbar_mode_expand_set(obj, ELM_TOOLBAR_EXPAND_SCROLL)
Values for non-scrollable and scrollable remain the same, so if constants
aren't being used, just the function name should be changed.
The new mode, ELM_TOOLBAR_EXPAND_MENU, will create a menu of items when the
space isn't large enough to hold all the items. Which items will be kept on
the toolbar or which items will be added to the menu is controlled by the
priority of each item: higher ones will be kept if possible, lower ones will
be tratored on the first opportunity.
SVN revision: 53406
2010-10-14 08:27:25 -07:00
|
|
|
elm_toolbar_item_priority_set(item, 0);
|
2009-08-13 15:41:43 -07:00
|
|
|
|
2010-10-14 08:27:31 -07:00
|
|
|
item = elm_toolbar_item_add(tb, "clock", "Elementary", tb_5, ph4);
|
[Elementary] Implement priority in Elm_Toolbar.
Toolbars can now be scrollable, non-scrollable, or hide icons selectively
according to a priority. This changed the API slightly, thus
elm_toolbar_scrollable_set(obj, 1)
Should be
elm_toolbar_mode_expand_set(obj, ELM_TOOLBAR_EXPAND_SCROLL)
Values for non-scrollable and scrollable remain the same, so if constants
aren't being used, just the function name should be changed.
The new mode, ELM_TOOLBAR_EXPAND_MENU, will create a menu of items when the
space isn't large enough to hold all the items. Which items will be kept on
the toolbar or which items will be added to the menu is controlled by the
priority of each item: higher ones will be kept if possible, lower ones will
be tratored on the first opportunity.
SVN revision: 53406
2010-10-14 08:27:25 -07:00
|
|
|
elm_toolbar_item_priority_set(item, -200);
|
2009-08-13 15:41:43 -07:00
|
|
|
|
2010-10-14 08:27:31 -07:00
|
|
|
item = elm_toolbar_item_add(tb, "refresh", "Menu", NULL, NULL);
|
2009-10-06 08:08:41 -07:00
|
|
|
elm_toolbar_item_menu_set(item, 1);
|
2010-10-20 14:30:00 -07:00
|
|
|
elm_toolbar_item_priority_set(item, -999999);
|
2009-10-06 08:08:41 -07:00
|
|
|
elm_toolbar_menu_parent_set(tb, win);
|
2009-10-11 06:37:01 -07:00
|
|
|
menu = elm_toolbar_item_menu_get(item);
|
2009-10-07 10:11:41 -07:00
|
|
|
|
2010-10-21 08:37:02 -07:00
|
|
|
elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
|
|
|
|
menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
|
|
|
|
elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4);
|
|
|
|
elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
|
2009-10-06 08:08:41 -07:00
|
|
|
|
2009-08-13 15:41:43 -07:00
|
|
|
elm_box_pack_end(bx, tb);
|
|
|
|
evas_object_show(tb);
|
|
|
|
|
|
|
|
tb = elm_table_add(win);
|
2009-10-06 08:08:41 -07:00
|
|
|
//elm_table_homogenous_set(tb, 1);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2009-08-13 15:41:43 -07:00
|
|
|
|
|
|
|
ph = ph1;
|
|
|
|
elm_photo_size_set(ph, 40);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 0, 0, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph2;
|
|
|
|
elm_photo_size_set(ph, 80);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 1, 0, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph3;
|
|
|
|
elm_photo_size_set(ph, 20);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 0, 1, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph4;
|
|
|
|
elm_photo_size_set(ph, 60);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
2009-09-27 22:53:28 -07:00
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 1, 1, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
elm_box_pack_end(bx, tb);
|
|
|
|
evas_object_show(tb);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 300);
|
2010-10-21 08:37:02 -07:00
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
test_toolbar2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *tb, *ph, *menu, *bt;
|
|
|
|
Evas_Object *ph1, *ph2, *ph3, *ph4;
|
|
|
|
Elm_Toolbar_Item *item;
|
|
|
|
Elm_Menu_Item *menu_item;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Toolbar");
|
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
tb = elm_toolbar_add(win);
|
|
|
|
elm_toolbar_homogenous_set(tb, 0);
|
|
|
|
elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_SCROLL);
|
|
|
|
evas_object_size_hint_weight_set(tb, 0.0, 0.0);
|
|
|
|
evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
|
|
|
|
|
|
|
|
ph1 = elm_photo_add(win);
|
|
|
|
ph2 = elm_photo_add(win);
|
|
|
|
ph3 = elm_photo_add(win);
|
|
|
|
ph4 = elm_photo_add(win);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "document-print", "Hello", tb_1, ph1);
|
|
|
|
elm_toolbar_item_disabled_set(item, EINA_TRUE);
|
|
|
|
elm_toolbar_item_priority_set(item, -100);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "folder-new", "World", tb_2, ph1);
|
|
|
|
elm_toolbar_item_priority_set(item, 100);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "object-rotate-right", "H", tb_3, ph4);
|
|
|
|
elm_toolbar_item_priority_set(item, -150);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "mail-send", "Comes", tb_4, ph4);
|
|
|
|
elm_toolbar_item_priority_set(item, -200);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "clock", "Elementary", tb_5, ph4);
|
|
|
|
elm_toolbar_item_priority_set(item, 0);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "refresh", "Menu", NULL, NULL);
|
|
|
|
elm_toolbar_item_menu_set(item, 1);
|
|
|
|
elm_toolbar_item_priority_set(item, -999999);
|
|
|
|
elm_toolbar_menu_parent_set(tb, win);
|
|
|
|
menu = elm_toolbar_item_menu_get(item);
|
|
|
|
|
|
|
|
elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
|
|
|
|
menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
|
|
|
|
elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4);
|
|
|
|
elm_menu_item_add(menu, NULL, "edit-delete", "Scroll", tb_5, ph4);
|
|
|
|
|
|
|
|
elm_box_pack_end(bx, tb);
|
|
|
|
evas_object_show(tb);
|
|
|
|
|
|
|
|
tb = elm_table_add(win);
|
|
|
|
//elm_table_homogenous_set(tb, 1);
|
|
|
|
evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
ph = ph1;
|
|
|
|
elm_photo_size_set(ph, 40);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 0, 0, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph2;
|
|
|
|
elm_photo_size_set(ph, 80);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 1, 0, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph3;
|
|
|
|
elm_photo_size_set(ph, 20);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 0, 1, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph4;
|
|
|
|
elm_photo_size_set(ph, 60);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 1, 1, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
elm_box_pack_end(bx, tb);
|
|
|
|
evas_object_show(tb);
|
2009-08-13 15:41:43 -07:00
|
|
|
|
2010-10-21 08:37:02 -07:00
|
|
|
evas_object_resize(win, 320, 300);
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
test_toolbar3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *tb, *ph, *menu, *bt;
|
|
|
|
Evas_Object *ph1, *ph2, *ph3, *ph4;
|
|
|
|
Elm_Toolbar_Item *item;
|
|
|
|
Elm_Menu_Item *menu_item;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Toolbar");
|
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
tb = elm_toolbar_add(win);
|
|
|
|
elm_toolbar_homogenous_set(tb, 0);
|
|
|
|
elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_NONE);
|
|
|
|
evas_object_size_hint_weight_set(tb, 0.0, 0.0);
|
|
|
|
evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
|
|
|
|
|
|
|
|
ph1 = elm_photo_add(win);
|
|
|
|
ph2 = elm_photo_add(win);
|
|
|
|
ph3 = elm_photo_add(win);
|
|
|
|
ph4 = elm_photo_add(win);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "document-print", "Hello", tb_1, ph1);
|
|
|
|
elm_toolbar_item_disabled_set(item, EINA_TRUE);
|
|
|
|
elm_toolbar_item_priority_set(item, 0);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "folder-new", "World", tb_2, ph1);
|
|
|
|
elm_toolbar_item_priority_set(item, -200);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "object-rotate-right", "H", tb_3, ph4);
|
|
|
|
elm_toolbar_item_priority_set(item, 1);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "mail-send", "Comes", tb_4, ph4);
|
|
|
|
elm_toolbar_item_priority_set(item, -10);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "clock", "Elementary", tb_5, ph4);
|
|
|
|
elm_toolbar_item_priority_set(item, 50);
|
|
|
|
|
|
|
|
item = elm_toolbar_item_add(tb, "refresh", "Menu", NULL, NULL);
|
|
|
|
elm_toolbar_item_menu_set(item, 1);
|
|
|
|
elm_toolbar_item_priority_set(item, 999999);
|
|
|
|
elm_toolbar_menu_parent_set(tb, win);
|
|
|
|
menu = elm_toolbar_item_menu_get(item);
|
|
|
|
|
|
|
|
elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
|
|
|
|
menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
|
|
|
|
elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4);
|
|
|
|
elm_menu_item_add(menu, NULL, "edit-delete", "None", tb_5, ph4);
|
|
|
|
|
|
|
|
elm_box_pack_end(bx, tb);
|
|
|
|
evas_object_show(tb);
|
|
|
|
|
|
|
|
tb = elm_table_add(win);
|
|
|
|
//elm_table_homogenous_set(tb, 1);
|
|
|
|
evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
ph = ph1;
|
|
|
|
elm_photo_size_set(ph, 40);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 0, 0, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph2;
|
|
|
|
elm_photo_size_set(ph, 80);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 1, 0, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph3;
|
|
|
|
elm_photo_size_set(ph, 20);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 0, 1, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
ph = ph4;
|
|
|
|
elm_photo_size_set(ph, 60);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR);
|
|
|
|
elm_photo_file_set(ph, buf);
|
|
|
|
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ph, 0.5, 0.5);
|
|
|
|
elm_table_pack(tb, ph, 1, 1, 1, 1);
|
|
|
|
evas_object_show(ph);
|
|
|
|
|
|
|
|
elm_box_pack_end(bx, tb);
|
|
|
|
evas_object_show(tb);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 300);
|
2009-08-13 15:41:43 -07:00
|
|
|
evas_object_show(win);
|
|
|
|
}
|
2009-09-13 21:22:27 -07:00
|
|
|
#endif
|