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

Gives a warning message, that can be dismissed, with crucially the ability to not see similar warnings again for this session. More...

Inheritance diagram for WarningDialog:
wxDialogWrapper wxTabTraversalWrapper< wxDialog >

Public Member Functions

 WarningDialog (wxWindow *parent, const wxString &message, const wxString &footer, bool showCancelButton)
 
- 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)
 

Private Attributes

wxCheckBox * mCheckBox
 

Detailed Description

Gives a warning message, that can be dismissed, with crucially the ability to not see similar warnings again for this session.

Definition at line 35 of file Warning.cpp.

Constructor & Destructor Documentation

WarningDialog::WarningDialog ( wxWindow *  parent,
const wxString &  message,
const wxString &  footer,
bool  showCancelButton 
)

Definition at line 61 of file Warning.cpp.

References ShuttleGuiBase::AddCheckBox(), ShuttleGuiBase::AddFixedText(), ShuttleGui::AddStandardButtons(), eCancelButton, eIsCreating, ShuttleGuiBase::EndVerticalLay(), eOkButton, mCheckBox, ShuttleGuiBase::SetBorder(), and ShuttleGuiBase::StartVerticalLay().

64 : wxDialogWrapper(parent, wxID_ANY, (wxString)_("Warning"),
65  wxDefaultPosition, wxDefaultSize,
66  (showCancelButton ? wxDEFAULT_DIALOG_STYLE : wxCAPTION | wxSYSTEM_MENU)) // Unlike wxDEFAULT_DIALOG_STYLE, no wxCLOSE_BOX.
67 {
68  SetName(GetTitle());
69 
70  SetIcon(wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX));
71  ShuttleGui S(this, eIsCreating);
72 
73  S.SetBorder(10);
74  S.StartVerticalLay(false);
75  {
76  S.AddFixedText(message);
77  mCheckBox = S.AddCheckBox(footer, wxT("false"));
78  }
79  S.EndVerticalLay();
80 
81  S.SetBorder(0);
82  S.AddStandardButtons(showCancelButton ? eOkButton | eCancelButton : eOkButton);
83 
84  Fit();
85  CentreOnParent();
86 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
_("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
wxCheckBox * mCheckBox
Definition: Warning.cpp:47

Member Function Documentation

void WarningDialog::OnOK ( wxCommandEvent &  event)
private

Definition at line 88 of file Warning.cpp.

References mCheckBox.

89 {
90  EndModal(mCheckBox->GetValue() ? wxID_NO : wxID_YES); // return YES, if message should be shown again
91 }
wxCheckBox * mCheckBox
Definition: Warning.cpp:47

Member Data Documentation

wxCheckBox* WarningDialog::mCheckBox
private

Definition at line 47 of file Warning.cpp.

Referenced by OnOK(), and WarningDialog().


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