-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathBitmapButtonWithLabel.cpp
More file actions
40 lines (33 loc) · 1.28 KB
/
BitmapButtonWithLabel.cpp
File metadata and controls
40 lines (33 loc) · 1.28 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
38
39
40
#include "gammasoft_16x16.xpm"
#include "gammasoft_32x32.xpm"
#include "gammasoft_64x64.xpm"
#include <wx/app.h>
#include <wx/button.h>
#include <wx/frame.h>
#include <wx/panel.h>
namespace BitmapButtonWithLabelExample {
class Frame : public wxFrame {
public:
Frame() : wxFrame {nullptr, wxID_ANY, "BitmapButton with label example"} {
button1->SetSize(100, 25);
button2->SetBitmapLabel(wxBitmap {gammasoft_16x16_xpm});
button2->SetBitmapPosition(wxLEFT);
button2->SetSize(120, 25);
button3->SetBitmapLabel(wxBitmap {gammasoft_32x32_xpm});
button3->SetBitmapPosition(wxLEFT);
button3->SetSize(140, 40);
button4->SetBitmapLabel(wxBitmap {gammasoft_64x64_xpm});
button4->SetSize(70, 70);
}
private:
wxPanel* panel = new wxPanel {this};
wxButton* button1 = new wxButton {panel, wxID_ANY, "Gammasoft", {50, 20}};
wxButton* button2 = new wxButton {panel, wxID_ANY, "Gammasoft", {50, 50}};
wxButton* button3 = new wxButton {panel, wxID_ANY, "Gammasoft", {50, 80}};
wxButton* button4 = new wxButton {panel, wxID_ANY, wxEmptyString, {50, 125}};
};
class Application : public wxApp {
bool OnInit() override {return (new Frame)->Show();}
};
}
wxIMPLEMENT_APP(BitmapButtonWithLabelExample::Application);