[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wxHtmlWindow::AcceptsFocus() [Was: [lmi] Overriding wx member functi
From: |
Greg Chicares |
Subject: |
Re: wxHtmlWindow::AcceptsFocus() [Was: [lmi] Overriding wx member functions] |
Date: |
Sun, 04 Dec 2005 02:49:40 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
On 2005-12-3 3:27 UTC, Vadim Zeitlin wrote:
> On Fri, 02 Dec 2005 15:36:07 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> In wx-2.5.4 at least (we're both getting tired of me saying that),
> GC> wxHtmlWindow::AcceptsFocus() returns true. Does that seem right?
>
> In fact it is right even though I also personally thought it was not (and
> so had AcceptsFocus() return false for this class). The reason is that the
> keyboard can be used to navigate in the window
I agree that wx treats a wxHtmlWindow as though one could navigate
to it using the keyboard, but I don't know how one can do that.
> and also to select text in
> the HTML window,
How? What keystrokes would one use to do this? I must be missing
something.
Am I puzzled just because I'm not using one of those abominable
ms keyboards and therefore don't have an 'application key'? If
special hardware is required to interact with a wxHtmlWindow
through the keyboard, then wouldn't it be better for the library
to detect it?
> so we shouldn't prevent it from getting focus -- just as a
> read-only text control still gets it because the user can use keyboard to
> select and copy text in it.
I'm using the 'skeleton' branch because the 'lmi' branch has no
wxHtmlWindow. That branch's 'mvc_view.xrc' has code like this:
<object class="sizeritem">
<flag>wxGROW | wxALIGN_CENTER_VERTICAL | wxALL</flag>
<object class="wxHtmlWindow" name="controls_htmlwindow">
<size>400,100</size>
<style>wxHW_SCROLLBAR_AUTO</style>
<htmlcode>
Controls that manage the same sort of data are
interchangeable. This is how the previous tab
looks with comboboxes substituted for radioboxes.
</htmlcode>
</object>
</object>
I can't find a way to select that text using only my keyboard.
Perhaps that's just because I'm using wxxrc, and otherwise the
text would be selectable with the keyboard only; but if that is
so, then how can I most cleanly prevent this "dead" window from
receiving focus? Clearly, instead of
wxWindow* w;
...
if(w && w->IsEnabled() && w->AcceptsFocus())
I could say
wxHtmlWindow* html_window = dynamic_cast<wxHtmlWindow*>(w);
if(w && w->IsEnabled() && w->AcceptsFocus() && !html_window)