There is a frame that hold a sizer, this sizer is the parent of another box sizer, staticLine and wxSimpleBook, the first two children are shown without any problem, but the simple book no, the simple book is defined as a class, not a direct wxSimpleBook object.
This is my code:
Code: Select all
applicationsBox::applicationsBox(int orient) : wxBoxSizer(wxHORIZONTAL)
{
//some code
}
simpleBookBoxSizerClass::simpleBookBoxSizerClass(int orient) : wxBoxSizer(orient)
{
gridSizer = new wxGridSizer(3,3,wxDefaultSize);
gridSizer->SetMinSize(wxSize(-1,300));
}
simpleBook::simpleBook(wxWindow *parent) : wxSimplebook(parent)
{
wxNotebookPage* page = new wxNotebookPage(this,-1);
ShowNewPage(page);
simpleBookBoxSizerObject = new simpleBookBoxSizerClass(wxVERTICAL);
SetSizerAndFit(simpleBookBoxSizerObject);
SetMinSize(wxSize(-1,300));
}
frame::frame(const wxString & title) : wxFrame(NULL,wxID_ANY,title,wxDefaultPosition)
{
//put the panel in the sizer
mainBoxSizer = new wxBoxSizer(wxVERTICAL);
SetSizerAndFit(mainBoxSizer);
//this spacer will hold the two left and right buttons and the searchctrl
searchAndButtonsSizer = new wxBoxSizer(wxHORIZONTAL);
mainBoxSizer->Add(searchAndButtonsSizer,0,wxEXPAND);
searchAndButtonsSizer->SetMinSize(wxSize(-1,50));
//add a spacer first
searchAndButtonsSizer->AddStretchSpacer();
//then the left button that will change the wxBookCtrl pages
::wxInitAllImageHandlers();
wxBitmap leftButtonBitMap("../res/arrow-left.png",wxBITMAP_TYPE_PNG);
changePanelLeft = new wxBitmapButton(this,changePanelLeftID,leftButtonBitMap,wxPoint(265,7),wxSize(32,32));
leftButtonSizer = new wxBoxSizer(wxVERTICAL);
leftButtonSizer->AddSpacer(7);
leftButtonSizer->Add(changePanelLeft,0);
leftButtonSizer->AddSpacer(7);
searchAndButtonsSizer->Add(leftButtonSizer,0);
//add another spacer
searchAndButtonsSizer->AddSpacer(20);
//then the main searchCtrl
searchCtrl = new wxSearchCtrl(this,wxID_ANY,"");
searchCtrl->SetMinSize(wxSize(180,45));
searchCtrl->SetMaxSize(wxSize(200,45));
searchCtrl->SetDescriptiveText("search");
searchCtrl->ShowSearchButton(true);
searchAndButtonsSizer->Add(searchCtrl,1,wxEXPAND);
//add a spacer
searchAndButtonsSizer->AddSpacer(20);
//this is the right button
wxBitmap rightButtonBitMap("../res/arrow-right.png",wxBITMAP_TYPE_PNG);
changePanelRight = new wxBitmapButton(this,changePanelRightID,rightButtonBitMap,wxPoint(510,7),wxSize(32,32));
rightButtonSizer = new wxBoxSizer(wxVERTICAL);
rightButtonSizer->AddSpacer(7);
rightButtonSizer->Add(changePanelRight,0);
rightButtonSizer->AddSpacer(7);
searchAndButtonsSizer->Add(rightButtonSizer,0);
searchAndButtonsSizer->AddStretchSpacer();
//a static line for appearence
staticLine = new wxStaticLine(this,wxID_ANY,wxDefaultPosition,wxSize(-1,3));
mainBoxSizer->Add(staticLine,0,wxEXPAND);
//now add a spacer
mainBoxSizer->AddSpacer(5);
mainSimpleBook = new simpleBook(this);
mainSimpleBook->Show();
mainBoxSizer->Add(mainSimpleBook,1,wxEXPAND,wxALL);
}
Code: Select all
[build] /home/mamograg/Documents/C++ projects/grab/src/gui.cpp: In constructor ‘applicationsBox::applicationsBox(int)’:
[build] /home/mamograg/Documents/C++ projects/grab/src/gui.cpp:25:81: error: no matching function for call to ‘wxStaticBitmap::wxStaticBitmap(applicationsBox*, int, wxBitmap)’
[build] 25 | applicationImage = new wxStaticBitmap(this,-1,wxBitmap(path,wxBITMAP_TYPE_PNG));
[build] | ^
[build] In file included from /usr/local/include/wx-3.1/wx/statbmp.h:72,
[build] from /home/mamograg/Documents/C++ projects/grab/src/gui.hpp:28,
[build] from /home/mamograg/Documents/C++ projects/grab/src/gui.cpp:11:
[build] /usr/local/include/wx-3.1/wx/gtk/statbmp.h:22:5: note: candidate: ‘wxStaticBitmap::wxStaticBitmap(wxWindow*, wxWindowID, const wxBitmapBundle&, const wxPoint&, const wxSize&, long int, const wxString&)’
[build] 22 | wxStaticBitmap( wxWindow *parent,
[build] | ^~~~~~~~~~~~~~
[build] /usr/local/include/wx-3.1/wx/gtk/statbmp.h:22:31: note: no known conversion for argument 1 from ‘applicationsBox*’ to ‘wxWindow*’
[build] 22 | wxStaticBitmap( wxWindow *parent,
[build] | ~~~~~~~~~~^~~~~~
[build] /usr/local/include/wx-3.1/wx/gtk/statbmp.h:21:5: note: candidate: ‘wxStaticBitmap::wxStaticBitmap()’
[build] 21 | wxStaticBitmap();
[build] | ^~~~~~~~~~~~~~
[build] /usr/local/include/wx-3.1/wx/gtk/statbmp.h:21:5: note: candidate expects 0 arguments, 3 provided
[build] [2/3 66% :: 20.179] Building CXX object CMakeFiles/grab.dir/src/application.cpp.o
[build] ninja: build stopped: subcommand failed.
[proc] The command: /usr/bin/cmake --build "/home/mamograg/Documents/C++ projects/grab/build" --config Debug --target all -j 3 -- exited with code: 1 and signal: null