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

1153: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
1154{
1155 mType = type;
1156 mAdditionalButtons = additionalButtons;
1157}
static const auto title
int mAdditionalButtons
Definition: EffectUI.h:197

Member Function Documentation

◆ Init()

void EffectDialog::Init ( )

Definition at line 1159 of file EffectUI.cpp.

1160{
1161 long buttons = eOkButton;
1163 {
1164 buttons |= eCancelButton;
1165 if (mType == EffectTypeProcess)
1166 {
1167 buttons |= ePreviewButton;
1168 }
1169 }
1170
1171 ShuttleGui S(this, eIsCreating);
1172
1173 S.SetBorder(5);
1174 S.StartVerticalLay(true);
1175 {
1177 S.AddStandardButtons(buttons|mAdditionalButtons);
1178 }
1179 S.EndVerticalLay();
1180
1181 Layout();
1182 Fit();
1183 SetMinSize(GetSize());
1184 Center();
1185}
@ EffectTypeAnalyze
@ EffectTypeTool
@ EffectTypeProcess
@ eIsCreating
Definition: ShuttleGui.h:37
@ eOkButton
Definition: ShuttleGui.h:609
@ eCancelButton
Definition: ShuttleGui.h:610
@ ePreviewButton
Definition: ShuttleGui.h:614
#define S(N)
Definition: ToChars.cpp:64
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: EffectUI.cpp:1190
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640

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

1222{
1223 // On wxGTK (wx2.8.12), the default action is still executed even if
1224 // the button is disabled. This appears to affect all wxDialogs, not
1225 // just our Effects dialogs. So, this is a only temporary workaround
1226 // for legacy effects that disable the OK button. Hopefully this has
1227 // been corrected in wx3.
1228 if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
1229 {
1230 EndModal(wxID_OK);
1231 }
1232
1233 return;
1234}
bool Validate() override
Definition: EffectUI.cpp:1211
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:1203

References TransferDataFromWindow(), and Validate().

Here is the call graph for this function:

◆ OnPreview()

void EffectDialog::OnPreview ( wxCommandEvent &  evt)
virtual

Reimplemented in EffectNoiseReduction::Dialog.

Definition at line 1216 of file EffectUI.cpp.

1217{
1218 return;
1219}

◆ 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.

Definition at line 1190 of file EffectUI.cpp.

1191{
1192 return;
1193}

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

Here is the caller graph for this function:

◆ TransferDataFromWindow()

bool EffectDialog::TransferDataFromWindow ( )
override

Definition at line 1203 of file EffectUI.cpp.

1204{
1207
1208 return true;
1209}
@ 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 1195 of file EffectUI.cpp.

1196{
1199
1200 return true;
1201}
@ 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 1211 of file EffectUI.cpp.

1212{
1213 return true;
1214}

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

Referenced by Init().

◆ mType

int EffectDialog::mType
private

Definition at line 196 of file EffectUI.h.

Referenced by Init().


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