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

1355: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
1356{
1357 mType = type;
1358 mAdditionalButtons = additionalButtons;
1359}
static const auto title
int mAdditionalButtons
Definition: EffectUI.h:205

Member Function Documentation

◆ Init()

void EffectDialog::Init ( )

Definition at line 1361 of file EffectUI.cpp.

1362{
1363 long buttons = eOkButton;
1365 {
1366 buttons |= eCancelButton;
1367 if (mType == EffectTypeProcess)
1368 {
1369 buttons |= ePreviewButton;
1370 }
1371 }
1372
1373 ShuttleGui S(this, eIsCreating);
1374
1375 S.SetBorder(5);
1376 S.StartVerticalLay(true);
1377 {
1379 S.AddStandardButtons(buttons|mAdditionalButtons);
1380 }
1381 S.EndVerticalLay();
1382
1383 Layout();
1384 Fit();
1385 SetMinSize(GetSize());
1386 Center();
1387}
@ 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:1392
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 1423 of file EffectUI.cpp.

1424{
1425 // On wxGTK (wx2.8.12), the default action is still executed even if
1426 // the button is disabled. This appears to affect all wxDialogs, not
1427 // just our Effects dialogs. So, this is a only temporary workaround
1428 // for legacy effects that disable the OK button. Hopefully this has
1429 // been corrected in wx3.
1430 if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
1431 {
1432 EndModal(wxID_OK);
1433 }
1434
1435 return;
1436}
bool Validate() override
Definition: EffectUI.cpp:1413
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:1405

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

1419{
1420 return;
1421}

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

1393{
1394 return;
1395}

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

Here is the caller graph for this function:

◆ TransferDataFromWindow()

bool EffectDialog::TransferDataFromWindow ( )
override

Definition at line 1405 of file EffectUI.cpp.

1406{
1409
1410 return true;
1411}
@ 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 1397 of file EffectUI.cpp.

1398{
1401
1402 return true;
1403}
@ 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 1413 of file EffectUI.cpp.

1414{
1415 return true;
1416}

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

Referenced by Init().

◆ mType

int EffectDialog::mType
private

Definition at line 204 of file EffectUI.h.

Referenced by Init().


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