Audacity  2.2.2
wxPanelWrapper.h
Go to the documentation of this file.
1 //
2 // wxPanelWrapper.h
3 // Audacity
4 //
5 // Created by Paul Licameli on 6/25/16.
6 //
7 //
8 
9 #ifndef __AUDACITY_WXPANEL_WRAPPER__
10 #define __AUDACITY_WXPANEL_WRAPPER__
11 
12 #include "../MemoryX.h"
13 #include <wx/panel.h>
14 #include <wx/dialog.h>
15 
16 #include "../Internat.h"
17 
18 void wxTabTraversalWrapperCharHook(wxKeyEvent &event);
19 
20 template <typename Base>
21 class AUDACITY_DLL_API wxTabTraversalWrapper : public Base
22 {
23 public:
24  template <typename... Args>
25  wxTabTraversalWrapper(Args&&... args)
26  : Base( std::forward<Args>(args)... )
27  {
28  this->Bind(wxEVT_CHAR_HOOK, wxTabTraversalWrapperCharHook);
29  }
30 };
31 
32 class AUDACITY_DLL_API wxPanelWrapper : public wxTabTraversalWrapper<wxPanel>
33 {
34 public:
35  // Constructors
37 
39  wxWindow *parent,
40  wxWindowID winid = wxID_ANY,
41  const wxPoint& pos = wxDefaultPosition,
42  const wxSize& size = wxDefaultSize,
43  long style = wxTAB_TRAVERSAL | wxNO_BORDER,
44  // Important: default window name localizes!
45  const wxString& name = _("Panel"))
46  : wxTabTraversalWrapper<wxPanel> ( parent, winid, pos, size, style, name )
47  {}
48 
49  // Pseudo ctor
50  bool Create(
51  wxWindow *parent,
52  wxWindowID winid = wxID_ANY,
53  const wxPoint& pos = wxDefaultPosition,
54  const wxSize& size = wxDefaultSize,
55  long style = wxTAB_TRAVERSAL | wxNO_BORDER,
56  // Important: default window name localizes!
57  const wxString& name = _("Panel"))
58  {
60  parent, winid, pos, size, style, name
61  );
62  }
63 };
64 
65 class AUDACITY_DLL_API wxDialogWrapper : public wxTabTraversalWrapper<wxDialog>
66 {
67 public:
68  // Constructors
70 
71  // Constructor with no modal flag - the new convention.
73  wxWindow *parent, wxWindowID id,
74  const wxString& title,
75  const wxPoint& pos = wxDefaultPosition,
76  const wxSize& size = wxDefaultSize,
77  long style = wxDEFAULT_DIALOG_STYLE,
78  // Important: default window name localizes!
79  const wxString& name = _("Dialog"))
80  : wxTabTraversalWrapper<wxDialog>
81  ( parent, id, title, pos, size, style, name )
82  {}
83 
84  // Pseudo ctor
85  bool Create(
86  wxWindow *parent, wxWindowID id,
87  const wxString& title,
88  const wxPoint& pos = wxDefaultPosition,
89  const wxSize& size = wxDefaultSize,
90  long style = wxDEFAULT_DIALOG_STYLE,
91  // Important: default window name localizes!
92  const wxString& name = _("Dialog"))
93  {
95  parent, id, title, pos, size, style, name
96  );
97  }
98 };
99 
100 #include <wx/dirdlg.h>
101 
102 class AUDACITY_DLL_API wxDirDialogWrapper : public wxTabTraversalWrapper<wxDirDialog>
103 {
104 public:
105  // Constructor with no modal flag - the new convention.
107  wxWindow *parent,
108  const wxString& message = _("Select a directory"),
109  const wxString& defaultPath = wxT(""),
110  long style = wxDD_DEFAULT_STYLE,
111  const wxPoint& pos = wxDefaultPosition,
112  const wxSize& size = wxDefaultSize,
113  // Important: default window name localizes!
114  const wxString& name = _("Directory Dialog"))
115  : wxTabTraversalWrapper<wxDirDialog>
116  ( parent, message, defaultPath, style, pos, size, name )
117  {}
118 
119  // Pseudo ctor
120  void Create(
121  wxWindow *parent,
122  const wxString& message = _("Select a directory"),
123  const wxString& defaultPath = wxT(""),
124  long style = wxDD_DEFAULT_STYLE,
125  const wxPoint& pos = wxDefaultPosition,
126  const wxSize& size = wxDefaultSize,
127  // Important: default window name localizes!
128  const wxString& name = _("Directory Dialog"))
129  {
131  parent, message, defaultPath, style, pos, size, name
132  );
133  }
134 };
135 
136 #include "../lib-src/FileDialog/FileDialog.h"
137 
138 class AUDACITY_DLL_API FileDialogWrapper : public wxTabTraversalWrapper<FileDialog>
139 {
140 public:
142 
143  // Constructor with no modal flag - the new convention.
145  wxWindow *parent,
146  const wxString& message = _("Select a file"),
147  const wxString& defaultDir = wxEmptyString,
148  const wxString& defaultFile = wxEmptyString,
149  const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
150  long style = wxFD_DEFAULT_STYLE,
151  const wxPoint& pos = wxDefaultPosition,
152  const wxSize& sz = wxDefaultSize,
153  // Important: default window name localizes!
154  const wxString& name = _("File Dialog"))
156  ( parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name )
157  {}
158 
159  // Pseudo ctor
160  void Create(
161  wxWindow *parent,
162  const wxString& message = _("Select a file"),
163  const wxString& defaultDir = wxEmptyString,
164  const wxString& defaultFile = wxEmptyString,
165  const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
166  long style = wxFD_DEFAULT_STYLE,
167  const wxPoint& pos = wxDefaultPosition,
168  const wxSize& sz = wxDefaultSize,
169  // Important: default window name localizes!
170  const wxString& name = _("File Dialog"))
171  {
173  parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name
174  );
175  }
176 };
177 
178 #endif
FileDialogWrapper(wxWindow *parent, const wxString &message=_("Select a file"), const wxString &defaultDir=wxEmptyString, const wxString &defaultFile=wxEmptyString, const wxString &wildCard=wxFileSelectorDefaultWildcardStr, long style=wxFD_DEFAULT_STYLE, const wxPoint &pos=wxDefaultPosition, const wxSize &sz=wxDefaultSize, const wxString &name=_("File Dialog"))
Dialog used to present platform specific "Save As" dialog with custom controls.
void Create(wxWindow *parent, const wxString &message=_("Select a directory"), const wxString &defaultPath=wxT(""), long style=wxDD_DEFAULT_STYLE, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const wxString &name=_("Directory Dialog"))
wxTabTraversalWrapper(Args &&...args)
wxPanelWrapper(wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
void Create(wxWindow *parent, const wxString &message=_("Select a file"), const wxString &defaultDir=wxEmptyString, const wxString &defaultFile=wxEmptyString, const wxString &wildCard=wxFileSelectorDefaultWildcardStr, long style=wxFD_DEFAULT_STYLE, const wxPoint &pos=wxDefaultPosition, const wxSize &sz=wxDefaultSize, const wxString &name=_("File Dialog"))
wxDirDialogWrapper(wxWindow *parent, const wxString &message=_("Select a directory"), const wxString &defaultPath=wxT(""), long style=wxDD_DEFAULT_STYLE, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const wxString &name=_("Directory Dialog"))
void wxTabTraversalWrapperCharHook(wxKeyEvent &event)
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
const wxChar * name
Definition: Distortion.cpp:94
bool Create(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
wxDialogWrapper(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
bool Create(wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))