FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Focus question

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Fri Nov 16, 2007 12:58 am    Post subject: Focus question Reply with quote

If I have just a GLControl in a form it gets key events.

If I add a button to the form, now I don't get key events and the button just seems to hold on to the focus no matter what I do.

How can I make it so that I can have a button (and other controls) on the form but either the form or the GLControl can still get key events?

Can I make the button not focusable?
Or can I make it somehow so that the ESC key always unfocuses everything no matter what has focus?

Thanks.
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Fri Nov 16, 2007 4:33 pm    Post subject: Re: Focus question Reply with quote

Try giving the GLControl the selectable control style using setStyle; and to allow it to be tabbed-to, set the property tabStop.
Back to top
View user's profile Send private message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Sat Nov 17, 2007 12:10 am    Post subject: Re: Focus question Reply with quote

Chris Miller wrote:
Try giving the GLControl the selectable control style using setStyle; and to allow it to be tabbed-to, set the property tabStop.


Tried the tabStop thing and it seemed to work for letting it get the focus.

Not sure how to use the setStyle thing. Can I just say "setStyle(SELECTABLE)" in the constructor of my control? Don't I need to OR that together with whatever the default flags are (like setStyle(SELECTABLE|getStyle()) ?
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Mon Nov 19, 2007 9:53 am    Post subject: Re: Focus question Reply with quote

baxissimo wrote:
Not sure how to use the setStyle thing. Can I just say "setStyle(SELECTABLE)" in the constructor of my control? Don't I need to OR that together with whatever the default flags are (like setStyle(SELECTABLE|getStyle()) ?

setStyle only touches the flags you specify; the bool next parameter decides if they are set or unset. All other style flags are preserved.
Back to top
View user's profile Send private message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Mon Nov 19, 2007 10:15 am    Post subject: Re: Focus question Reply with quote

Chris Miller wrote:
baxissimo wrote:
Not sure how to use the setStyle thing. Can I just say "setStyle(SELECTABLE)" in the constructor of my control? Don't I need to OR that together with whatever the default flags are (like setStyle(SELECTABLE|getStyle()) ?

setStyle only touches the flags you specify; the bool next parameter decides if they are set or unset. All other style flags are preserved.


Ah, ok. I see now. Well SELECTABLE was not listed in the doc as being a currently supported style, so I changed it. Hopefully you corrected the doc I added if it was wrong.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group