Audacity 3.2.0
ListNavigationEnabled.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file ListNavigationEnabled.h
6
7 @author Vitaly Sverchinsky
8
9**********************************************************************/
10
11#pragma once
12
13#include <wx/window.h>
14#include <wx/event.h>
15#include <wx/containr.h>
16
23template<class WindowBase>
24class ListNavigationEnabled : public wxNavigationEnabled<WindowBase>
25{
26 friend void ListNavigationEnabled_HandleCharHook(wxWindow* self, wxKeyEvent& evt);
27 friend void ListNavigationEnabled_HandleKeyDown(wxWindow* self, wxKeyEvent& evt);
28 friend void ListNavigationEnabled_HandleNavigationKeyEvent(wxWindow* self, wxNavigationKeyEvent& evt);
29 friend void ListNavigationEnabled_HandleDestroy(wxWindow* self);
30
31public:
33 {
34 WindowBase::Bind(wxEVT_NAVIGATION_KEY, &ListNavigationEnabled::OnNavigationKeyEvent, this);
35 WindowBase::Bind(wxEVT_KEY_DOWN, &ListNavigationEnabled::OnKeyDown, this);
36 WindowBase::Bind(wxEVT_CHAR_HOOK, &ListNavigationEnabled::OnCharHook, this);
37 }
38
39private:
40 void SetFocus() override
41 {
42 //Prevent attempt to search for a focusable child
44 }
45
46 void OnCharHook(wxKeyEvent& evt)
47 {
49 }
50
51 void OnKeyDown(wxKeyEvent& evt)
52 {
54 }
55
56 void OnNavigationKeyEvent(wxNavigationKeyEvent& evt)
57 {
59 }
60
61 bool Destroy() override
62 {
64 return wxNavigationEnabled<WindowBase>::Destroy();
65 }
66};
Changes default arrow navigation to behave more list- or table-like. Instead of searching focusable i...
void OnCharHook(wxKeyEvent &evt)
friend void ListNavigationEnabled_HandleNavigationKeyEvent(wxWindow *self, wxNavigationKeyEvent &evt)
friend void ListNavigationEnabled_HandleDestroy(wxWindow *self)
void OnKeyDown(wxKeyEvent &evt)
void OnNavigationKeyEvent(wxNavigationKeyEvent &evt)
friend void ListNavigationEnabled_HandleKeyDown(wxWindow *self, wxKeyEvent &evt)
friend void ListNavigationEnabled_HandleCharHook(wxWindow *self, wxKeyEvent &evt)
void SetFocus(const WindowPlacement &focus)
Set the window that accepts keyboard input.
Definition: BasicUI.h:382