f



Re: TAB to navigate in tab order

Bob Davis wrote:
>In my case where I didnt have a message pump I put the following in the
>app implementation and it fixed it:
>
>BEGIN_EVENT_TABLE(MyApp, wxApp)
>      EVT_CHAR(MyApp::OnChar)
>END_EVENT_TABLE()
>
>void MyApp::OnChar(wxKeyEvent& event)
>{
>         if ( event.GetKeyCode() ==  WXK_TAB) {
>                 wxNavigationKeyEvent eventNav;
>                 eventNav.SetDirection(!event.ShiftDown());
>                 eventNav.SetWindowChange(event.ControlDown());
>                 eventNav.SetEventObject(event.GetEventObject());
>                 wxWindow* wnd = (wxWindow*) event.GetEventObject();
>                 for ( wnd = wnd->GetParent(); wnd; wnd = wnd->GetParent() ) {
>                         if ( wnd->GetEventHandler()->ProcessEvent(eventNav) )
>                                 return;
>                 }
>         }
>
>         event.Skip();
>}

Indeed, with this wxChoices also forward the focus to the next widget in 
tab order. Thanks for sharing it on the list.

But unfortunately, it doesn't fix my problem, i.e. the last widget in tab 
order (which happens to be a wxTextCtrl) doesn't forward the focus to the 
first. Actually, the MyApp::OnChar() handler is not even called for this 
last widget!

But I don't give up - I keep on digging into wxW sources.

>I am not sure why I had to do this and everybody elses apps work.

Well, mine didn't til I got your patch ;-) But indeed the problem with 
wxChoices keeping focus shows up only when IMPLEMENT_APP_NO_MAIN.

Cheers,

Cristina. 


---------------------------------------------------------------------
Please read http://www.wxwindows.org/mlhowto.htm before posting.

To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wx-users-help@lists.wxwindows.org

0
cai
11/25/2003 11:23:30 PM
comp.soft-sys.wxwindows 21076 articles. 0 followers. Post Follow

0 Replies
340 Views

Similar Articles

[PageSpeed] 29

Reply: