-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathNotebook.cpp
More file actions
37 lines (31 loc) · 1.37 KB
/
Notebook.cpp
File metadata and controls
37 lines (31 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <wx/app.h>
#include <wx/frame.h>
#include <wx/notebook.h>
#include <wx/panel.h>
namespace NotebookExample {
class Frame : public wxFrame {
public:
Frame() : wxFrame {nullptr, wxID_ANY, "Notebook example"} {
SetClientSize(390, 270);
tabControl1->AddPage(tabPageRed, "Red", true);
tabControl1->AddPage(tabPageGreen, "Green");
tabControl1->AddPage(tabPageBlue, "Blue");
tabControl1->AddPage(tabPageYellow, "Yellow");
tabPageRed->SetBackgroundColour(wxTheColourDatabase->Find("Red"));
tabPageGreen->SetBackgroundColour(wxTheColourDatabase->Find("Forest Green"));
tabPageBlue->SetBackgroundColour(wxTheColourDatabase->Find("Blue"));
tabPageYellow->SetBackgroundColour(wxTheColourDatabase->Find("Yellow"));
}
private:
wxPanel* panel = new wxPanel {this};
wxNotebook* tabControl1 = new wxNotebook {panel, wxID_ANY, {10, 10}, {370, 250}};
wxNotebookPage* tabPageRed = new wxNotebookPage {tabControl1, wxID_ANY};
wxNotebookPage* tabPageGreen = new wxNotebookPage {tabControl1, wxID_ANY};
wxNotebookPage* tabPageBlue = new wxNotebookPage {tabControl1, wxID_ANY};
wxNotebookPage* tabPageYellow = new wxNotebookPage {tabControl1, wxID_ANY};
};
class Application : public wxApp {
auto OnInit() -> bool override {return (new Frame)->Show();}
};
}
wxIMPLEMENT_APP(NotebookExample::Application);