On Tue, Feb 28, 2012 at 10:50 AM, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > elm/entry: add elm_entry_input_panel_return_key_autoenable_set API. > > Set whether the return key on the input panel is disabled automatically when > entry has no text. > > > Author: jihoon > Date: 2012-02-27 17:50:19 -0800 (Mon, 27 Feb 2012) > New Revision: 68484 > Trac: http://trac.enlightenment.org/e/changeset/68484 > > Modified: > trunk/elementary/src/lib/elm_entry.c trunk/elementary/src/lib/elm_entry.h > > Modified: trunk/elementary/src/lib/elm_entry.c > =================================================================== > --- trunk/elementary/src/lib/elm_entry.c 2012-02-27 23:48:31 UTC (rev > 68483) > +++ trunk/elementary/src/lib/elm_entry.c 2012-02-28 01:50:19 UTC (rev > 68484) > @@ -75,6 +75,7 @@ > Eina_Bool input_panel_enable : 1; > Eina_Bool prediction_allow : 1; > Eina_Bool input_panel_return_key_disabled : 1; > + Eina_Bool autoreturnkey : 1; > }; > > struct _Elm_Entry_Context_Menu_Item > @@ -791,6 +792,21 @@ > } > > static void > +_check_enable_return_key(Evas_Object *obj) > +{ > + Widget_Data *wd = elm_widget_data_get(obj); > + Eina_Bool return_key_disabled = EINA_FALSE; > + if (!wd) return; > + > + if (!wd->autoreturnkey) return; > + > + if (elm_entry_is_empty(obj) == EINA_TRUE) > + return_key_disabled = EINA_TRUE; > + > + elm_entry_input_panel_return_key_disabled_set(obj, return_key_disabled); > +} > + > +static void > _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) > { > Widget_Data *wd = elm_widget_data_get(obj); > @@ -804,6 +820,7 @@ > if (top && wd->input_panel_enable) > elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); > evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL); > + _check_enable_return_key(obj); > } > else > { > @@ -1506,6 +1523,7 @@ > /* callback - this could call callbacks that delete the entry... thus... > * any access to wd after this could be invalid */ > evas_object_smart_callback_call(data, event, NULL); > + _check_enable_return_key(data); > } > > static void > @@ -3732,3 +3750,14 @@ > return wd->input_panel_return_key_disabled; > } > > +EAPI void > +elm_entry_input_panel_return_key_autoenable_set(Evas_Object *obj, Eina_Bool > on) > +{ > + ELM_CHECK_WIDTYPE(obj, widtype); > + Widget_Data *wd = elm_widget_data_get(obj); > + if (!wd) return; > + > + wd->autoreturnkey = on; > + _check_enable_return_key(obj); > +} > + > > Modified: trunk/elementary/src/lib/elm_entry.h > =================================================================== > --- trunk/elementary/src/lib/elm_entry.h 2012-02-27 23:48:31 UTC (rev > 68483) > +++ trunk/elementary/src/lib/elm_entry.h 2012-02-28 01:50:19 UTC (rev > 68484) > @@ -1277,6 +1277,18 @@ > EAPI Eina_Bool > elm_entry_input_panel_return_key_disabled_get(const Evas_Object *obj); >
Hello, > /** > + * Set whether the return key on the input panel is disabled automatically > when entry has no text. > + * > + * If @p on is EINA_TRUE, The return key on input panel is disabled when the > entry has no text. > + * The return Key on the input panel is automatically enabled when the entry > has text. > + * The default value is EINA_FALSE. > + * > + * @param obj The entry object > + * @param on If @p on is EINA_TRUE, the return key is automatically disabled > when the entry has no text. > + */ > +EAPI void > elm_entry_input_panel_return_key_autoenable_set(Evas_Object *obj, Eina_Bool > on); How about using _autoenabled_set instead of _autoenable_set like other EFL enabled/disabled set/get APIs? Just my 2 cents. Daniel Juyung Seo (SeoZ) > + > +/** > * Reset the input method context of the entry if needed. > * > * This can be necessary in the case where modifying the buffer would confuse > on-going input method behavior > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel