lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: wxHtmlWindow::AcceptsFocus() [Was: [lmi] Overriding wx member fun


From: Vadim Zeitlin
Subject: Re[2]: wxHtmlWindow::AcceptsFocus() [Was: [lmi] Overriding wx member functions]
Date: Sun, 4 Dec 2005 14:22:06 +0100

On Sun, 04 Dec 2005 02:49:40 +0000 Greg Chicares <address@hidden> wrote:

GC> I agree that wx treats a wxHtmlWindow as though one could navigate
GC> to it using the keyboard, but I don't know how one can do that.

 Currently it's a bit restricted: you can only use arrows and Page Up/Down
to scroll the window.

GC> > and also to select text in the HTML window,
GC> 
GC> How? What keystrokes would one use to do this?

 Ctrl-C. But you need to select text with the mouse -- which kind of
negates the need for giving the focus to the control from keyboard in the
first place. There are plans to make it possible to select text using the
standard Shift-arrows key combinations and also implement Ctrl-A for
"select all" but this is not done yet.

GC> If special hardware is required to interact with a wxHtmlWindow

 No, it isn't.

GC> but if that is so, then how can I most cleanly prevent this "dead"
GC> window from receiving focus? Clearly, instead of
GC>   wxWindow* w;
GC>   ...
GC>   if(w && w->IsEnabled() && w->AcceptsFocus())
GC> I could say
GC>   wxHtmlWindow* html_window = dynamic_cast<wxHtmlWindow*>(w);
GC>   if(w && w->IsEnabled() && w->AcceptsFocus() && !html_window)

 Yes but this is hardly ideal. Unfortunately for now the only alternative
solution I see is to define your own subclass of wxHtmlWindow (say
StaticHtmlWindow) and override AcceptsFocusFromKeyboard() to return false
from it. Then you'd just use subclass="StaticHtmlWindow" tag in XRC to
create it instead of wxHtmlWindow. This would be more elegant than
explicitely testing for the window class at the price of some extra work.

 Regards,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]