2010-10-19 13:21:53 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2012-03-29 12:27:13 -07:00
|
|
|
#include <Elementary.h>
|
2013-11-04 00:54:31 -08:00
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2011-10-13 23:05:44 -07:00
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2011-10-13 23:05:44 -07:00
|
|
|
{
|
2012-01-10 21:42:13 -08:00
|
|
|
Evas_Object *ctxpopup_data = evas_object_data_get(obj, "im");
|
|
|
|
if (ctxpopup_data) evas_object_del(ctxpopup_data);
|
2011-10-13 23:05:44 -07:00
|
|
|
evas_object_del(obj);
|
|
|
|
}
|
|
|
|
|
2011-08-28 00:13:04 -07:00
|
|
|
static void
|
|
|
|
_print_current_dir(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Direction dir;
|
|
|
|
dir = elm_ctxpopup_direction_get(obj);
|
|
|
|
|
|
|
|
switch(dir)
|
|
|
|
{
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
|
|
|
printf("ctxpopup direction: left!\n");
|
|
|
|
break;
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
|
|
|
printf("ctxpopup direction: right!\n");
|
|
|
|
break;
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
|
|
|
printf("ctxpopup direction: up!\n");
|
|
|
|
break;
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
|
|
|
printf("ctxpopup direction: down!\n");
|
|
|
|
break;
|
2011-09-14 00:50:05 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UNKNOWN:
|
|
|
|
printf("ctxpopup direction: unknow!\n");
|
2011-08-28 00:13:04 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-20 22:35:22 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_btn_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2011-12-20 22:35:22 -08:00
|
|
|
{
|
|
|
|
printf("Button Clicked\n");
|
2012-01-10 19:00:23 -08:00
|
|
|
|
|
|
|
Evas_Object *im;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
void *ctxpopup_data;
|
|
|
|
|
|
|
|
ctxpopup_data = evas_object_data_get(data, "id");
|
2012-01-10 19:16:50 -08:00
|
|
|
if (!ctxpopup_data) return;
|
2012-01-10 19:00:23 -08:00
|
|
|
|
2012-01-10 19:16:50 -08:00
|
|
|
if (!strcmp("list_item_6", (char *) ctxpopup_data))
|
2012-01-10 19:00:23 -08:00
|
|
|
{
|
|
|
|
ctxpopup_data = evas_object_data_get(data, "im");
|
2012-01-10 19:16:50 -08:00
|
|
|
if (ctxpopup_data) return;
|
2012-01-10 19:00:23 -08:00
|
|
|
|
|
|
|
im = evas_object_image_filled_add(evas_object_evas_get(obj));
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/%s",
|
|
|
|
elm_app_data_dir_get(), "twofish.jpg");
|
|
|
|
evas_object_image_file_set(im, buf, NULL);
|
|
|
|
evas_object_move(im, 40, 40);
|
|
|
|
evas_object_resize(im, 320, 320);
|
|
|
|
evas_object_show(im);
|
|
|
|
evas_object_data_set((Evas_Object *)data, "im", im);
|
|
|
|
|
|
|
|
evas_object_raise((Evas_Object *)data);
|
|
|
|
}
|
2011-12-20 22:35:22 -08:00
|
|
|
}
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_ctxpopup_item_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
|
|
|
printf("ctxpopup item selected: %s\n",
|
2011-11-16 18:16:38 -08:00
|
|
|
elm_object_item_text_get(event_info));
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
2013-07-05 11:04:20 -07:00
|
|
|
static Elm_Object_Item *
|
|
|
|
_ctxpopup_item_new(Evas_Object *obj, const char *label, const char *icon)
|
|
|
|
{
|
|
|
|
Evas_Object *ic = NULL;
|
|
|
|
Elm_Object_Item *it = NULL;
|
|
|
|
|
|
|
|
if (!obj) return NULL;
|
|
|
|
|
|
|
|
if (icon)
|
|
|
|
{
|
|
|
|
ic = elm_icon_add(obj);
|
|
|
|
elm_icon_standard_set(ic, icon);
|
|
|
|
elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
it = elm_ctxpopup_item_append(obj, label, ic, _ctxpopup_item_cb, NULL);
|
|
|
|
return it;
|
|
|
|
}
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_item_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2013-07-05 11:04:20 -07:00
|
|
|
Evas_Object *ctxpopup;
|
|
|
|
Elm_Object_Item *it = NULL;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord x,y;
|
|
|
|
|
|
|
|
ctxpopup = elm_ctxpopup_add(obj);
|
2013-06-25 17:35:55 -07:00
|
|
|
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2013-07-05 11:04:20 -07:00
|
|
|
_ctxpopup_item_new(ctxpopup, "Go to home folder", "home");
|
|
|
|
_ctxpopup_item_new(ctxpopup, "Save file", "file");
|
|
|
|
_ctxpopup_item_new(ctxpopup, "Delete file", "delete");
|
|
|
|
it = _ctxpopup_item_new(ctxpopup, "Navigate to folder", "folder");
|
2011-11-16 18:16:38 -08:00
|
|
|
elm_object_item_disabled_set(it, EINA_TRUE);
|
2013-07-05 11:04:20 -07:00
|
|
|
_ctxpopup_item_new(ctxpopup, "Edit entry", "edit");
|
|
|
|
it = _ctxpopup_item_new(ctxpopup, "Set date and time", "clock");
|
2011-11-16 18:16:38 -08:00
|
|
|
elm_object_item_disabled_set(it, EINA_TRUE);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2011-06-13 04:26:08 -07:00
|
|
|
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_size_hint_max_set(ctxpopup, 240, 240);
|
|
|
|
evas_object_move(ctxpopup, x, y);
|
|
|
|
evas_object_show(ctxpopup);
|
2011-08-28 00:13:04 -07:00
|
|
|
_print_current_dir(ctxpopup);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_item_cb2(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2013-07-05 11:04:20 -07:00
|
|
|
Evas_Object *ctxpopup;
|
|
|
|
Elm_Object_Item *it = NULL;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord x,y;
|
|
|
|
|
|
|
|
ctxpopup = elm_ctxpopup_add(obj);
|
2013-06-25 17:35:55 -07:00
|
|
|
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2013-07-05 11:04:20 -07:00
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "home");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "file");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "delete");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "folder");
|
|
|
|
it = _ctxpopup_item_new(ctxpopup, NULL, "edit");
|
2011-11-16 18:16:38 -08:00
|
|
|
elm_object_item_disabled_set(it, EINA_TRUE);
|
2013-07-05 11:04:20 -07:00
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "clock");
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2011-06-13 04:26:08 -07:00
|
|
|
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_size_hint_max_set(ctxpopup, 240, 240);
|
|
|
|
evas_object_move(ctxpopup, x, y);
|
|
|
|
evas_object_show(ctxpopup);
|
2011-08-28 00:13:04 -07:00
|
|
|
_print_current_dir(ctxpopup);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_item_cb3(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2013-07-05 11:04:20 -07:00
|
|
|
Evas_Object *ctxpopup;
|
|
|
|
Elm_Object_Item *it = NULL;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord x,y;
|
|
|
|
|
|
|
|
ctxpopup = elm_ctxpopup_add(obj);
|
2013-06-25 17:35:55 -07:00
|
|
|
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2013-07-05 11:04:20 -07:00
|
|
|
_ctxpopup_item_new(ctxpopup, "Eina", NULL);
|
|
|
|
_ctxpopup_item_new(ctxpopup, "Eet", NULL);
|
|
|
|
_ctxpopup_item_new(ctxpopup, "Evas", NULL);
|
|
|
|
it = _ctxpopup_item_new(ctxpopup, "Ecore", NULL);
|
2011-11-16 18:16:38 -08:00
|
|
|
elm_object_item_disabled_set(it, EINA_TRUE);
|
2013-07-05 11:04:20 -07:00
|
|
|
_ctxpopup_item_new(ctxpopup, "Embryo", NULL);
|
|
|
|
_ctxpopup_item_new(ctxpopup, "Edje", NULL);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2011-06-13 04:26:08 -07:00
|
|
|
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_move(ctxpopup, x, y);
|
|
|
|
evas_object_show(ctxpopup);
|
2011-08-28 00:13:04 -07:00
|
|
|
_print_current_dir(ctxpopup);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_item_cb4(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2013-07-05 11:04:20 -07:00
|
|
|
Evas_Object *ctxpopup;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord x,y;
|
|
|
|
|
|
|
|
ctxpopup = elm_ctxpopup_add(obj);
|
2013-06-25 17:35:55 -07:00
|
|
|
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
|
2011-10-13 23:05:44 -07:00
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
elm_ctxpopup_horizontal_set(ctxpopup, EINA_TRUE);
|
|
|
|
|
2013-07-05 11:04:20 -07:00
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "home");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "file");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "delete");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "folder");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "edit");
|
|
|
|
_ctxpopup_item_new(ctxpopup, NULL, "clock");
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2011-06-13 04:26:08 -07:00
|
|
|
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_size_hint_max_set(ctxpopup, 240, 240);
|
|
|
|
evas_object_move(ctxpopup, x, y);
|
|
|
|
evas_object_show(ctxpopup);
|
2011-08-28 00:13:04 -07:00
|
|
|
_print_current_dir(ctxpopup);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_item_cb5(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2011-02-03 00:23:19 -08:00
|
|
|
Evas_Object *ctxpopup, *btn, *sc, *bx;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord x,y;
|
|
|
|
|
2011-02-03 00:23:19 -08:00
|
|
|
bx = elm_box_add(obj);
|
|
|
|
evas_object_size_hint_min_set(bx, 150, 150);
|
|
|
|
|
|
|
|
sc = elm_scroller_add(bx);
|
|
|
|
elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
|
|
|
|
evas_object_size_hint_fill_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(sc);
|
|
|
|
|
|
|
|
btn = elm_button_add(sc);
|
2011-06-29 00:11:54 -07:00
|
|
|
elm_object_text_set(btn, "Enlightenment");
|
2011-02-03 00:23:19 -08:00
|
|
|
evas_object_size_hint_min_set(btn, 140, 140);
|
|
|
|
|
2011-10-30 19:56:03 -07:00
|
|
|
elm_object_content_set(sc, btn);
|
2011-02-03 00:23:19 -08:00
|
|
|
|
|
|
|
elm_box_pack_end(bx, sc);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
ctxpopup = elm_ctxpopup_add(obj);
|
2013-06-25 17:35:55 -07:00
|
|
|
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
|
2011-10-13 23:05:44 -07:00
|
|
|
|
2011-08-03 02:32:15 -07:00
|
|
|
elm_object_content_set(ctxpopup, bx);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2011-06-13 04:26:08 -07:00
|
|
|
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_move(ctxpopup, x, y);
|
|
|
|
evas_object_show(ctxpopup);
|
2011-08-28 00:13:04 -07:00
|
|
|
_print_current_dir(ctxpopup);
|
2011-12-20 22:35:22 -08:00
|
|
|
|
2012-06-10 00:50:27 -07:00
|
|
|
evas_object_data_set(ctxpopup, "id", "list_item_5");
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_clicked, ctxpopup);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2012-01-10 19:00:23 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_item_cb6(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2012-01-10 19:00:23 -08:00
|
|
|
{
|
|
|
|
Evas_Object *ctxpopup, *btn, *sc, *bx;
|
|
|
|
Evas_Coord x,y;
|
|
|
|
|
|
|
|
bx = elm_box_add(obj);
|
|
|
|
evas_object_size_hint_min_set(bx, 200, 150);
|
|
|
|
|
|
|
|
sc = elm_scroller_add(bx);
|
|
|
|
elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
|
|
|
|
evas_object_size_hint_fill_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(sc);
|
|
|
|
|
|
|
|
btn = elm_button_add(sc);
|
|
|
|
elm_object_text_set(btn, "Ctxpop will be on the top of layer");
|
|
|
|
evas_object_size_hint_min_set(btn, 190, 140);
|
|
|
|
|
|
|
|
elm_object_content_set(sc, btn);
|
|
|
|
|
|
|
|
elm_box_pack_end(bx, sc);
|
|
|
|
|
|
|
|
ctxpopup = elm_ctxpopup_add(obj);
|
2013-06-25 17:35:55 -07:00
|
|
|
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
|
2012-01-10 19:00:23 -08:00
|
|
|
|
|
|
|
elm_object_content_set(ctxpopup, bx);
|
|
|
|
|
|
|
|
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
|
|
|
|
evas_object_move(ctxpopup, x, y);
|
|
|
|
evas_object_show(ctxpopup);
|
|
|
|
_print_current_dir(ctxpopup);
|
|
|
|
|
|
|
|
evas_object_data_set(ctxpopup, "id", "list_item_6");
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_clicked, ctxpopup);
|
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2013-01-18 01:07:03 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_ctxpopup_item_disable_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2013-01-18 01:07:03 -08:00
|
|
|
{
|
|
|
|
printf("ctxpopup item selected: %s\n",
|
|
|
|
elm_object_item_text_get(event_info));
|
|
|
|
|
2013-01-18 01:46:33 -08:00
|
|
|
elm_object_item_disabled_set(event_info, EINA_TRUE);
|
2013-01-18 01:07:03 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_ctxpopup_item_delete_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
|
2013-01-18 01:07:03 -08:00
|
|
|
{
|
|
|
|
printf("ctxpopup item selected: %s\n",
|
|
|
|
elm_object_item_text_get(event_info));
|
|
|
|
|
|
|
|
evas_object_del(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_item_cb7(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2013-01-18 01:07:03 -08:00
|
|
|
{
|
|
|
|
Evas_Object *ctxpopup;
|
|
|
|
Evas_Coord x,y;
|
|
|
|
|
|
|
|
ctxpopup = elm_ctxpopup_add(obj);
|
2013-06-25 17:35:55 -07:00
|
|
|
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
|
2013-01-18 01:07:03 -08:00
|
|
|
|
|
|
|
elm_ctxpopup_item_append(ctxpopup, "Disable this item", NULL, _ctxpopup_item_disable_cb, ctxpopup);
|
|
|
|
elm_ctxpopup_item_append(ctxpopup, "Delete this ctxpopup", NULL, _ctxpopup_item_delete_cb, ctxpopup);
|
|
|
|
elm_ctxpopup_item_append(ctxpopup, "Another item", NULL, _ctxpopup_item_cb, NULL);
|
|
|
|
|
|
|
|
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
|
|
|
|
evas_object_size_hint_max_set(ctxpopup, 240, 240);
|
|
|
|
evas_object_move(ctxpopup, x, y);
|
|
|
|
evas_object_show(ctxpopup);
|
|
|
|
_print_current_dir(ctxpopup);
|
|
|
|
}
|
|
|
|
|
2013-08-31 18:18:03 -07:00
|
|
|
static void _list_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
|
|
|
elm_list_item_selected_set(event_info, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-08-31 18:18:03 -07:00
|
|
|
test_ctxpopup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-04-01 23:20:28 -07:00
|
|
|
Evas_Object *win, *list;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-04-01 23:20:28 -07:00
|
|
|
win = elm_win_util_standard_add("contextual-popup", "Contextual Popup");
|
2010-10-19 13:21:53 -07:00
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
|
|
|
|
|
|
|
list = elm_list_add(win);
|
2011-08-13 20:36:56 -07:00
|
|
|
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2012-11-14 02:49:45 -08:00
|
|
|
elm_win_resize_object_add(win, list);
|
2010-10-19 13:21:53 -07:00
|
|
|
elm_list_mode_set(list, ELM_LIST_COMPRESS);
|
|
|
|
evas_object_smart_callback_add(list, "selected", _list_clicked, NULL);
|
|
|
|
|
2010-11-30 22:52:46 -08:00
|
|
|
elm_list_item_append(list, "Ctxpopup with icons and labels", NULL, NULL,
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
_list_item_cb, NULL);
|
2010-11-30 22:52:46 -08:00
|
|
|
elm_list_item_append(list, "Ctxpopup with icons only", NULL, NULL,
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
_list_item_cb2, NULL);
|
|
|
|
elm_list_item_append(list, "Ctxpopup with labels only", NULL, NULL,
|
|
|
|
_list_item_cb3, NULL);
|
2010-11-30 22:52:46 -08:00
|
|
|
elm_list_item_append(list, "Ctxpopup at horizontal mode", NULL, NULL,
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
_list_item_cb4, NULL);
|
|
|
|
elm_list_item_append(list, "Ctxpopup with user content", NULL, NULL,
|
|
|
|
_list_item_cb5, NULL);
|
2012-01-10 19:00:23 -08:00
|
|
|
elm_list_item_append(list, "Ctxpopup with restacking", NULL, NULL,
|
|
|
|
_list_item_cb6, NULL);
|
2013-01-18 01:07:03 -08:00
|
|
|
elm_list_item_append(list, "Ctxpopup with callback function", NULL, NULL,
|
|
|
|
_list_item_cb7, NULL);
|
2010-10-19 13:21:53 -07:00
|
|
|
evas_object_show(list);
|
|
|
|
elm_list_go(list);
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_resize(win, 400, 400);
|
2010-10-19 13:21:53 -07:00
|
|
|
evas_object_show(win);
|
|
|
|
}
|