WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=7035768b40f26bf8741926d5df1d7caf3ff5a69c
commit 7035768b40f26bf8741926d5df1d7caf3ff5a69c Author: Nate Drake <nate.dr...@gmx.com> Date: Thu Jan 4 02:29:03 2018 -0800 Wiki page focus.md changed with summary [] by Nate Drake --- pages/develop/guides/c/ui/focus.md.txt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pages/develop/guides/c/ui/focus.md.txt b/pages/develop/guides/c/ui/focus.md.txt index 01170c57c..6aa905aa5 100644 --- a/pages/develop/guides/c/ui/focus.md.txt +++ b/pages/develop/guides/c/ui/focus.md.txt @@ -4,9 +4,9 @@ # EFL Focus Programming Guide # -When using a keyboard instead of a mouse or a touch screen, you need the concept of Focus: a graphical indicator of the widget currently selected, which you can move around using the cursor keys, for example. +When using a keyboard instead of a mouse or a touch screen, you need to understand the concept of Focus: a graphical indicator of the widget currently selected, which you can move around using the cursor keys, for example. -EFL handles the focus of your application in a way which works in most situations. For the rare scenario where this is not the case, this guide shows you how focus is handled in EFL and how you can tweak it to suit your needs. +EFL handles the focus of your application in a way which works in most situations. This guide shows you how focus is handled in EFL and how to tweak it to your needs in those rare circumstances where this isn't the case. ## Prerequisites ## @@ -14,21 +14,21 @@ EFL handles the focus of your application in a way which works in most situation * You should also be familiar with Eolian interfaces: read the [Multiple Inheritance with Eolian](/develop/tutorials/c/eo-multiinherit.md) tutorial to understand these. -* Read also the [Events Programming Guide](/develop/guides/c/core/events.md) to learn about event emission and registration in EFL. +* Make sure you also read the [Events Programming Guide](/develop/guides/c/core/events.md) to learn about event emission and registration in EFL. ## Understanding the Focus ## -Graphical User Interfaces (*GUI*s) are typically made of widgets arranged on a window. Some widgets are meant to convey information to the user, like labels or progress bars, some are meant to receive information from the user, like text boxes or sliders, and some are meant to execute commands, like buttons. +Graphical User Interfaces (*GUI*s) are typically made of widgets arranged on a window. Some widgets are meant to convey information to the user, like labels or progress bars. Some are meant to receive information from the user such as text boxes or sliders and some are meant to execute commands, like buttons. -To act on a widget, you first need to *activate* it: Using a *mouse*, the widget under the mouse pointer is activated when you click on it. Likewise when using a *touch screen*, the widget under your finger is activated when you press it. +To act on a widget, you first need to *activate* it using a *mouse*: the widget under the mouse pointer is activated when you click on it. Similarly,, when you're using a *touch screen*, the widget under your finger is activated when you press it. -Things are not so straightforward when you use a *keyboard*, though. To begin with, a keyboard requires a widget to be the *selected* widget. Then, you have keys (typically the <kbd>Tab</kbd> or the Cursor keys) that allow you to change the selected widget, and keys (typically <kbd>Enter</kbd> or the <kbd>Space</kbd>) that activate the selected widget. +Things are not so straightforward when you use a *keyboard*. To begin with, a keyboard requires a widget to be the *selected* widget. You also have keys (typically the <kbd>Tab</kbd> or the Cursor keys) that allow you to change the selected widget and keys (typically <kbd>Enter</kbd> or the <kbd>Space</kbd>) to activate it. -The selected widget is said to have the *Focus* and is shown with some sort of highlight to distinguish it from the other widgets. Changing the focus from one widget to another using the keyboard is called *Focus Navigation*. +The selected widget is said to have the *Focus* and is shown with some sort of highlight to distinguish it from other widgets. Changing the focus from one widget to another using the keyboard is called *Focus Navigation*. ## Focus Management in EFL ## -When developing applications with EFL, you normally don't have to worry about focus management. You just build your GUI by adding and arranging widgets to it, and focus works out of the box. It is worth understanding how EFL does this, though, in case you are not satisfied with the focus navigation it provides. +When developing applications with EFL, you normally don't have to worry about focus management. You can just build your GUI by adding and arranging widgets and focus works out of the box. It is worth understanding how EFL does this though, in case you aren't satisfied with the focus navigation it provides. There are 6 commands for Focus navigation: 4 *directional* (Up, Down, Left, Right) and 2 *ordinal* (Previous and Next). @@ -38,17 +38,17 @@ When EFL receives an ordinal focus navigation command (typically though the <kbd As you add widgets to your GUI, the *focusable* ones are added to a list (not all widgets can be selected, like text labels, for example). Ordinal commands then move the focus through this list. If a widget is a container for other widgets (like Box), focus will move through its children *before* moving out of the container and onto its siblings. -So, the bottom line is: **Add widgets to your GUI in the same order in which you will want the user to navigate them**. The order in which the widgets are added has no other impact, so it is worth walking the extra mile and do it in a sensible order: In this way, your GUI will be more keyboard-friendly. +The bottom line is that you mus **add widgets to your GUI in the same order in which you want the user to navigate them**. The order in which the widgets are added has no other impact, so it is worth doing to make your GUI more keyboard-friendly. ## Setting the Focus on a Widget ## -Sometimes you want to bypass EFL's default behavior and programmatically set the focus to a particular widget, for example, on the [OK] button once enough information has been added to a form. +Sometimes you maay want to bypass EFL's default behavior and programmatically set the focus to a particular widget, for example, on an [OK] button once enough information has been added to a form. -To achieve this, you can use the ``Efl.Ui.Focus.Util`` class. It has a single method called ``efl_ui_focus_util_focus()`` which receives as a parameter the widget you want to move the focus to. +To achieve this use the ``Efl.Ui.Focus.Util`` class. It has a single method called ``efl_ui_focus_util_focus()`` which receives as a parameter the widget to which you want to move the focus. -When using this method, the widget currently selected will lose the focus, and the one you passed in will gain the focus. In the process, all focus-related events will be emitted (see the next section). +When using this method the widget currently selected will lose the focus and the one you passed will gain the focus. During thi process, all focus-related events will be emitted (see the next section). -This method can only be used on widgets implementing the ``Efl.Ui.Focus.User`` and ``Efl.Ui.Focus.Object`` interfaces, but most widgets inherit from ``Elm.Widget`` which already does this, so you don't have to worry. +This method can only be used on widgets implementing the ``Efl.Ui.Focus.User`` and ``Efl.Ui.Focus.Object`` interfaces but most widgets inherit from ``Elm.Widget`` which already does this, so you don't have to worry. Here's an usage example based on the EFL examples repository [tutorial/c/focus/src/focus_main.c](https://git.enlightenment.org/tools/examples.git/tree/tutorial/c/focus/src/focus_main.c): @@ -94,11 +94,11 @@ Here's an usage example based on the EFL examples repository [tutorial/c/focus/s ## Summary ## -* Add widgets to your GUI in the same order you will want your users to navigate them. +* Add widgets to your GUI in the same order in which you want your users to navigate them. * Manually set the focus to a widget using ``efl_ui_focus_util_focus()``. -* Be notified of focus changes by listening to the ``EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED`` event. +* Track focus changes by listening to the event ``EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED``. ## Further Reading ## --