Audacity  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MultiDialog Class Referencefinal

A multi purpose dialog, mainly used to show lists of orphaned or damaged block files. It is a good alternative to having a dialog pop up for each problem encountered, since there can be many orphans. More...

Inheritance diagram for MultiDialog:
wxDialogWrapper wxTabTraversalWrapper< wxDialog >

Public Member Functions

 MultiDialog (wxWindow *pParent, wxString message, wxString title, const wxChar **buttons, wxString boxMsg, bool log)
 
 ~MultiDialog ()
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 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 id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&...args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void OnOK (wxCommandEvent &event)
 
void OnShowLog (wxCommandEvent &event)
 

Private Attributes

wxRadioBox * mRadioBox
 

Detailed Description

A multi purpose dialog, mainly used to show lists of orphaned or damaged block files. It is a good alternative to having a dialog pop up for each problem encountered, since there can be many orphans.

Definition at line 39 of file MultiDialog.cpp.

Constructor & Destructor Documentation

MultiDialog::MultiDialog ( wxWindow *  pParent,
wxString  message,
wxString  title,
const wxChar **  buttons,
wxString  boxMsg,
bool  log 
)

Definition at line 64 of file MultiDialog.cpp.

References _(), and safenew.

68  : wxDialogWrapper(pParent, wxID_ANY, title,
69  wxDefaultPosition, wxDefaultSize,
70  wxCAPTION) // not wxDEFAULT_DIALOG_STYLE because we don't want wxCLOSE_BOX and wxSYSTEM_MENU
71 {
72  SetName(GetTitle());
73 
74  wxBoxSizer *mainSizer;
75  {
76  auto uMainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
77  mainSizer = uMainSizer.get();
78 
79  {
80  auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
81  {
82  auto iconAndTextSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
83 
84  wxBitmap bitmap = wxArtProvider::GetIcon(wxART_WARNING,
85  wxART_MESSAGE_BOX);
86  wxStaticBitmap *icon = safenew wxStaticBitmap(this, -1, bitmap);
87  iconAndTextSizer->Add(icon, 0, wxCENTER);
88 
89  wxStaticText *statText = safenew wxStaticText(this, -1, message);
90  statText->SetName(message); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
91  iconAndTextSizer->Add(statText, 1, wxCENTER | wxLEFT, 15);
92 
93  vSizer->Add(iconAndTextSizer.release(), 0, wxALIGN_LEFT | wxALL, 5);
94  }
95 
96  size_t count = 0;
97  while (buttons[count])count++;
98  ArrayOf<wxString> buttonLabels{ count };
99 
100  count = 0;
101  while (buttons[count]){
102  buttonLabels[count] = buttons[count];
103  count++;
104  }
105 
106  mRadioBox = safenew wxRadioBox(this, -1,
107  boxMsg,
108  wxDefaultPosition, wxDefaultSize,
109  count, buttonLabels.get(),
110  1, wxRA_SPECIFY_COLS);
111  mRadioBox->SetName(boxMsg);
112  mRadioBox->SetSelection(0);
113  vSizer->Add(mRadioBox, 1, wxEXPAND | wxALIGN_CENTER | wxALL, 5);
114 
115 
116  {
117  auto buttonSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
118 
119  wxButton* pButton;
120  if (log)
121  {
122  pButton = safenew wxButton(this, ID_SHOW_LOG_BUTTON, _("Show Log for Details"));
123  buttonSizer->Add(pButton, 0, wxALIGN_LEFT | wxALL, 5);
124  pButton->SetDefault(); // Encourage user to look at files.
125 
126  buttonSizer->AddSpacer(40);
127  }
128 
129  pButton = safenew wxButton(this, wxID_OK, _("OK"));
130  if (!log)
131  pButton->SetDefault();
132  buttonSizer->Add(pButton, 0, wxALIGN_RIGHT | wxALL, 5);
133 
134  vSizer->Add(buttonSizer.release(), 0, wxALIGN_CENTER | wxALL, 5);
135  }
136 
137  mainSizer->Add(vSizer.release(), 0, wxALL, 5);
138  }
139 
140  SetAutoLayout(true);
141  SetSizer(uMainSizer.release());
142  }
143 
144  mainSizer->Fit(this);
145  mainSizer->SetSizeHints(this);
146 }
wxRadioBox * mRadioBox
Definition: MultiDialog.cpp:52
#define ID_SHOW_LOG_BUTTON
Definition: MultiDialog.cpp:57
#define safenew
Definition: Audacity.h:230
_("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
Memory.h template class for making an array of float, bool, etc.
Definition: MemoryX.h:86
MultiDialog::~MultiDialog ( )
inline

Definition at line 46 of file MultiDialog.cpp.

46 {};

Member Function Documentation

void MultiDialog::OnOK ( wxCommandEvent &  event)
private

Definition at line 148 of file MultiDialog.cpp.

References mRadioBox.

149 {
150  EndModal(mRadioBox->GetSelection());
151 }
wxRadioBox * mRadioBox
Definition: MultiDialog.cpp:52
void MultiDialog::OnShowLog ( wxCommandEvent &  event)
private

Definition at line 153 of file MultiDialog.cpp.

References GetActiveProject().

154 {
155  auto project = GetActiveProject();
156  project->OnShowLog(*project);
157 }
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308

Member Data Documentation

wxRadioBox* MultiDialog::mRadioBox
private

Definition at line 52 of file MultiDialog.cpp.

Referenced by OnOK().


The documentation for this class was generated from the following file: