this is my very first post to a forum and I hope nobody will laugh about my maybe simple question.
I wrote a long programme recognizing stamps in C++ using open cv. But to be honest I think I still miss some deep basics of C++.
I started to build a gui for my programme, with wxwidgets.
I created a frame with a notebook that contains many panels.
Code: Select all
Frame2::Frame2(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
{
this->SetSizeHints(wxDefaultSize, wxDefaultSize);
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer(wxVERTICAL);
m_notebook1 = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
m_panel1 = new MyPanel1(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_panel1->SetMaxSize(wxSize(-1, 20));
m_notebook1->AddPage(m_panel1, wxT("Marke suchen"), true);
m_panel2 = new MyPanel2(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_notebook1->AddPage(m_panel2, wxT("Marke editieren"), false);
m_panel3 = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_notebook1->AddPage(m_panel3, wxT("Marke ergaenzen"), false);
Now the question :
How can I access the m_panel2 from a function in m_panel1?
Code: Select all
void MyPanel1::openpicturedetails(wxCommandEvent& event)
{
int t;
t = event.GetId() - 11000;
m_panel2->SetFocus();
m_staticTextPanel02_T01->SetLabel(t);
}
And also the m_staticTextPanel02_T01 is part of m_panel2 and therefore also not known here.
This is the screen of m_panel1:
And when I click on a stamp I want to open the panel "Marke editieren" and handover some data to this panel.
But I really don't have a clue how to achieve that.
The function is already reacting correctly on the mouseclick and the content is stored correctly in variable t.
I hope my problem got clear. And I assume solution will be pretty easy.
But I don't have a clue how to find a solution for this in google or in my C++ bible.
Thanks for any advice
Stephan