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 
31  wxDC &GetBackingDCForRepaint();
32 
33  void ResizeBacking();
34 
35  void RepairBitmap(wxDC &dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height);
36 
37  void DisplayBitmap(wxDC &dc);
38 
39  void OnSize(wxSizeEvent & event);
40 
41 private:
42  std::unique_ptr<wxBitmap> mBacking;
43  wxMemoryDC mBackingDC;
44  bool mResizeBacking {};
45 
46  DECLARE_EVENT_TABLE()
47 };
48 
49 
50 #endif
wxMemoryDC mBackingDC
Definition: BackedPanel.h:43
static void OnSize(wxSizeEvent &evt)
Definition: VSTEffect.cpp:2765
BackedPanel is for a panel that consists of a bitmap with something drawn obver 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:42