AUI focus problem
Riccardo Cohen
rcohen at articque.com
Thu Mar 20 02:56:05 PDT 2008
strange, because with wx2.9 at least, I have no focus problem with
floating panes, I can input text and type return in it.
Harry wrote:
>
> Hi,
>
> An AUI problem almost drove me crazy, where a floated window absolutely
> refused to accept the focus,
> no matter how many times I clicked on it.
>
> I finally tracked the problem to the fact that a floated window is
> wrapped in a mini-frame that is itself
> the child of the managed window. This configuration of a top-level
> window as a child caused the problem :
>
> wxGetTopLevelParent() when called for the floated window from
> wxTopLevelWindowMSW::OnActivate(),
> will return the mini-frame as the top window, rather than returning the
> managed window, therefore causing the logic
> in wxTopLevelWindowMSW::OnActivate() to go completely wrong.
>
> I've solved the problem in wxGetTopLevelParent() by rewriting it to look
> for the last top-level window,
> rather than for the first, like this:
>
> wxWindow* top = NULL;
> while ( win ) {
> if ( win->IsTopLevel() )
> top = win;
> win = win->GetParent();
> }
> return top;
>
> This corrected my problem.
> However, a quick search for IsTopLevel thru the sources have shown me
> that the same conception
> occurs in several other places - stopping on the first top-level window.
> There might be other places in the code that require a similar correction.
>
> Regards
> Harry
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
--
Très cordialement,
Riccardo Cohen
-------------------------------------------
Articque
http://www.articque.com
149 av Général de Gaulle
37230 Fondettes - France
tel : 02-47-49-90-49
fax : 02-47-49-91-49
More information about the wx-users
mailing list