Lose focus event for wxTextCtrl? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
gtafan
Earned some good credits
Earned some good credits
Posts: 145
Joined: Wed Mar 29, 2017 9:52 am

Re: Lose focus event for wxTextCtrl?

Post by gtafan » Fri Jan 18, 2019 11:56 am

[quote="PB"][/quote]
Sorry a misunderstanding, the problem with tab has nothing to do with my previous one. When I am presing tab on any textCtrl the cursor goes to the next textCtrl and Lose focus event is generated, but on the last textCtrl it´s not worcking, the cursor is not going to the first one, like it should and so no Lose focus event is generated.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2057
Joined: Sun Jan 03, 2010 5:45 pm

Re: Lose focus event for wxTextCtrl?

Post by PB » Fri Jan 18, 2019 1:33 pm

Please start a new topic if the issue is different enough.

I think you may be doing something wrong.

When controls are in a wxNotebook page, after <Tab>bing the last focusable control on the page or frame the focus does not go to the first control but to a tab header: you can see the focus rectangle drawn around the tab title. After that the next <Tab> makes the focus go to the first control on the page.

However, where the focus goes should not be important for wxEVT_KILL_FOCUS, losing focus is what generates the event. Try to look over your code once more (e.g., to make sure even the last wxTextEdit has the event bound); if it does not help, try preparing the smallest possiblle self-contained example demonstrating the code (could be similar to those I posted earlier in the thread).

Post Reply