From 4faf7d45de7f6ee060a6d21f401b1372215c5af5 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 7 Apr 2021 09:07:42 -0700 Subject: [PATCH] Avoid assert failure in shaped sample wxBG_STYLE_TRANSPARENT cannot be changed after creation --- samples/shaped/shaped.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/samples/shaped/shaped.cpp b/samples/shaped/shaped.cpp index 3c79ed73f5..95011739ed 100644 --- a/samples/shaped/shaped.cpp +++ b/samples/shaped/shaped.cpp @@ -138,7 +138,6 @@ public: private: // event handlers (these functions should _not_ be virtual) - void OnDoubleClick(wxMouseEvent& evt); void OnPaint(wxPaintEvent& evt); // any class wishing to process wxWidgets events must use this macro @@ -472,14 +471,13 @@ void ShapedFrame::OnPaint(wxPaintEvent& WXUNUSED(evt)) // ---------------------------------------------------------------------------- wxBEGIN_EVENT_TABLE(SeeThroughFrame, wxFrame) - EVT_LEFT_DCLICK(SeeThroughFrame::OnDoubleClick) EVT_PAINT(SeeThroughFrame::OnPaint) wxEND_EVENT_TABLE() void SeeThroughFrame::Create() { SetBackgroundStyle(wxBG_STYLE_TRANSPARENT); - wxFrame::Create(NULL, wxID_ANY, "Transparency test: double click here", + wxFrame::Create(NULL, wxID_ANY, "Transparency test", wxPoint(100, 30), wxSize(300, 300), wxDEFAULT_FRAME_STYLE | wxFULL_REPAINT_ON_RESIZE | @@ -517,13 +515,3 @@ void SeeThroughFrame::OnPaint(wxPaintEvent& WXUNUSED(evt)) } } } - -void SeeThroughFrame::OnDoubleClick(wxMouseEvent& WXUNUSED(evt)) -{ - SetBackgroundStyle(wxBG_STYLE_PAINT); - SetTransparent(255); - SetTitle("Opaque"); - - Refresh(); -} -