Audacity  3.0.3
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 242 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 2044 of file EffectUI.cpp.

2049 : wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
2050 {
2051  mType = type;
2052  mAdditionalButtons = additionalButtons;
2053 }

Member Function Documentation

◆ Init()

void EffectDialog::Init ( )

Definition at line 2055 of file EffectUI.cpp.

2056 {
2057  long buttons = eOkButton;
2058  if ((mType != EffectTypeAnalyze) && (mType != EffectTypeTool))
2059  {
2060  buttons |= eCancelButton;
2061  if (mType == EffectTypeProcess)
2062  {
2063  buttons |= ePreviewButton;
2064  }
2065  }
2066 
2067  ShuttleGui S(this, eIsCreating);
2068 
2069  S.SetBorder(5);
2070  S.StartVerticalLay(true);
2071  {
2072  PopulateOrExchange(S);
2073  S.AddStandardButtons(buttons|mAdditionalButtons);
2074  }
2075  S.EndVerticalLay();
2076 
2077  Layout();
2078  Fit();
2079  SetMinSize(GetSize());
2080  Center();
2081 }

References ShuttleGui::AddStandardButtons(), eCancelButton, EffectTypeAnalyze, EffectTypeProcess, EffectTypeTool, eIsCreating, ShuttleGuiBase::EndVerticalLay(), eOkButton, ePreviewButton, mAdditionalButtons, mType, PopulateOrExchange(), ShuttleGuiBase::SetBorder(), and ShuttleGuiBase::StartVerticalLay().

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

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

◆ OnOk()

void EffectDialog::OnOk ( wxCommandEvent &  evt)
virtual

Definition at line 2117 of file EffectUI.cpp.

2118 {
2119  // On wxGTK (wx2.8.12), the default action is still executed even if
2120  // the button is disabled. This appears to affect all wxDialogs, not
2121  // just our Effects dialogs. So, this is a only temporary workaround
2122  // for legacy effects that disable the OK button. Hopefully this has
2123  // been corrected in wx3.
2124  if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
2125  {
2126  EndModal(true);
2127  }
2128 
2129  return;
2130 }

References TransferDataFromWindow(), and Validate().

Here is the call graph for this function:

◆ OnPreview()

void EffectDialog::OnPreview ( wxCommandEvent &  evt)
virtual

Reimplemented in NoiseRemovalDialog, and EffectNoiseReduction::Dialog.

Definition at line 2112 of file EffectUI.cpp.

2113 {
2114  return;
2115 }

◆ 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 NoiseRemovalDialog, and EffectNoiseReduction::Dialog.

Definition at line 2086 of file EffectUI.cpp.

2087 {
2088  return;
2089 }

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

Here is the caller graph for this function:

◆ TransferDataFromWindow()

bool EffectDialog::TransferDataFromWindow ( )
override

Definition at line 2099 of file EffectUI.cpp.

2100 {
2102  PopulateOrExchange(S);
2103 
2104  return true;
2105 }

References eIsGettingFromDialog, and PopulateOrExchange().

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 2091 of file EffectUI.cpp.

2092 {
2093  ShuttleGui S(this, eIsSettingToDialog);
2094  PopulateOrExchange(S);
2095 
2096  return true;
2097 }

References eIsSettingToDialog, and PopulateOrExchange().

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 2107 of file EffectUI.cpp.

2108 {
2109  return true;
2110 }

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 265 of file EffectUI.h.

Referenced by Init().

◆ mType

int EffectDialog::mType
private

Definition at line 264 of file EffectUI.h.

Referenced by Init().


The documentation for this class was generated from the following files:
EffectDialog::mAdditionalButtons
int mAdditionalButtons
Definition: EffectUI.h:265
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
eIsGettingFromDialog
@ eIsGettingFromDialog
Definition: ShuttleGui.h:39
ePreviewButton
@ ePreviewButton
Definition: ShuttleGui.h:605
eIsSettingToDialog
@ eIsSettingToDialog
Definition: ShuttleGui.h:40
EffectDialog::Validate
bool Validate() override
Definition: EffectUI.cpp:2107
eCancelButton
@ eCancelButton
Definition: ShuttleGui.h:601
EffectDialog::PopulateOrExchange
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: EffectUI.cpp:2086
EffectTypeTool
@ EffectTypeTool
Definition: EffectInterface.h:61
title
static const auto title
Definition: NoUpdatesAvailableDialog.cpp:22
eOkButton
@ eOkButton
Definition: ShuttleGui.h:600
EffectTypeAnalyze
@ EffectTypeAnalyze
Definition: EffectInterface.h:60
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
EffectDialog::mType
int mType
Definition: EffectUI.h:264
EffectDialog::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:2099
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631