wxEVT_TEXT_ENTER doesn't get fired on mac
Posted: Wed Aug 01, 2018 8:52 am
Below is the sample application using which i am able to reproduce the problem
issue is also reproducible on sample "widgets" demo application which comes with wx source.
looking for possible workaround for this problem.
this issue is not reproducible on previous version (wxWidgets 3.0)
Library Version and System i am using::
wxWidgets Version: 3.1
OS : MAC OS High Sierra 10.13.3
Update:
issue is reported and fixed here
https://trac.wxwidgets.org/ticket/18101
Code: Select all
#include <wx/wx.h>
class MyApp : public wxApp
{
public:
MyApp();
bool OnInit() override;
int OnExit() override;
private:
wxFrame * m_pFrame;
};
wxIMPLEMENT_APP(MyApp);
class Frame : public wxFrame
{
public:
Frame();
void OnTextChange(wxCommandEvent& evt);
void OnEnterPress(wxCommandEvent& evt);
private:
wxTextCtrl * m_textCtrl;
wxTextCtrl * m_logtextCtrl;
};
MyApp::MyApp()
{
}
bool MyApp::OnInit()
{
m_pFrame = new Frame();
m_pFrame->SetSize(wxSize(640, 480));
m_pFrame->SetMinSize(wxSize(640, 480));
m_pFrame->CenterOnScreen();
m_pFrame->Show();
return true;
}
int MyApp::OnExit()
{
return 0;
}
Frame::Frame() : wxFrame(NULL, wxID_ANY, "Test", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
{
SetBackgroundColour(*wxWHITE);
wxBoxSizer* verticalSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* hSizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticText* staticText = new wxStaticText(this, wxID_ANY, "TextCtrl:: ");
hSizer->Add(staticText, 0, wxALIGN_CENTER_VERTICAL);
m_textCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
m_textCtrl->Bind(wxEVT_TEXT_ENTER, &Frame::OnEnterPress, this);
m_textCtrl->Bind(wxEVT_TEXT, &Frame::OnTextChange, this);
hSizer->Add(m_textCtrl, 1, wxEXPAND);
verticalSizer->Add(hSizer, 0, wxEXPAND);
m_logtextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
verticalSizer->Add(m_logtextCtrl, 1, wxEXPAND);
wxLog::SetActiveTarget(new wxLogTextCtrl(m_logtextCtrl));
SetSizerAndFit(verticalSizer);
}
void Frame::OnTextChange(wxCommandEvent& evt)
{
m_logtextCtrl->AppendText(wxString("Text Changed:") + m_textCtrl->GetValue() + wxString("\n"));
}
void Frame::OnEnterPress(wxCommandEvent& evt)
{
m_logtextCtrl->AppendText("Enter Press on Text Ctrl\n");
}
looking for possible workaround for this problem.
this issue is not reproducible on previous version (wxWidgets 3.0)
Library Version and System i am using::
wxWidgets Version: 3.1
OS : MAC OS High Sierra 10.13.3
Update:
issue is reported and fixed here
https://trac.wxwidgets.org/ticket/18101