Audacity 3.2.0
ListNavigationPanel.cpp
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file ListNavigationPanel.cpp
6
7 @author Vitaly Sverchinsky
8
9**********************************************************************/
10
11#include "ListNavigationPanel.h"
12#include "AColor.h"
13#include <wx/dcbuffer.h>
14
16 wxWindowID id,
17 const wxPoint& pos,
18 const wxSize& size,
19 const wxString& name)
20{
21 Create(parent, id, pos, size, name);
22}
23
24void ListNavigationPanel::Create(wxWindow* parent,
25 wxWindowID id,
26 const wxPoint& pos,
27 const wxSize& size,
28 const wxString& name)
29{
30 SetBackgroundStyle(wxBG_STYLE_PAINT);
31 ListNavigationEnabled<wxWindow>::Create(parent, id, pos, size, wxNO_BORDER | wxWANTS_CHARS, name);
32 Bind(wxEVT_PAINT, &ListNavigationPanel::OnPaint, this);
33 Bind(wxEVT_SET_FOCUS, &ListNavigationPanel::OnChangeFocus, this);
34 Bind(wxEVT_KILL_FOCUS, &ListNavigationPanel::OnChangeFocus, this);
35}
36
38{
39 Refresh(false);
40}
41
42void ListNavigationPanel::OnPaint(wxPaintEvent& evt)
43{
44 wxBufferedPaintDC dc(this);
45
46 dc.SetPen(*wxTRANSPARENT_PEN);
47 dc.SetBrush(GetBackgroundColour());
48 dc.Clear();
49
50 if(HasFocus())
51 AColor::DrawFocus(dc, GetClientRect().Deflate(3, 3));
52}
wxString name
Definition: TagsEditor.cpp:166
static void DrawFocus(wxDC &dc, wxRect &r)
Definition: AColor.cpp:247
Changes default arrow navigation to behave more list- or table-like. Instead of searching focusable i...
void OnPaint(wxPaintEvent &evt)
ListNavigationPanel()=default
void Create(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const wxString &name=wxPanelNameStr)
void OnChangeFocus(wxFocusEvent &evt)