Audacity  2.2.2
Classes | Functions
ErrorDialog.h File Reference
#include "../Audacity.h"
#include <wx/defs.h>
#include <wx/msgdlg.h>
#include <wx/window.h>
#include "LinkingHtmlWindow.h"
#include "wxPanelWrapper.h"
#include <wx/textdlg.h>

Go to the source code of this file.

Classes

class  ErrorDialog
 Gives an Error message with an option for help. More...
 
class  HtmlTextHelpDialog
 
class  AudacityTextEntryDialog
 
class  AudacityMessageDialog
 

Functions

void ShowErrorDialog (wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, bool Close=true)
 Displays an error dialog with a button that offers help. More...
 
void ShowModelessErrorDialog (wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, bool Close=true)
 Displays a modeless error dialog with a button that offers help. More...
 
void ShowAliasMissingDialog (AudacityProject *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close=true)
 Displays a custom modeless error dialog for aliased file errors. More...
 
wxString AudacityMessageBoxCaptionStr ()
 
int AudacityMessageBox (const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
 

Function Documentation

int AudacityMessageBox ( const wxString &  message,
const wxString &  caption = AudacityMessageBoxCaptionStr(),
long  style = wxOK | wxCENTRE,
wxWindow *  parent = NULL,
int  x = wxDefaultCoord,
int  y = wxDefaultCoord 
)
inline

Definition at line 92 of file ErrorDialog.h.

Referenced by BatchCommands::ApplyCommand(), BatchCommands::ApplySpecialCommand(), AudioIO::AudioIO(), AudacityProject::AutoSave(), BatchCommands::BuildCleanFileName(), EditChainsDialog::ChangeOK(), ExportMP3::CheckFileName(), ConvertLegacyProjectFile(), ThemeBase::CreateImageCache(), AudacityApp::CreateSingleInstanceChecker(), MessageBoxException::DelayedHandlerAction(), AudacityProject::DeleteCurrentAutoSaveFile(), ExportMultiple::DirOk(), AudacityProject::DoSave(), PluginManager::DropFile(), Exporter::ExamineTracks(), TimerRecordDialog::ExecutePostRecordActions(), ExportCL::Export(), ExportPCM::Export(), ExportMP3::Export(), FreqWindow::GetAudio(), EffectManager::GetEffect(), Exporter::GetFilename(), HandlePrint(), CommandManager::HandleXMLEndTag(), AudacityProject::HandleXMLTag(), TimerRecordDialog::HaveFilesToRecover(), HaveFilesToRecover(), LabelTrack::Import(), AudacityApp::InitLang(), InitPreferences(), AudacityApp::InitTempDir(), AudacityProject::IsAlreadyOpen(), Module::Load(), ThemeBase::LoadComponents(), MP3Exporter::LoadLibrary(), LOFImportFileHandle::lofOpenFiles(), Effect::MessageBox(), AudacityApp::MRUOpen(), VoiceKey::OffBackward(), VoiceKey::OffForward(), EditChainsDialog::OnAdd(), BatchProcessDialog::OnApplyToFiles(), BatchProcessDialog::OnApplyToProject(), AudacityProject::OnAudioDeviceInfo(), VoiceKey::OnBackward(), DependencyDialog::OnCancel(), AudacityProject::OnCloseWindow(), ExportMultiple::OnCreate(), EffectUIHost::OnDeletePreset(), ExtImportPrefs::OnDelRule(), TagsEditor::OnEdit(), ContrastDialog::OnExport(), LabelDialog::OnExport(), FreqWindow::OnExport(), AudacityProject::OnExportLabels(), LibraryPrefs::OnFFmpegFindButton(), VoiceKey::OnForward(), KeyConfigPrefs::OnImport(), LabelDialog::OnImport(), AudacityProject::OnImportLabels(), TagsEditor::OnLoad(), AudacityProject::OnLockPlayRegion(), AudacityProject::OnNewTimeTrack(), LangChoiceDialog::OnOk(), TimerRecordDialog::OnOK(), PluginRegistrationDialog::OnOK(), RateMenuTable::OnRateOther(), AutoRecoveryDialog::OnRecoverNone(), AudacityProject::OnRedo(), AudacityProject::OnResample(), TagsEditor::OnReset(), ExtImportPrefs::OnRuleTableEdit(), BenchmarkDialog::OnRun(), AudacityLogger::OnSave(), KeyConfigPrefs::OnSet(), WaveTrackMenuTable::OnSpectrogramSettings(), AudacityProject::OnTimerRecord(), AudacityProject::OnUndo(), AudacityProject::OpenFile(), SFFileCloser::operator()(), SplashDialog::Populate(), DirManager::ProjectFSCK(), ThemeBase::ReadImageCache(), RecoverAllProjects(), BatchCommands::ReportAndSkip(), ThemeBase::SaveComponents(), KeyConfigPrefs::SetKeyForSelected(), DeviceToolBar::ShowComboDialog(), ShowDependencyDialogIfNeeded(), ExportMultiple::ShowModal(), AudioIO::StartStream(), MessageBoxTarget::Update(), DirectoriesPrefs::Validate(), SpectrumPrefs::Validate(), SpectrogramSettings::Validate(), AudacityProject::WarnOfLegacyFile(), and Sequence::WriteXML().

97 {
98  return ::wxMessageBox(message, caption, style, parent, x, y);
99 }
wxString AudacityMessageBoxCaptionStr ( )

Definition at line 236 of file ErrorDialog.cpp.

References _().

Referenced by MessageBoxException::DelayedHandlerAction(), and ThemeBase::SaveComponents().

237 {
238  return _("Message");
239 }
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
void ShowAliasMissingDialog ( AudacityProject parent,
const wxString &  dlogTitle,
const wxString &  message,
const wxString &  helpPage,
const bool  Close = true 
)

Displays a custom modeless error dialog for aliased file errors.

Definition at line 208 of file ErrorDialog.cpp.

References safenew.

Referenced by AudacityApp::OnTimer().

213 {
214  wxASSERT(parent); // to justify safenew
215  ErrorDialog *dlog = safenew AliasedFileMissingDialog(parent, dlogTitle, message, helpPage, Close, false);
216  // Don't center because in many cases (effect, export, etc) there will be a progress bar in the center that blocks this.
217  // instead put it just above or on the top of the project.
218  wxPoint point;
219  point.x = 0;
220 
221  point.y = parent ? parent->GetPosition().y - 200 : 100;
222 
223  if (point.y < 100)
224  point.y = 100;
225  dlog->SetPosition(point);
226  dlog->CentreOnParent(wxHORIZONTAL);
227 
228  // This needs to be modeless because user may need to
229  // stop playback AND read dialog's instructions.
230  dlog->Show();
231  // ANSWER-ME: Vigilant Sentry flags this method as not deleting dlog, so a mem leak.
232  // PRL: answer is that the parent window guarantees destruction of the dialog
233  // but in practice Destroy() in OnOK does that
234 }
#define safenew
Definition: Audacity.h:223
Special case of ErrorDialog for reporting missing alias files.
Definition: ErrorDialog.cpp:48
Gives an Error message with an option for help.
Definition: ErrorDialog.h:24
void ShowErrorDialog ( wxWindow *  parent,
const wxString &  dlogTitle,
const wxString &  message,
const wxString &  helpPage,
bool  Close = true 
)

Displays an error dialog with a button that offers help.

Definition at line 176 of file ErrorDialog.cpp.

Referenced by AudacityProject::Import(), ControlToolBar::OnRecord(), ControlToolBar::PlayPlayRegion(), Effect::Preview(), and CommandManager::TellUserWhyDisallowed().

181 {
182  ErrorDialog dlog(parent, dlogTitle, message, helpPage, Close);
183  dlog.CentreOnParent();
184  dlog.ShowModal();
185 }
Gives an Error message with an option for help.
Definition: ErrorDialog.h:24
void ShowModelessErrorDialog ( wxWindow *  parent,
const wxString &  dlogTitle,
const wxString &  message,
const wxString &  helpPage,
bool  Close = true 
)

Displays a modeless error dialog with a button that offers help.

Definition at line 189 of file ErrorDialog.cpp.

References safenew.

194 {
195  // ensure it has some parent.
196  if( !parent )
197  parent = wxTheApp->GetTopWindow();
198  wxASSERT(parent);
199  ErrorDialog *dlog = safenew ErrorDialog(parent, dlogTitle, message, helpPage, Close, false);
200  dlog->CentreOnParent();
201  dlog->Show();
202  // ANSWER-ME: Vigilant Sentry flagged this method as not deleting dlog, so
203  // is this actually a mem leak.
204  // PRL: answer is that the parent window guarantees destruction of the dialog
205  // but in practice Destroy() in OnOK does that
206 }
#define safenew
Definition: Audacity.h:223
Gives an Error message with an option for help.
Definition: ErrorDialog.h:24