forked from audacity/audacity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwxPanelWrapper.cpp
More file actions
84 lines (72 loc) · 1.85 KB
/
Copy pathwxPanelWrapper.cpp
File metadata and controls
84 lines (72 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// wxPanelWrapper.cpp
// Audacity
//
// Created by Paul Licameli on 6/25/16.
//
//
#include "../Audacity.h"
#include "wxPanelWrapper.h"
#include <wx/grid.h>
void wxTabTraversalWrapperCharHook(wxKeyEvent &event)
{
//#ifdef __WXMAC__
#if defined(__WXMAC__) || defined(__WXGTK__)
// Compensate for the regressions in TAB key navigation
// due to the switch to wxWidgets 3.0.2
if (event.GetKeyCode() == WXK_TAB) {
auto focus = wxWindow::FindFocus();
if (dynamic_cast<wxGrid*>(focus)
|| (focus &&
focus->GetParent() &&
dynamic_cast<wxGrid*>(focus->GetParent()->GetParent()))) {
// Let wxGrid do its own TAB key handling
event.Skip();
return;
}
// Apparently, on wxGTK, FindFocus can return NULL
if (focus)
{
focus->Navigate(
event.ShiftDown()
? wxNavigationKeyEvent::IsBackward
: wxNavigationKeyEvent::IsForward
);
return;
}
}
#endif
event.Skip();
}
void wxPanelWrapper::SetLabel(const TranslatableString & label)
{
wxPanel::SetLabel( label.Translation() );
}
void wxPanelWrapper::SetName(const TranslatableString & name)
{
wxPanel::SetName( name.Translation() );
}
void wxPanelWrapper::SetToolTip(const TranslatableString &toolTip)
{
wxPanel::SetToolTip( toolTip.Stripped().Translation() );
}
void wxPanelWrapper::SetName()
{
wxPanel::SetName( GetLabel() );
}
void wxDialogWrapper::SetTitle(const TranslatableString & title)
{
wxDialog::SetTitle( title.Translation() );
}
void wxDialogWrapper::SetLabel(const TranslatableString & label)
{
wxDialog::SetLabel( label.Translation() );
}
void wxDialogWrapper::SetName(const TranslatableString & name)
{
wxDialog::SetName( name.Translation() );
}
void wxDialogWrapper::SetName()
{
wxDialog::SetName( wxDialog::GetTitle() );
}