Audacity 3.2.0
wxPanelWrapper.cpp
Go to the documentation of this file.
1//
2// wxPanelWrapper.cpp
3// Audacity
4//
5// Created by Paul Licameli on 6/25/16.
6//
7//
8
9#include "wxPanelWrapper.h"
10
11#include <wx/grid.h>
12
13void wxTabTraversalWrapperCharHook(wxKeyEvent &event)
14{
15//#ifdef __WXMAC__
16#if defined(__WXMAC__) || defined(__WXGTK__)
17 // Compensate for the regressions in TAB key navigation
18 // due to the switch to wxWidgets 3.0.2
19 if (event.GetKeyCode() == WXK_TAB) {
20 auto focus = wxWindow::FindFocus();
21 if (dynamic_cast<wxGrid*>(focus)
22 || (focus &&
23 focus->GetParent() &&
24 dynamic_cast<wxGrid*>(focus->GetParent()->GetParent()))) {
25 // Let wxGrid do its own TAB key handling
26 event.Skip();
27 return;
28 }
29 // Apparently, on wxGTK, FindFocus can return NULL
30 if (focus)
31 {
32 focus->Navigate(
33 event.ShiftDown()
34 ? wxNavigationKeyEvent::IsBackward
35 : wxNavigationKeyEvent::IsForward
36 );
37 return;
38 }
39 }
40#endif
41
42 event.Skip();
43}
44
46{
47 wxPanel::SetLabel( label.Translation() );
48}
49
51{
52 wxPanel::SetName( name.Translation() );
53}
54
56{
57 wxPanel::SetToolTip( toolTip.Stripped().Translation() );
58}
59
61{
62 wxPanel::SetName( GetLabel() );
63}
64
66{
67 wxDialog::SetTitle( title.Translation() );
68}
69
71{
72 wxDialog::SetLabel( label.Translation() );
73}
74
76{
77 wxDialog::SetName( name.Translation() );
78}
79
81{
82 wxDialog::SetName( wxDialog::GetTitle() );
83}
84
const TranslatableString name
Definition: Distortion.cpp:76
static const auto title
TranslatableString label
Definition: TagsEditor.cpp:165
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
void SetTitle(const TranslatableString &title)
void SetLabel(const TranslatableString &title)
void SetToolTip(const TranslatableString &toolTip)
void SetLabel(const TranslatableString &label)
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:375
void wxTabTraversalWrapperCharHook(wxKeyEvent &event)