开发者

How to implement wxScrolledWindow without changing the whole project?

开发者 https://www.devze.com 2023-04-06 07:57 出处:网络
I have a UI, whose class is initialized as such: class SimpleUI : public wxFrame From the main.cpp, I initialize:

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消