hermet pushed a commit to branch master.
commit a6b35f11943e5ae1c04af0f7f5308dc39679c66d
Author: ChunEon Park <[email protected]>
Date: Tue Jul 23 01:51:27 2013 +0900
elementary/fileselector - support elm_object_part_text_set() to set the ok,
cancel button label.
---
ChangeLog | 5 +++++
NEWS | 1 +
src/lib/elc_fileselector.c | 23 +++++++++++++++++++++++
src/lib/elc_fileselector.h | 4 ++++
4 files changed, 33 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index cb25155..beb68e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1510,3 +1510,8 @@
the imf is available, the keyboard mode should be decided by ime, but
not entry. This prevents the asynchronous states between ime and
conformant.
+
+2013-07-23 ChunEon Park (Hermet)
+
+ * File Selector : Support elm_object_part_text_set() for the ok, cancel
+ part to change the OK, Cancel button label.
diff --git a/NEWS b/NEWS
index 4624a5b..178391b 100644
--- a/NEWS
+++ b/NEWS
@@ -80,6 +80,7 @@ Additions:
* added callback call "scroll", "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" in toolar widget.
* Add the configuration thumbscroll_flick_distance_tolerance.
* Add elm_access_highlight_next_set, export elm_widget_focus_region_show
+ * File Selector : Support elm_object_part_text_set() for the ok, cancel
part to change the OK, Cancel button label.
Improvements:
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 2d675a2..4701574 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -1417,6 +1417,28 @@ _elm_fileselector_smart_focus_direction_manager_is(Eo
*obj EINA_UNUSED, void *_p
}
static void
+_elm_fileselector_smart_text_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Fileselector_Smart_Data *sd = _pd;
+
+ const char *part = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (sd->ok_button && !strcmp(part, "ok"))
+ {
+ elm_object_text_set(sd->ok_button, label);
+ if (ret) *ret = EINA_TRUE;
+ }
+ else if (sd->cancel_button && !strcmp(part, "cancel"))
+ {
+ elm_object_text_set(sd->cancel_button, label);
+ if (ret) *ret = EINA_TRUE;
+ }
+}
+
+static void
_class_constructor(Eo_Class *klass)
{
unsigned int i;
@@ -1432,6 +1454,7 @@ _class_constructor(Eo_Class *klass)
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS),
_elm_fileselector_smart_focus_direction_manager_is),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL),
_elm_fileselector_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET),
_elm_fileselector_smart_text_set),
EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET),
_is_save_set),
EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET),
_is_save_get),
diff --git a/src/lib/elc_fileselector.h b/src/lib/elc_fileselector.h
index 8ad6ae9..77e6a39 100644
--- a/src/lib/elc_fileselector.h
+++ b/src/lib/elc_fileselector.h
@@ -48,6 +48,10 @@
* buttons (@c event_info is a pointer to the selection's
* path, a @b stringshared string)
*
+ * For text, elm_layout_text_set() will work here on:
+ * @li @c "ok" - OK button label if the ok button is set. @since 1.8
+ * @li @c "cancel" - Cancel button label if the cancel button is set. @since
1.8
+ *
* Here is an example on its usage:
* @li @ref fileselector_example
*/
--
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk