Languages

Menu
Sites
Language
IFocusEventListener for common controls

Hi
Using Native UI Builder I am able to add Properties->AddHandler->IFocusEventListener for common controls (Slider,Button,ColorPicker,Checkbox etc).

But when I pressed on controls during App execution OnFocusGained was not invoked.I tried to call SetFocusable(true) for every control in code. Method returned E_SUCCES. Also I  was able to invoke SetFocus() for controls in code, but no visual changes happened.

Is IFocusEventListener interface applicable for these elements ? If so how could I use it?

Thank you in advance.
Alexey.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

4 Replies
Siddharth Singh
Please,use HasFocus() API to check whether any particular UI control has the Focus at any given time or not. Also,the OnFocusGained method will be invoked once you associate the IFocusEventListener with the UI controls such as below : pTextbox->AddFocusEventListener(*this); So,if the UI control has the Focus and it has been associated with the IFocusEventListener then OnFocusGained should be invoked. Also,there will be no visible change as such.We ourselves will have to define the UI controls appearance on Focus.
Alex Dem
Hi, Thank you. Focus is applicable for Texts Area Elements, I know, and OnFocusGained is invoked for them. I just wanted to say that these controls (Slider,Button etc) can't be in focus. For example pButton->HasFocus() always return false if button currently pressed even. But all methods : to set focus, to check focus are available. This is confused me. Alexey.
Siddharth Singh
I will have to verify it for other controls but for button it works. Try like this : Create 2 buttons.Set focus on one button at the click event of other button. I tried it worked and OnFocus Gained was also called.
Alex Dem
Thank you a lot! It works this way, I have checked for buttons. You are right, I should invoke SetFocus for control explicitly on any action. It is not enouth to add IFocusEventListener only to get OnFocusGained, like for Text elements. Alexey.