forked from enlightenment/efl
From: Hyoyoung Chang <hyoyoung@gmail.com>
Subject: [E-devel] [patch] elm_list - add select_mode_set and some remove deprecated apis in examples Like other widget (genlist, gengrid...), I add select_mode to elm_list. +elm_list_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode_Type mode) +EAPI Elm_Object_Select_Mode_Type +elm_list_select_mode_get(const Evas_Object *obj) And I removed deprecated apis (no_select, always_select) in examples and edje_externals. SVN revision: 68971
This commit is contained in:
parent
04cca27789
commit
abe3dd222a
|
@ -43,9 +43,19 @@ external_gengrid_state_set(void *data __UNUSED__, Evas_Object *obj, const void *
|
|||
if (p->multi_exists)
|
||||
elm_gengrid_multi_select_set(obj, p->multi);
|
||||
if (p->no_select_exists)
|
||||
elm_gengrid_no_select_mode_set (obj, p->no_select);
|
||||
{
|
||||
if (p->no_select)
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_NO_SELECT);
|
||||
else
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
if (p->always_select_exists)
|
||||
elm_gengrid_always_select_mode_set (obj, p->always_select);
|
||||
{
|
||||
if (p->always_select)
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
if (p->h_bounce_exists)
|
||||
{
|
||||
Eina_Bool h_bounce, v_bounce;
|
||||
|
@ -112,7 +122,10 @@ external_gengrid_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
elm_gengrid_no_select_mode_set(obj, param->i);
|
||||
if (param->i)
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_NO_SELECT);
|
||||
else
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +133,10 @@ external_gengrid_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
elm_gengrid_always_select_mode_set(obj, param->i);
|
||||
if (param->i)
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_gengrid_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +245,11 @@ external_gengrid_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
param->i = elm_gengrid_no_select_mode_get(obj);
|
||||
if (elm_gengrid_select_mode_get (obj) ==
|
||||
ELM_OBJECT_NO_SELECT)
|
||||
param->i = EINA_TRUE;
|
||||
else
|
||||
param->i = EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +257,11 @@ external_gengrid_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
param->i = elm_gengrid_always_select_mode_get(obj);
|
||||
if (elm_gengrid_select_mode_get (obj) ==
|
||||
ELM_OBJECT_ALWAYS_SELECT)
|
||||
param->i = EINA_TRUE;
|
||||
else
|
||||
param->i = EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,10 +57,20 @@ external_genlist_state_set(void *data __UNUSED__, Evas_Object *obj, const void *
|
|||
}
|
||||
if (p->multi_exists)
|
||||
elm_genlist_multi_select_set(obj, p->multi);
|
||||
if (p->always_select_exists)
|
||||
elm_genlist_always_select_mode_set(obj, p->always_select);
|
||||
if (p->no_select_exists)
|
||||
elm_genlist_no_select_mode_set(obj, p->no_select);
|
||||
{
|
||||
if (p->no_select)
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_NO_SELECT);
|
||||
else
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
if (p->always_select_exists)
|
||||
{
|
||||
if (p->always_select)
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
if (p->compress_exists)
|
||||
elm_genlist_compress_mode_set(obj, p->compress);
|
||||
if (p->homogeneous_exists)
|
||||
|
@ -105,7 +115,10 @@ external_genlist_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
elm_genlist_always_select_mode_set(obj, param->i);
|
||||
if (param->i)
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +126,10 @@ external_genlist_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
elm_genlist_no_select_mode_set(obj, param->i);
|
||||
if (param->i)
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_NO_SELECT);
|
||||
else
|
||||
elm_genlist_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +204,11 @@ external_genlist_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
param->i = elm_genlist_always_select_mode_get(obj);
|
||||
if (elm_genlist_select_mode_get (obj) ==
|
||||
ELM_OBJECT_ALWAYS_SELECT)
|
||||
param->i = EINA_TRUE;
|
||||
else
|
||||
param->i = EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +216,11 @@ external_genlist_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
param->i = elm_genlist_no_select_mode_get(obj);
|
||||
if (elm_genlist_select_mode_get (obj) ==
|
||||
ELM_OBJECT_NO_SELECT)
|
||||
param->i = EINA_TRUE;
|
||||
else
|
||||
param->i = EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,12 @@ external_list_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fro
|
|||
if (p->multi_exists)
|
||||
elm_list_multi_select_set(obj, p->multi);
|
||||
if (p->always_select_exists)
|
||||
elm_list_always_select_mode_set(obj, p->always_select);
|
||||
{
|
||||
if (p->always_select)
|
||||
elm_list_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_list_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -148,7 +153,10 @@ external_list_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Exte
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
elm_list_always_select_mode_set(obj, param->i);
|
||||
if (param->i)
|
||||
elm_list_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_list_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +190,11 @@ external_list_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_Exte
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
param->i = elm_list_always_select_mode_get(obj);
|
||||
if (elm_list_select_mode_get (obj) ==
|
||||
ELM_OBJECT_ALWAYS_SELECT)
|
||||
param->i = EINA_TRUE;
|
||||
else
|
||||
param->i = EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,10 +52,20 @@ external_toolbar_state_set(void *data __UNUSED__, Evas_Object *obj, const void *
|
|||
elm_toolbar_icon_size_set(obj, p->icon_size);
|
||||
if (p->align_exists)
|
||||
elm_toolbar_align_set(obj, p->align);
|
||||
if (p->always_select_exists)
|
||||
elm_toolbar_always_select_mode_set(obj, p->always_select);
|
||||
if (p->no_select_exists)
|
||||
elm_toolbar_no_select_mode_set(obj, p->no_select);
|
||||
{
|
||||
if (p->no_select)
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_NO_SELECT);
|
||||
else
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
if (p->always_select_exists)
|
||||
{
|
||||
if (p->always_select)
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
if (p->horizontal_exists)
|
||||
elm_toolbar_horizontal_set(obj, p->horizontal);
|
||||
if (p->homogeneous_exists)
|
||||
|
@ -92,7 +102,10 @@ external_toolbar_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
elm_toolbar_always_select_mode_set(obj, param->i);
|
||||
if (param->i)
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +113,10 @@ external_toolbar_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
elm_toolbar_no_select_mode_set(obj, param->i);
|
||||
if (param->i)
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_NO_SELECT);
|
||||
else
|
||||
elm_toolbar_select_mode_set (obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +175,11 @@ external_toolbar_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
param->d = elm_toolbar_always_select_mode_get(obj);
|
||||
if (elm_toolbar_select_mode_get (obj) ==
|
||||
ELM_OBJECT_ALWAYS_SELECT)
|
||||
param->d = EINA_TRUE;
|
||||
else
|
||||
param->d = EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +187,11 @@ external_toolbar_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||
{
|
||||
param->i = elm_toolbar_no_select_mode_get(obj);
|
||||
if (elm_toolbar_select_mode_get (obj) ==
|
||||
ELM_OBJECT_NO_SELECT)
|
||||
param->i = EINA_TRUE;
|
||||
else
|
||||
param->i = EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,10 @@ _always_select_change(void *data,
|
|||
Evas_Object *grid = data;
|
||||
Eina_Bool always = elm_check_state_get(obj);
|
||||
|
||||
elm_gengrid_always_select_mode_set(grid, always);
|
||||
if (always)
|
||||
elm_gengrid_select_mode_set(grid, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
elm_gengrid_select_mode_set(grid, ELM_OBJECT_NORMAL_SELECT);
|
||||
|
||||
fprintf(stdout, "\"Always select\" mode for gengrid items is now %s\n",
|
||||
always ? "on" : "off");
|
||||
|
@ -122,7 +125,10 @@ _no_sel_change(void *data,
|
|||
Evas_Object *grid = data;
|
||||
Eina_Bool no_sel = elm_check_state_get(obj);
|
||||
|
||||
elm_gengrid_no_select_mode_set(grid, no_sel);
|
||||
if (no_sel)
|
||||
elm_gengrid_select_mode_set(grid, ELM_OBJECT_NO_SELECT);
|
||||
else
|
||||
elm_gengrid_select_mode_set(grid, ELM_OBJECT_NORMAL_SELECT);
|
||||
|
||||
fprintf(stdout, "Selection for gengrid items is now %s\n",
|
||||
no_sel ? "disabled" : "enabled");
|
||||
|
|
|
@ -124,11 +124,19 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
|
|||
_itc->func.del = NULL;
|
||||
}
|
||||
|
||||
Eina_Bool hbounce, vbounce;
|
||||
Eina_Bool hbounce, vbounce, always, no_sel;
|
||||
Elm_Scroller_Policy hp, vp;
|
||||
Elm_Object_Select_Mode_Type sel_mode;
|
||||
|
||||
always = no_sel = EINA_FALSE;
|
||||
sel_mode = elm_genlist_select_mode_get(list);
|
||||
if (sel_mode = ELM_OBJECT_ALWAYS_SELECT)
|
||||
always = EINA_TRUE;
|
||||
else if (sel_mode = ELM_OBJECT_NO_SELECT)
|
||||
no_sel = EINA_TRUE;
|
||||
|
||||
printf("default values:\n");
|
||||
printf("always select: %d\n", elm_genlist_always_select_mode_get(list));
|
||||
printf("always select: %d\n", always);
|
||||
elm_genlist_bounce_get(list, &hbounce, &vbounce);
|
||||
printf("bounce - horizontal: %d, vertical: %d\n", hbounce, vbounce);
|
||||
printf("compress mode: %d\n", elm_genlist_compress_mode_get(list));
|
||||
|
@ -137,7 +145,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
|
|||
printf("longpress timeout: %0.3f\n",
|
||||
elm_genlist_longpress_timeout_get(list));
|
||||
printf("multi selection: %d\n", elm_genlist_multi_select_get(list));
|
||||
printf("no selection mode: %d\n", elm_genlist_no_select_mode_get(list));
|
||||
printf("no selection mode: %d\n", no_sel);
|
||||
printf("height for width enabled: %d\n",
|
||||
elm_genlist_height_for_width_mode_get(list));
|
||||
elm_genlist_scroller_policy_get(list, &hp, &vp);
|
||||
|
@ -145,13 +153,12 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
|
|||
printf("block count: %d\n", elm_genlist_block_count_get(list));
|
||||
printf("\n");
|
||||
|
||||
elm_genlist_always_select_mode_set(list, EINA_FALSE);
|
||||
elm_genlist_bounce_set(list, EINA_FALSE, EINA_FALSE);
|
||||
elm_genlist_compress_mode_set(list, EINA_TRUE);
|
||||
elm_genlist_homogeneous_set(list, EINA_FALSE);
|
||||
elm_genlist_mode_set(list, ELM_LIST_LIMIT);
|
||||
elm_genlist_multi_select_set(list, EINA_TRUE);
|
||||
elm_genlist_no_select_mode_set(list, EINA_FALSE);
|
||||
elm_genlist_select_mode_set(list, ELM_OBJECT_NORMAL_SELECT);
|
||||
elm_genlist_height_for_width_mode_set(list, EINA_FALSE);
|
||||
elm_genlist_scroller_policy_set(list, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON);
|
||||
elm_genlist_longpress_timeout_set(list, 0.5);
|
||||
|
|
|
@ -69,7 +69,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
|
|||
|
||||
/* enable multiple selection and always select */
|
||||
elm_list_multi_select_set(li, EINA_TRUE);
|
||||
elm_list_always_select_mode_set(li, EINA_TRUE);
|
||||
elm_list_select_mode_set(li, ELM_OBJECT_ALWAYS_SELECT);
|
||||
|
||||
/* set bounce and scroller policy */
|
||||
elm_list_bounce_set(li, EINA_TRUE, EINA_TRUE);
|
||||
|
|
|
@ -570,7 +570,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
|
|||
|
||||
tabs = elm_toolbar_add(win);
|
||||
elm_toolbar_align_set(tabs, 0.0);
|
||||
elm_toolbar_always_select_mode_set(tabs, EINA_TRUE);
|
||||
elm_toolbar_select_mode_set(tabs, ELM_OBJECT_ALWAYS_SELECT);
|
||||
elm_toolbar_homogeneous_set(tabs, EINA_FALSE);
|
||||
elm_toolbar_shrink_mode_set(tabs, ELM_TOOLBAR_SHRINK_MENU);
|
||||
evas_object_size_hint_weight_set(tabs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
|
|
@ -6078,6 +6078,43 @@ EINA_DEPRECATED EAPI void elm_clock_digit_edit_set(Evas_Object *obj
|
|||
*/
|
||||
EINA_DEPRECATED EAPI Elm_Clock_Edit_Mode elm_clock_digit_edit_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Enable or disable always select mode on the list object.
|
||||
*
|
||||
* @param obj The list object
|
||||
* @param always_select @c EINA_TRUE to enable always select mode or
|
||||
* @c EINA_FALSE to disable it.
|
||||
*
|
||||
* @note Always select mode is disabled by default.
|
||||
*
|
||||
* Default behavior of list items is to only call its callback function
|
||||
* the first time it's pressed, i.e., when it is selected. If a selected
|
||||
* item is pressed again, and multi-select is disabled, it won't call
|
||||
* this function (if multi-select is enabled it will unselect the item).
|
||||
*
|
||||
* If always select is enabled, it will call the callback function
|
||||
* every time a item is pressed, so it will call when the item is selected,
|
||||
* and again when a selected item is pressed.
|
||||
*
|
||||
* @deprecated elm_list_always_select_mode_set()
|
||||
*/
|
||||
EINA_DEPRECATED EAPI void elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
|
||||
|
||||
/**
|
||||
* Get a value whether always select mode is enabled or not, meaning that
|
||||
* an item will always call its callback function, even if already selected.
|
||||
*
|
||||
* @param obj The list object
|
||||
* @return @c EINA_TRUE means horizontal mode selection is enabled.
|
||||
* @c EINA_FALSE indicates it's disabled. If @p obj is @c NULL,
|
||||
* @c EINA_FALSE is returned.
|
||||
*
|
||||
* @see elm_list_always_select_mode_set() for details.
|
||||
*
|
||||
* @deprecated elm_list_always_select_mode_get()
|
||||
*/
|
||||
EINA_DEPRECATED EAPI Eina_Bool elm_list_always_select_mode_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -15,18 +15,18 @@ struct _Widget_Data
|
|||
Elm_List_Mode mode;
|
||||
Elm_List_Mode h_mode;
|
||||
Evas_Coord minw[2], minh[2];
|
||||
Eina_Bool scr_minw : 1;
|
||||
Eina_Bool scr_minh : 1;
|
||||
Elm_Object_Select_Mode_Type select_mode;
|
||||
int walking;
|
||||
int movements;
|
||||
struct {
|
||||
Evas_Coord x, y;
|
||||
} history[SWIPE_MOVES];
|
||||
Eina_Bool scr_minw : 1;
|
||||
Eina_Bool scr_minh : 1;
|
||||
Eina_Bool swipe : 1;
|
||||
Eina_Bool fix_pending : 1;
|
||||
Eina_Bool on_hold : 1;
|
||||
Eina_Bool multi : 1;
|
||||
Eina_Bool always_select : 1;
|
||||
Eina_Bool longpressed : 1;
|
||||
Eina_Bool wasselected : 1;
|
||||
};
|
||||
|
@ -702,7 +702,8 @@ _item_highlight(Elm_List_Item *it)
|
|||
|
||||
if (!wd) return;
|
||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||
if ((it->highlighted) || (it->base.disabled)) return;
|
||||
if ((it->highlighted) || (it->base.disabled) ||
|
||||
(wd->select_mode == ELM_OBJECT_NO_SELECT)) return;
|
||||
|
||||
evas_object_ref(obj);
|
||||
_elm_list_walk(wd);
|
||||
|
@ -725,10 +726,10 @@ _item_select(Elm_List_Item *it)
|
|||
|
||||
if (!wd) return;
|
||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||
if (it->base.disabled) return;
|
||||
if (it->base.disabled || (wd->select_mode == ELM_OBJECT_NO_SELECT)) return;
|
||||
if (it->selected)
|
||||
{
|
||||
if (wd->always_select) goto call;
|
||||
if (wd->select_mode == ELM_OBJECT_ALWAYS_SELECT) goto call;
|
||||
return;
|
||||
}
|
||||
it->selected = EINA_TRUE;
|
||||
|
@ -1622,21 +1623,53 @@ elm_list_horizontal_get(const Evas_Object *obj)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select)
|
||||
elm_list_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode_Type mode)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
wd->always_select = always_select;
|
||||
if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
|
||||
return;
|
||||
if (wd->select_mode != mode)
|
||||
wd->select_mode = mode;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
EAPI Elm_Object_Select_Mode_Type
|
||||
elm_list_select_mode_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) ELM_OBJECT_SELECT_MODE_MAX;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return ELM_OBJECT_SELECT_MODE_MAX;
|
||||
return wd->select_mode;
|
||||
}
|
||||
|
||||
EINA_DEPRECATED EAPI void
|
||||
elm_list_always_select_mode_set(Evas_Object *obj,
|
||||
Eina_Bool always_select)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (always_select)
|
||||
elm_list_select_mode_set(obj, ELM_OBJECT_ALWAYS_SELECT);
|
||||
else
|
||||
{
|
||||
Elm_Object_Select_Mode_Type oldmode = elm_list_select_mode_get(obj);
|
||||
if (oldmode == ELM_OBJECT_ALWAYS_SELECT)
|
||||
elm_list_select_mode_set(obj, ELM_OBJECT_NORMAL_SELECT);
|
||||
}
|
||||
}
|
||||
|
||||
EINA_DEPRECATED EAPI Eina_Bool
|
||||
elm_list_always_select_mode_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return EINA_FALSE;
|
||||
return wd->always_select;
|
||||
Elm_Object_Select_Mode_Type oldmode = elm_list_select_mode_get(obj);
|
||||
if (oldmode == ELM_OBJECT_ALWAYS_SELECT)
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -221,44 +221,41 @@ EAPI void elm_list_horizontal_set(Evas_Object *obj, Eina
|
|||
EAPI Eina_Bool elm_list_horizontal_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Enable or disable always select mode on the list object.
|
||||
* Set the list select mode.
|
||||
*
|
||||
* @param obj The list object
|
||||
* @param always_select @c EINA_TRUE to enable always select mode or
|
||||
* @c EINA_FALSE to disable it.
|
||||
* @param mode The select mode
|
||||
*
|
||||
* @note Always select mode is disabled by default.
|
||||
* elm_list_select_mode_set() changes item select mode in the list widget.
|
||||
* - ELM_OBJECT_NORMAL_SELECT : Items will only call their selection func and
|
||||
* callback when first becoming selected. Any further clicks will
|
||||
* do nothing, unless you set always select mode.
|
||||
* - ELM_OBJECT_ALWAYS_SELECT : This means that, even if selected,
|
||||
* every click will make the selected callbacks be called.
|
||||
* - ELM_OBJECT_NO_SELECT : This will turn off the ability to select items
|
||||
* entirely and they will neither appear selected nor call selected
|
||||
* callback functions.
|
||||
*
|
||||
* Default behavior of list items is to only call its callback function
|
||||
* the first time it's pressed, i.e., when it is selected. If a selected
|
||||
* item is pressed again, and multi-select is disabled, it won't call
|
||||
* this function (if multi-select is enabled it will unselect the item).
|
||||
*
|
||||
* If always select is enabled, it will call the callback function
|
||||
* every time a item is pressed, so it will call when the item is selected,
|
||||
* and again when a selected item is pressed.
|
||||
*
|
||||
* @see elm_list_always_select_mode_get()
|
||||
* @see elm_list_multi_select_set()
|
||||
* @see elm_list_select_mode_get()
|
||||
*
|
||||
* @ingroup List
|
||||
*/
|
||||
EAPI void elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
|
||||
EAPI void
|
||||
elm_list_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode_Type mode);
|
||||
|
||||
/**
|
||||
* Get a value whether always select mode is enabled or not, meaning that
|
||||
* an item will always call its callback function, even if already selected.
|
||||
* Get the list select mode.
|
||||
*
|
||||
* @param obj The list object
|
||||
* @return @c EINA_TRUE means horizontal mode selection is enabled.
|
||||
* @c EINA_FALSE indicates it's disabled. If @p obj is @c NULL,
|
||||
* @c EINA_FALSE is returned.
|
||||
* @return The select mode
|
||||
* (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
|
||||
*
|
||||
* @see elm_list_always_select_mode_set() for details.
|
||||
* @see elm_list_select_mode_set()
|
||||
*
|
||||
* @ingroup List
|
||||
*/
|
||||
EAPI Eina_Bool elm_list_always_select_mode_get(const Evas_Object *obj);
|
||||
EAPI Elm_Object_Select_Mode_Type
|
||||
elm_list_select_mode_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Set bouncing behaviour when the scrolled content reaches an edge.
|
||||
|
|
Loading…
Reference in New Issue