-
Notifications
You must be signed in to change notification settings - Fork 34
/
Choicebook.cpp
37 lines (31 loc) · 1.3 KB
/
Choicebook.cpp
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/choicebk.h>
#include <wx/frame.h>
#include <wx/panel.h>
namespace ChoicebookExample {
class Frame : public wxFrame {
public:
Frame() : wxFrame {nullptr, wxID_ANY, "Choicebook example"} {
SetClientSize(390, 270);
tabControl1->AddPage(tabpageRed, "Red page");
tabControl1->AddPage(tabpageGreen, "Green page");
tabControl1->AddPage(tabpageBlue, "Blue page");
tabControl1->AddPage(tabpageYellow, "Yellow page");
tabpageRed->SetBackgroundColour({255, 0, 0});
tabpageGreen->SetBackgroundColour({0, 128, 0});
tabpageBlue->SetBackgroundColour({0, 0, 255});
tabpageYellow->SetBackgroundColour({255, 255, 0});
}
private:
wxPanel* panel = new wxPanel {this};
wxChoicebook* tabControl1 = new wxChoicebook {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 {
bool OnInit() override {return (new Frame)->Show();}
};
}
wxIMPLEMENT_APP(ChoicebookExample::Application);