Audacity  3.0.3
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 
10 #include "wxPanelWrapper.h"
11 
12 #include <wx/grid.h>
13 
14 void wxTabTraversalWrapperCharHook(wxKeyEvent &event)
15 {
16 //#ifdef __WXMAC__
17 #if defined(__WXMAC__) || defined(__WXGTK__)
18  // Compensate for the regressions in TAB key navigation
19  // due to the switch to wxWidgets 3.0.2
20  if (event.GetKeyCode() == WXK_TAB) {
21  auto focus = wxWindow::FindFocus();
22  if (dynamic_cast<wxGrid*>(focus)
23  || (focus &&
24  focus->GetParent() &&
25  dynamic_cast<wxGrid*>(focus->GetParent()->GetParent()))) {
26  // Let wxGrid do its own TAB key handling
27  event.Skip();
28  return;
29  }
30  // Apparently, on wxGTK, FindFocus can return NULL
31  if (focus)
32  {
33  focus->Navigate(
34  event.ShiftDown()
35  ? wxNavigationKeyEvent::IsBackward
36  : wxNavigationKeyEvent::IsForward
37  );
38  return;
39  }
40  }
41 #endif
42 
43  event.Skip();
44 }
45 
47 {
48  wxPanel::SetLabel( label.Translation() );
49 }
50 
52 {
53  wxPanel::SetName( name.Translation() );
54 }
55 
57 {
58  wxPanel::SetToolTip( toolTip.Stripped().Translation() );
59 }
60 
62 {
63  wxPanel::SetName( GetLabel() );
64 }
65 
67 {
68  wxDialog::SetTitle( title.Translation() );
69 }
70 
72 {
73  wxDialog::SetLabel( label.Translation() );
74 }
75 
77 {
78  wxDialog::SetName( name.Translation() );
79 }
80 
82 {
83  wxDialog::SetName( wxDialog::GetTitle() );
84 }
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
wxPanelWrapper::SetToolTip
void SetToolTip(const TranslatableString &toolTip)
Definition: wxPanelWrapper.cpp:56
wxPanelWrapper::SetLabel
void SetLabel(const TranslatableString &label)
Definition: wxPanelWrapper.cpp:46
wxPanelWrapper.h
wxDialogWrapper::SetLabel
void SetLabel(const TranslatableString &title)
Definition: wxPanelWrapper.cpp:71
wxTabTraversalWrapperCharHook
void wxTabTraversalWrapperCharHook(wxKeyEvent &event)
Definition: wxPanelWrapper.cpp:14
label
TranslatableString label
Definition: Tags.cpp:756
name
const TranslatableString name
Definition: Distortion.cpp:98
wxPanelWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:61
title
static const auto title
Definition: NoUpdatesAvailableDialog.cpp:22
wxDialogWrapper::SetTitle
void SetTitle(const TranslatableString &title)
Definition: wxPanelWrapper.cpp:66
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
TranslatableString::Stripped
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
Definition: TranslatableString.h:198