Code: Select all
void PANEL::Init()
{
wxTextCtrl* itemTextCtrl = new wxTextCtrl(
itemStaticBoxSizer11->GetStaticBox(),
ID_TEXTCTRL, wxEmptyString,
wxDefaultPosition, wxSize(400, -1),
wxTE_PROCESS_ENTER
);
}
Code: Select all
BEGIN_EVENT_TABLE( PANEL, wxDialog )
EVT_TEXT_ENTER( wxID_ANY, PANEL::OnTextctrlEnter )
END_EVENT_TABLE()
And finally, function to call in event of user pressing enter key.
Code: Select all
void PANEL::OnTextctrlEnter( wxCommandEvent& event )
{
// reference text field data and do stuff!!!
}
What is the best way to reference the wxTextCtrl object? ...for eg to access the contents of the text field?
Will wxTextCtrl need to be declared as a member of the Panel class or?