Preventing the wxScrollbar getting the focus.

Luca Cappa luca.cappa at sequoia.it
Tue Jan 29 09:26:08 PST 2008


Hello,

On Mon, 28 Jan 2008 18:39:11 +0100, Vadim Zeitlin <vadim at wxwidgets.org>  
wrote:
> On Mon, 28 Jan 2008 18:22:18 +0100 Luca Cappa <luca.cappa at sequoia.it>  
> wrote:
>  If this is the only problem, you can use MoveAfterInTabOrder() to put  
> the
> scrollbar to its place.

Do you mind that I could use this method to put the wxScrollbar at the end  
or at the start of the tab traversal order list? If so, then I could use  
it to put it at the end (or at the start), but still the problem is the  
same: in fact I must know which is the first (or the last) control to be  
built (which I would pass as the argument to that method), and the   
problem could be then simplyfied by simply create the scrollbar before any  
other control is created. Correct me if i am wrong :)

The actual solution I use is to subclass wxScrollbar and override the  
"bool AcceptsFocus () const" and
"bool AcceptsFocusFromKeyboard () const" to return false, and it seems to  
work nicely (the scrollbar is loaded from an xrc file stored as <object  
class="wxScrollBar" name="ID_SCROLLBAR" subclass="myScrollbar">).

My new questions are: there is a way to tell to any wxWindow instance  
whether it is focus traversable or not? Why the wxScrollBar is always  
focus traversable?

Thanks,
Luca




More information about the wx-users mailing list