Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AudacityDontAskAgainMessageDialog Class Reference

#include <AudacityDontAskAgainMessageDialog.h>

Inheritance diagram for AudacityDontAskAgainMessageDialog:
[legend]
Collaboration diagram for AudacityDontAskAgainMessageDialog:
[legend]

Public Member Functions

 AudacityDontAskAgainMessageDialog (wxWindow *parent, const TranslatableString &caption, const TranslatableString &message)
 
bool ShowDialog ()
 
bool IsChecked () const
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- 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

 DECLARE_EVENT_TABLE ()
 
void OnCheckBoxEvent (wxCommandEvent &evt)
 
void OnClose (wxCloseEvent &event)
 

Private Attributes

bool mChecked = false
 

Detailed Description

Definition at line 15 of file AudacityDontAskAgainMessageDialog.h.

Constructor & Destructor Documentation

◆ AudacityDontAskAgainMessageDialog()

AudacityDontAskAgainMessageDialog::AudacityDontAskAgainMessageDialog ( wxWindow *  parent,
const TranslatableString caption,
const TranslatableString message 
)

Definition at line 27 of file AudacityDontAskAgainMessageDialog.cpp.

31 parent, wxID_ANY, caption, wxDefaultPosition, wxDefaultSize, style)
32{
33 wxStaticText* messageText =
34 new wxStaticText(this, wxID_ANY, message.Translation());
35
36 // Add a checkbox
37 wxCheckBox* checkBox =
38 new wxCheckBox(this, wxID_ANY, XO("Don't ask me again").Translation());
39
40 // Add sizers to arrange controls
41 wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
42 constexpr auto border = 10;
43 mainSizer->Add(messageText, 0, wxALL | wxALIGN_CENTER, border);
44
45 // This is where you specified wxOK | wxCANCEL buttons which you saw in your
46 // dialog wxOK had no effect because this flag isn't handled by the wxDialog,
47 // but even if it did, then you would likely got two rows of buttons
48 wxStdDialogButtonSizer* buttonSizer =
49 CreateStdDialogButtonSizer(wxYES | wxNO);
50
51 // Add checkbox to the sizer so that it shows first
52 buttonSizer->Insert(0, checkBox, 0, wxALL | wxALIGN_CENTER, border);
53 mainSizer->Add(buttonSizer, 0, wxALL | wxALIGN_CENTER, border);
54
55 SetSizerAndFit(mainSizer);
56 // Manually implement wxCENTRE flag behavior
57 if ((style | wxCENTRE) != 0)
58 CentreOnParent();
59
60 SetEscapeId(wxID_NO);
61}
XO("Cut/Copy/Paste")
wxString Translation() const

References anonymous_namespace{AudacityDontAskAgainMessageDialog.cpp}::style, and XO().

Here is the call graph for this function:

Member Function Documentation

◆ DECLARE_EVENT_TABLE()

AudacityDontAskAgainMessageDialog::DECLARE_EVENT_TABLE ( )
private

◆ IsChecked()

bool AudacityDontAskAgainMessageDialog::IsChecked ( ) const

Definition at line 68 of file AudacityDontAskAgainMessageDialog.cpp.

References mChecked.

Referenced by AudacityMirProject::ShouldBeReconfigured().

Here is the caller graph for this function:

◆ OnCheckBoxEvent()

void AudacityDontAskAgainMessageDialog::OnCheckBoxEvent ( wxCommandEvent &  evt)
private

Definition at line 73 of file AudacityDontAskAgainMessageDialog.cpp.

74{
75 mChecked = evt.IsChecked();
76}

References mChecked.

◆ OnClose()

void AudacityDontAskAgainMessageDialog::OnClose ( wxCloseEvent &  event)
private

Definition at line 78 of file AudacityDontAskAgainMessageDialog.cpp.

79{
80 EndModal(wxID_NO);
81}

◆ ShowDialog()

bool AudacityDontAskAgainMessageDialog::ShowDialog ( )

Definition at line 63 of file AudacityDontAskAgainMessageDialog.cpp.

64{
65 return ShowModal() == wxID_YES;
66}

Referenced by AudacityMirProject::ShouldBeReconfigured().

Here is the caller graph for this function:

Member Data Documentation

◆ mChecked

bool AudacityDontAskAgainMessageDialog::mChecked = false
private

Definition at line 31 of file AudacityDontAskAgainMessageDialog.h.

Referenced by IsChecked(), and OnCheckBoxEvent().


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