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

#include <EffectUI.h>

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

Public Member Functions

 EffectDialog (wxWindow *parent, const TranslatableString &title, int type=0, int flags=wxDEFAULT_DIALOG_STYLE, int additionalButtons=0)
 
void Init ()
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
bool Validate () override
 
virtual void PopulateOrExchange (ShuttleGui &S)
 
virtual void OnPreview (wxCommandEvent &evt)
 
virtual void OnOk (wxCommandEvent &evt)
 
- 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

 wxDECLARE_NO_COPY_CLASS (EffectDialog)
 

Private Attributes

int mType
 
int mAdditionalButtons
 

Detailed Description

Definition at line 187 of file EffectUI.h.

Constructor & Destructor Documentation

◆ EffectDialog()

EffectDialog::EffectDialog ( wxWindow *  parent,
const TranslatableString title,
int  type = 0,
int  flags = wxDEFAULT_DIALOG_STYLE,
int  additionalButtons = 0 
)

Definition at line 1469 of file EffectUI.cpp.

1474: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
1475{
1476 mType = type;
1477 mAdditionalButtons = additionalButtons;
1478}
static const auto title
int mAdditionalButtons
Definition: EffectUI.h:210

Member Function Documentation

◆ Init()

void EffectDialog::Init ( )

Definition at line 1480 of file EffectUI.cpp.

1481{
1482 long buttons = eOkButton;
1484 {
1485 buttons |= eCancelButton;
1486 if (mType == EffectTypeProcess)
1487 {
1488 buttons |= ePreviewButton;
1489 }
1490 }
1491
1492 ShuttleGui S(this, eIsCreating);
1493
1494 S.SetBorder(5);
1495 S.StartVerticalLay(true);
1496 {
1498 S.AddStandardButtons(buttons|mAdditionalButtons);
1499 }
1500 S.EndVerticalLay();
1501
1502 Layout();
1503 Fit();
1504 SetMinSize(GetSize());
1505 Center();
1506}
@ EffectTypeAnalyze
@ EffectTypeTool
@ EffectTypeProcess
@ eIsCreating
Definition: ShuttleGui.h:37
@ eOkButton
Definition: ShuttleGui.h:594
@ eCancelButton
Definition: ShuttleGui.h:595
@ ePreviewButton
Definition: ShuttleGui.h:599
#define S(N)
Definition: ToChars.cpp:64
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: EffectUI.cpp:1511
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:625

References eCancelButton, EffectTypeAnalyze, EffectTypeProcess, EffectTypeTool, eIsCreating, eOkButton, ePreviewButton, mAdditionalButtons, mType, PopulateOrExchange(), and S.

Here is the call graph for this function:

◆ OnOk()

void EffectDialog::OnOk ( wxCommandEvent &  evt)
virtual

Definition at line 1542 of file EffectUI.cpp.

1543{
1544 // On wxGTK (wx2.8.12), the default action is still executed even if
1545 // the button is disabled. This appears to affect all wxDialogs, not
1546 // just our Effects dialogs. So, this is a only temporary workaround
1547 // for legacy effects that disable the OK button. Hopefully this has
1548 // been corrected in wx3.
1549 if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
1550 {
1551 EndModal(wxID_OK);
1552 }
1553
1554 return;
1555}
bool Validate() override
Definition: EffectUI.cpp:1532
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:1524

References TransferDataFromWindow(), and Validate().

Here is the call graph for this function:

◆ OnPreview()

void EffectDialog::OnPreview ( wxCommandEvent &  evt)
virtual

Reimplemented in EffectNoiseReduction::Dialog, and NoiseRemovalDialog.

Definition at line 1537 of file EffectUI.cpp.

1538{
1539 return;
1540}

◆ PopulateOrExchange()

void EffectDialog::PopulateOrExchange ( ShuttleGui S)
virtual

This is a virtual function which will be overridden to provide the actual parameters that we want for each kind of dialog.

Reimplemented in EffectNoiseReduction::Dialog, and NoiseRemovalDialog.

Definition at line 1511 of file EffectUI.cpp.

1512{
1513 return;
1514}

Referenced by Init(), TransferDataFromWindow(), and TransferDataToWindow().

Here is the caller graph for this function:

◆ TransferDataFromWindow()

bool EffectDialog::TransferDataFromWindow ( )
override

Definition at line 1524 of file EffectUI.cpp.

1525{
1528
1529 return true;
1530}
@ eIsGettingFromDialog
Definition: ShuttleGui.h:38

References eIsGettingFromDialog, PopulateOrExchange(), and S.

Referenced by OnOk(), and EffectNoiseReduction::Dialog::TransferDataFromWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TransferDataToWindow()

bool EffectDialog::TransferDataToWindow ( )
override

Definition at line 1516 of file EffectUI.cpp.

1517{
1520
1521 return true;
1522}
@ eIsSettingToDialog
Definition: ShuttleGui.h:39

References eIsSettingToDialog, PopulateOrExchange(), and S.

Referenced by EffectNoiseReduction::Dialog::TransferDataToWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Validate()

bool EffectDialog::Validate ( )
override

Definition at line 1532 of file EffectUI.cpp.

1533{
1534 return true;
1535}

Referenced by OnOk().

Here is the caller graph for this function:

◆ wxDECLARE_NO_COPY_CLASS()

EffectDialog::wxDECLARE_NO_COPY_CLASS ( EffectDialog  )
private

Member Data Documentation

◆ mAdditionalButtons

int EffectDialog::mAdditionalButtons
private

Definition at line 210 of file EffectUI.h.

Referenced by Init().

◆ mType

int EffectDialog::mType
private

Definition at line 209 of file EffectUI.h.

Referenced by Init().


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