Audacity  2.3.1
OverlayPanel.h
Go to the documentation of this file.
1 //
2 // OverlayPanel.h
3 // Audacity
4 //
5 // Created by Paul Licameli on 5/1/16.
6 //
7 //
8 
9 #ifndef __AUDACITY_OVERLAY_PANEL__
10 #define __AUDACITY_OVERLAY_PANEL__
11 
12 #include <vector>
13 #include "BackedPanel.h"
14 
15 class Overlay;
16 
17 class AUDACITY_DLL_API OverlayPanel /* not final */ : public BackedPanel {
18 public:
19  OverlayPanel(wxWindow * parent, wxWindowID id,
20  const wxPoint & pos,
21  const wxSize & size,
22  // default as for wxPanel:
23  long style = wxTAB_TRAVERSAL | wxNO_BORDER);
24 
25  // Registers and unregisters overlay objects.
26  // The sequence in which they were registered is the sequence in
27  // which they are painted.
28  // OverlayPanel is not responsible for their memory management.
29  void AddOverlay(Overlay *pOverlay);
30  // Returns true if the overlay was found
31  bool RemoveOverlay(Overlay *pOverlay);
32  void ClearOverlays();
33 
34  // Erases and redraws to the client area the overlays that have
35  // been previously added with AddOverlay(). If "repaint_all" is
36  // true, all overlays will be erased and re-drawn. Otherwise, only
37  // the ones that are out-of-date, as well as the intersecting ones,
38  // will be erased and re-drawn.
39  // pDC can be null, in which case, DrawOverlays() will create a
40  // wxClientDC internally when necessary.
41  void DrawOverlays(bool repaint_all, wxDC *pDC = nullptr);
42 
43 private:
44  std::vector<Overlay*> mOverlays;
45 
46 
47  DECLARE_EVENT_TABLE()
48  friend class GetInfoCommand;
49 };
50 
51 #endif
std::vector< Overlay * > mOverlays
Definition: OverlayPanel.h:44
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
Command which outputs a list of available menu commands on the status channel.