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,
29 wxNavigationKeyEvent& evt, bool inTabOrder);
30 friend void ListNavigationEnabled_HandleDestroy(wxWindow* self);
31
32public:
34 {
35 WindowBase::Bind(wxEVT_NAVIGATION_KEY, &ListNavigationEnabled::OnNavigationKeyEvent, this);
36 WindowBase::Bind(wxEVT_KEY_DOWN, &ListNavigationEnabled::OnKeyDown, this);
37 WindowBase::Bind(wxEVT_CHAR_HOOK, &ListNavigationEnabled::OnCharHook, this);
38 }
39
40 void SetInTabOrder(bool inTabOrder) { mInTabOrder = inTabOrder; }
41
42private:
43 void SetFocus() override
44 {
45 //Prevent attempt to search for a focusable child
47 }
48
49 void OnCharHook(wxKeyEvent& evt)
50 {
52 }
53
54 void OnKeyDown(wxKeyEvent& evt)
55 {
57 }
58
59 void OnNavigationKeyEvent(wxNavigationKeyEvent& evt)
60 {
62 }
63
64 bool Destroy() override
65 {
67 return wxNavigationEnabled<WindowBase>::Destroy();
68 }
69
70 bool mInTabOrder{ true };
71};
Changes default arrow navigation to behave more list- or table-like. Instead of searching focusable i...
friend void ListNavigationEnabled_HandleNavigationKeyEvent(wxWindow *self, wxNavigationKeyEvent &evt, bool inTabOrder)
void OnCharHook(wxKeyEvent &evt)
friend void ListNavigationEnabled_HandleDestroy(wxWindow *self)
void OnKeyDown(wxKeyEvent &evt)
void OnNavigationKeyEvent(wxNavigationKeyEvent &evt)
void SetInTabOrder(bool inTabOrder)
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:392