Developer

API Reference

IWidget_MoveFocus()

Brew Release
Brew MP 1.0.2
See Also
- Model Events
- IWidget Interface
Description
This function requests a change in focus within the specified widget, where this source widget -- which is passed to the function as a widget pointer in 'p' -- is either a proper container, or a widget that is itself a container (e.g. an image static widget). The target for the new focus is passed in 'piwFocus' and may be expressed either explicitly, as a pointer to a specific widget, or implicitly as a constant that identifies how the focus should move relative to the current focus. The constants used to identify relative focus changes, are defined as follows:
       WIDGET_FOCUS_NONE   -  The current focus should be cancelled and no widget will have
                              the focus.
       WIDGET_FOCUS_FIRST  -  The focus should be  moved to the first focusable widget in the
                              parent container.
       WIDGET_FOCUS_LAST   -  The focus should be moved to the last focusable widget in the
                              parent container.
       WIDGET_FOCUS_NEXT   -  The focus should be moved to the next focusable widget in the
                              parent container.
       WIDGET_FOCUS_PREV   -  The focus should be moved to the previous focusable widget in
                              the parent container.

An application can use these constants in conjunction with IWIDGET_MoveFocus() to easily cycle the focus from one widget to the next within a given container.
To move the focus to the next focusable widget in the given container, for example, IWIDGET_MoveFocus(piwc, (IWidget*)WIDGET_FOCUS_NEXT) should be called. As another example, to move the focus to the last focusable widget in the container, the application should call IWIDGET_MoveFocus(piwc, (IWidget*)WIDGET_FOCUS_LAST).
Parameters
  • p
    []:
    Pointer to the IWidget object that is responsible for managing the focus. This is usually the parent container of the widget receiving the focus.
  • piwFocus
    []:
    Identifies the new focus item, either explicitly as a pointer to an IWidget in the container's widget stack, or implicitly as one of the relative focus position constants defined above.
Interface
Prototype
   int IWIDGET_MoveFocus(IWidget *p, IWidget *piwFocus)   
Return
   AEE_SUCCESS - If the focus move succeeded
   AEE_EFAILED - If the focus could not be moved

Side Effect
Calling IWidget_MoveFocus() will cause an EVT_WDG_MOVEFOCUS to be sent to the specified container.
Comment
None
  • Follow