How to implement wxScrolledWindow without changing the whole project?
I have a UI, whose class is initialized as such:
class SimpleUI : public wxFrame
From the main.cpp, I initialize:
SimpleUI *ui = new SimpleUI(wxT("Simple User Interface"));
ui->Show();
After some progressing, I realized that I needed a vertical and horizontal scrollbar to be able to use that UI on computers, which have smaller screen resolutions. Now I want to change my wxFrame rooted SimpleUI class with wxScrolledWindow. I replaced wxFrame with wxScrolledWindow, but it can't be initialized without any parent window.
What should I do to implement toolbars to my project? Are ther开发者_如何学编程e alternatives?
Thanks.
There seem to be two questions here. A suggestion for the first question:
class SimpleUI : public wxScrolledWindow
{
SimpleUI( wxWindow * parent )
: wxScrolledWindow( parent )
{
...
}
...
}
SimpleUI *ui = new SimpleUI( new wxFrame(NULL,-1,wxT("Simple User Interface")));
ui->Show();
精彩评论