Skip to content

Instantly share code, notes, and snippets.

@tomay3000
Created April 5, 2021 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomay3000/32ba8d64267df1bc3c6d847641656da6 to your computer and use it in GitHub Desktop.
Save tomay3000/32ba8d64267df1bc3c6d847641656da6 to your computer and use it in GitHub Desktop.
minimal 1
diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp
index 65da9f35b6..6b133114af 100644
--- a/samples/minimal/minimal.cpp
+++ b/samples/minimal/minimal.cpp
@@ -29,6 +29,8 @@
#include "wx/wx.h"
#endif
+#include <wx/artprov.h>
+
// ----------------------------------------------------------------------------
// resources
// ----------------------------------------------------------------------------
@@ -178,6 +180,21 @@ MyFrame::MyFrame(const wxString& title)
CreateStatusBar(2);
SetStatusText("Welcome to wxWidgets!");
#endif // wxUSE_STATUSBAR
+
+ wxBoxSizer* pBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
+ wxButton* pButton1 = new wxButton(this, wxID_ANY);
+ pBoxSizer1->Add(pButton1, 1, wxALL|wxEXPAND, 5);
+ wxButton* pButton2 = new wxButton(this, wxID_ANY);
+ pBoxSizer1->Add(pButton2, 1, wxALL|wxEXPAND, 5);
+ SetSizer(pBoxSizer1);
+ wxBitmap bmp = wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_BUTTON, wxSize(128, 128));
+ pButton1->SetBitmap(bmp);
+ pButton2->SetBitmap(bmp);
+ wxImage img = bmp.ConvertToImage();
+ img.ChangeSaturation(1);
+ pButton2->SetBitmapPressed(img);
+ pButton2->SetBitmapCurrent(img);
+ //pButton2->SetBitmapFocus(img);
}
diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp
index 65da9f35b6..6b133114af 100644
--- a/samples/minimal/minimal.cpp
+++ b/samples/minimal/minimal.cpp
@@ -29,6 +29,8 @@
#include "wx/wx.h"
#endif
+#include <wx/artprov.h>
+
// ----------------------------------------------------------------------------
// resources
// ----------------------------------------------------------------------------
@@ -178,6 +180,21 @@ MyFrame::MyFrame(const wxString& title)
CreateStatusBar(2);
SetStatusText("Welcome to wxWidgets!");
#endif // wxUSE_STATUSBAR
+
+ wxBoxSizer* pBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
+ wxButton* pButton1 = new wxButton(this, wxID_ANY);
+ pBoxSizer1->Add(pButton1, 1, wxALL|wxEXPAND, 5);
+ wxButton* pButton2 = new wxButton(this, wxID_ANY);
+ pBoxSizer1->Add(pButton2, 1, wxALL|wxEXPAND, 5);
+ SetSizer(pBoxSizer1);
+ wxBitmap bmp = wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_BUTTON, wxSize(128, 128));
+ pButton1->SetBitmap(bmp);
+ pButton2->SetBitmap(bmp);
+ wxImage img = bmp.ConvertToImage();
+ img.ChangeSaturation(1);
+ pButton2->SetBitmapPressed(img);
+ pButton2->SetBitmapCurrent(img);
+ //pButton2->SetBitmapFocus(img);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment