forked from enlightenment/efl
elementary/fileselector_button, fileselector_entry, spinner - support language,changed callback.
This commit is contained in:
parent
b802b93b55
commit
fd772a71eb
|
@ -1289,3 +1289,8 @@
|
|||
* Support language change for widget items (Ctxpopup, Hoversel,
|
||||
Naviframe, Diskselector, List, Menu, Segment_Control, Toolbar, Popup,
|
||||
MultibuttonEntry)
|
||||
|
||||
2013-04-23 ChunEon Park
|
||||
|
||||
* Support language,changed callback (Fileselector_Button,
|
||||
Fileselector Entry, Spinner
|
||||
|
|
|
@ -63,6 +63,7 @@ Additions:
|
|||
* Add the feature for key events.
|
||||
* Add elm_access_action(), elm_access_action_cb_set()
|
||||
* Add elm_object_domain_part_text_translatable_set(), elm_object_item_domain_part_text_translatable_set().
|
||||
* Support language,changed callback (Fileselector_Button, Fileselector Entry, Spinner.
|
||||
|
||||
Improvements:
|
||||
|
||||
|
|
|
@ -11,11 +11,22 @@ EAPI Eo_Op ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID = EO_NOOP;
|
|||
#define DEFAULT_WINDOW_TITLE "Select a file"
|
||||
|
||||
static const char SIG_FILE_CHOSEN[] = "file,chosen";
|
||||
static const char SIG_LANG_CHANGED[] = "language,changed";
|
||||
|
||||
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
||||
{SIG_FILE_CHOSEN, "s"},
|
||||
{SIG_LANG_CHANGED, ""},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static void
|
||||
_elm_fileselector_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_fileselector_button_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
{
|
||||
|
@ -492,6 +503,7 @@ _class_constructor(Eo_Class *klass)
|
|||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_fileselector_button_smart_del),
|
||||
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_button_smart_theme),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_fileselector_smart_translate),
|
||||
|
||||
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _elm_fileselector_button_smart_admits_autorepeat_get),
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
* - @c "file,chosen" - the user has selected a path, whose string
|
||||
* pointer comes as the @c event_info data (a stringshared
|
||||
* string)
|
||||
* - @c "language,changed" - the program's language changed
|
||||
*
|
||||
* Default text parts of the fileselector_button widget that you can use for
|
||||
* are:
|
||||
|
|
|
@ -25,6 +25,8 @@ static const char SIG_SELECTION_COPY[] = "selection,copy";
|
|||
static const char SIG_SELECTION_CUT[] = "selection,cut";
|
||||
static const char SIG_UNPRESSED[] = "unpressed";
|
||||
static const char SIG_FILE_CHOSEN[] = "file,chosen";
|
||||
static const char SIG_LANG_CHANGED[] = "language,changed";
|
||||
|
||||
static const Evas_Smart_Cb_Description _smart_callbacks[] =
|
||||
{
|
||||
{SIG_CHANGED, ""},
|
||||
|
@ -40,6 +42,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
|
|||
{SIG_SELECTION_CUT, ""},
|
||||
{SIG_UNPRESSED, ""},
|
||||
{SIG_FILE_CHOSEN, "s"},
|
||||
{SIG_LANG_CHANGED, ""},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
@ -93,6 +96,14 @@ _ACTIVATED_fwd(void *data,
|
|||
evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_fileselector_entry_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_fileselector_entry_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||
{
|
||||
|
@ -724,6 +735,7 @@ _class_constructor(Eo_Class *klass)
|
|||
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_fileselector_entry_smart_disable),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_entry_smart_theme),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_fileselector_entry_smart_translate),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_fileselector_entry_smart_focus_next_manager_is),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_fileselector_entry_smart_focus_next),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_fileselector_entry_smart_focus_direction_manager_is),
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
* - @c "file,chosen" - The user has selected a path via the file
|
||||
* selector entry's internal file selector, whose string pointer
|
||||
* comes as the @c event_info data (a stringshared string)
|
||||
* - @c "language,changed" - the program's language changed
|
||||
*
|
||||
* Default text parts of the fileselector_button widget that you can use for
|
||||
* are:
|
||||
|
|
|
@ -13,12 +13,23 @@ EAPI Eo_Op ELM_OBJ_SPINNER_BASE_ID = EO_NOOP;
|
|||
|
||||
static const char SIG_CHANGED[] = "changed";
|
||||
static const char SIG_DELAY_CHANGED[] = "delay,changed";
|
||||
static const char SIG_LANG_CHANGED[] = "language,changed";
|
||||
|
||||
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
||||
{SIG_CHANGED, ""},
|
||||
{SIG_DELAY_CHANGED, ""},
|
||||
{SIG_LANG_CHANGED, ""},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static void
|
||||
_elm_spinner_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_entry_show(Elm_Spinner_Smart_Data *sd)
|
||||
{
|
||||
|
@ -1219,6 +1230,7 @@ _class_constructor(Eo_Class *klass)
|
|||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_spinner_smart_del),
|
||||
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_spinner_smart_theme),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_spinner_smart_translate),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_spinner_smart_on_focus),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_spinner_smart_event),
|
||||
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_spinner_smart_focus_next_manager_is),
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
* the user. This will be called only when the user stops dragging
|
||||
* for a very short period or when they release their finger/mouse,
|
||||
* so it avoids possibly expensive reactions to the value change.
|
||||
* - @c "language,changed" - the program's language changed
|
||||
*
|
||||
* Available styles for it:
|
||||
* - @c "default";
|
||||
|
|
Loading…
Reference in New Issue