Audacity  2.3.1
BackedPanel.h
Go to the documentation of this file.
1 //
2 // BackedPanel.h
3 // Audacity
4 //
5 // Created by Paul Licameli on 5/7/16.
6 //
7 //
8 
9 #ifndef __AUDACITY_BACKED_PANEL__
10 #define __AUDACITY_BACKED_PANEL__
11 
12 #include "../MemoryX.h"
13 #include <wx/dcmemory.h>
14 #include "wxPanelWrapper.h"
15 
16 
20 class AUDACITY_DLL_API BackedPanel /* not final */ : public wxPanelWrapper {
21 public:
22  BackedPanel(wxWindow * parent, wxWindowID id,
23  const wxPoint & pos,
24  const wxSize & size,
25  long style);
26 
27  ~BackedPanel();
28 
29  wxDC &GetBackingDC();
30  wxDC &GetBackingDCForRepaint();
31  void ResizeBacking();
32  void RepairBitmap(wxDC &dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height);
33  void DisplayBitmap(wxDC &dc);
34  void OnSize(wxSizeEvent & event);
35 
36 private:
37  std::unique_ptr<wxBitmap> mBacking;
38  wxMemoryDC mBackingDC;
39  bool mResizeBacking {};
40 
41  DECLARE_EVENT_TABLE()
42 };
43 
44 
45 #endif
wxMemoryDC mBackingDC
Definition: BackedPanel.h:38
static void OnSize(wxSizeEvent &evt)
Definition: VSTEffect.cpp:2763
BackedPanel is for a panel that consists of a bitmap with something drawn over it. It supports efficient repainting when the overlays change and recreation of the bitmap when the panel size is changed.
Definition: BackedPanel.h:20
std::unique_ptr< wxBitmap > mBacking
Definition: BackedPanel.h:37