vendredi 20 février 2015

wxwidgets Bind() term does not evaluate to a function taking 1 argument in event.h


I am getting the following error and I am lost as to what the error is actually trying to tell me.



error C2064: term does not evaluate to a function taking 1 arguments event.h line 516


This is of course the wxwidgets event.h file


the code that is causing the error is the Bind() in this method.



int Layout::CreateWindow()
{
wxPanel * m_pPanel = new wxPanel(this, -1);
wxBoxSizer * m_pVbox = new wxBoxSizer(wxVERTICAL);
wxTextCtrl * m_pReceiveBox = new wxTextCtrl(m_pPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
wxTextCtrl * m_pSendBox = new wxTextCtrl(m_pPanel, ID_SEND, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
wxStatusBar * m_pStatusBar = new wxStatusBar(m_pPanel, wxID_ANY, wxSTB_DEFAULT_STYLE);

m_pVbox->Add(m_pReceiveBox, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 2);
m_pVbox->Add(m_pSendBox, 0, wxEXPAND | wxLEFT | wxRIGHT, 2);
m_pVbox->Add(m_pStatusBar, 0, wxEXPAND);

m_pPanel->SetSizer(m_pVbox);

Bind(wxEVT_TEXT_ENTER, &Layout::OnSendEnter, ID_SEND);
return 0;
}

enum ID
{
ID_SEND = wxID_HIGHEST+1,
ID_MENU_CONNECT,
ID_MENU_DISCONNECT
};


I have a feeling I am using the wrong overloaded function, but if I try and change the Bind() to



Bind(wxEVT_TEXT_ENTER, &Layout::OnSendEnter, this, ID_SEND);


I get an intellisense error: no instance of overloaded function "Layout::Bind matches the argument list. I am sure it is probably obvious for those more versed, so please explain my misunderstanding




1 commentaire: