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

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

Member Function Documentation

◆ Init()

void EffectDialog::Init ( )

Definition at line 1362 of file EffectUI.cpp.

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

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

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

1420{
1421 return;
1422}

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

1394{
1395 return;
1396}

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

Here is the caller graph for this function:

◆ TransferDataFromWindow()

bool EffectDialog::TransferDataFromWindow ( )
override

Definition at line 1406 of file EffectUI.cpp.

1407{
1410
1411 return true;
1412}
@ 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 1398 of file EffectUI.cpp.

1399{
1402
1403 return true;
1404}
@ 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 1414 of file EffectUI.cpp.

1415{
1416 return true;
1417}

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: