Hi @ABELA,
It's not you. There's no concept of "focus" in touchgfx / touch sensitive applications. You won't find anything. What i meant was that you need to implement a "focus" state for a custom button. You have the source code for Button, so you can check out the code and get some inspiration. You can also simply draw a "focus" rectangle or something similar around the current Drawable being focused by your external events.
You can cycle through Drawables in your application. When you add() Drawables to your root container in a screen/view (by calling add(myButton); ) you build up a linked list.
You can get a pointer to the first element in this list by calling:
getRootContainer().getFirstChild()
And then maybe;
getRootContainer().getFirstChild()->getNextSibling()
And then you can get its type
getRootContainer().getFirstChild()->getNextSibling()->getType()
.. and compare that against its DrawableType (defined in Drawable.hpp) if that's interesting:
typedef enum
{
TYPE_DRAWABLE,
TYPE_WIDGET,
TYPE_ABSTRACTBUTTON,
TYPE_ANIMATEDIMAGE,
TYPE_BOX,
TYPE_BUTTON,
TYPE_BUTTONWITHICON,
TYPE_BUTTONWITHLABEL,
TYPE_IMAGE,
TYPE_TILEDIMAGE,
TYPE_KEYBOARD,
TYPE_SCALABLEIMAGE,
TYPE_SNAPSHOTWIDGET,
TYPE_TEXTAREA,
TYPE_TEXTAREAWITHONEWILDCARD,
TYPE_TEXTAREAWITHTWOWILDCARDS,
TYPE_TOGGLEBUTTON,
TYPE_TOUCHAREA,
TYPE_CONTAINER,
TYPE_LISTLAYOUT,
TYPE_SCROLLABLECONTAINER,
TYPE_ZOOMANIMATIONIMAGE,
TYPE_RADIOBUTTON,
TYPE_TEXTUREMAPPER,
TYPE_SLIDER,
TYPE_CUSTOMTYPESBEGIN,
TYPE_CLICKABLECONTAINER
} DrawableType;
Hope that can get you started.
/Martin
/Martin