Okay, first off, here is the code to put in your BasicPanel
class:
void OnKillFocus(wxFocusEvent& event);
Then add the following to the end of your BasicPanel
constructor:
Connect(ID_TEXTCTRL,
wxEVT_KILL_FOCUS ,
(wxObjectEventFunction)&BasicPanel::OnKillFocus);
You will need to repeat the above code for each text control and replace ID_TEXTCTRL
with the actual ID of the controls.
Then the code below will get called whenever one of the controls loses focus.
void BasicPanel::OnKillFocus(wxFocusEvent& event)
{
// code goes here...
}
To determine the ID of the control that generated the event within OnKillFocus
, you can use the following:
event.GetId()
George Edison
2010-04-21 03:28:10