Audacity  2.2.2
BatchCommandDialog.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  BatchCommandDialog.h
6 
7  Dominic Mazzoni
8  James Crook
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_BATCH_COMMAND_DIALOG__
13 #define __AUDACITY_BATCH_COMMAND_DIALOG__
14 
15 #include <wx/defs.h>
16 #include <wx/string.h>
17 
18 
19 #ifdef __WXMSW__
20  #include <wx/ownerdrw.h>
21 #endif
22 
23 //#include "wx/log.h"
24 #include <wx/sizer.h>
25 #include <wx/menuitem.h>
26 #include <wx/checklst.h>
27 
28 class wxWindow;
29 class wxCheckBox;
30 class wxChoice;
31 class wxTextCtrl;
32 class wxStaticText;
33 class wxRadioButton;
34 class wxListCtrl;
35 class wxListEvent;
36 class wxButton;
37 class ShuttleGui;
38 
39 class BatchCommandDialog final : public wxDialogWrapper {
40  public:
41  // constructors and destructors
42  BatchCommandDialog(wxWindow *parent, wxWindowID id);
43  void SetCommandAndParams(const wxString &Command, const wxString &Params);
44  public:
45  wxString mSelectedCommand;
47  private:
48  void Populate();
50  void OnEditParams(wxCommandEvent &event);
51  void OnUsePreset(wxCommandEvent &event);
52  void OnChoice(wxCommandEvent &event);
53  void OnOk(wxCommandEvent &event);
54  void OnCancel(wxCommandEvent &event);
55  void OnItemSelected(wxListEvent &event);
56 
57  void ValidateChoices();
58  void PopulateCommandList();
59  //int GetSelectedItem();
60 
61  wxButton *mEditParams;
62  wxButton *mUsePreset;
63  wxListCtrl *mChoices;
64  wxTextCtrl * mCommand;
65  wxTextCtrl * mParameters;
66 
68 
69  using CommandName = std::pair<wxString, wxString>;
70  using CommandNameVector = std::vector<CommandName>;
72 
73  DECLARE_EVENT_TABLE()
74 };
75 
76 
77 #endif
void OnUsePreset(wxCommandEvent &event)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
void SetCommandAndParams(const wxString &Command, const wxString &Params)
std::vector< CommandName > CommandNameVector
std::pair< wxString, wxString > CommandName
void OnItemSelected(wxListEvent &event)
void OnEditParams(wxCommandEvent &event)
Abstract base class for command interface. It implements Command::SetParameter() and defers all other...
Definition: Command.h:70
wxTextCtrl * mParameters
Provides a list of configurable commands for use with BatchCommands.
void PopulateOrExchange(ShuttleGui &S)
void OnOk(wxCommandEvent &event)
BatchCommandDialog(wxWindow *parent, wxWindowID id)
void OnChoice(wxCommandEvent &event)
void OnCancel(wxCommandEvent &event)
CommandNameVector mCommandNames