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

New (Jun-2006) base class for effects dialogs. Likely to get greater use in future. More...

#include <Effect.h>

Inheritance diagram for EffectDialog:
wxDialogWrapper wxTabTraversalWrapper< wxDialog > EffectNoiseReduction::Dialog

Public Member Functions

 EffectDialog (wxWindow *parent, const wxString &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 wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&...args)
 

Private Member Functions

 wxDECLARE_NO_COPY_CLASS (EffectDialog)
 

Private Attributes

int mType
 
int mAdditionalButtons
 

Detailed Description

New (Jun-2006) base class for effects dialogs. Likely to get greater use in future.

Definition at line 563 of file Effect.h.

Constructor & Destructor Documentation

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

Definition at line 2679 of file Effect.cpp.

2684 : wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
2685 {
2686  mType = type;
2687  mAdditionalButtons = additionalButtons;
2688 }
int mAdditionalButtons
Definition: Effect.h:586
int mType
Definition: Effect.h:585

Member Function Documentation

void EffectDialog::Init ( )

Definition at line 2690 of file Effect.cpp.

References ShuttleGui::AddStandardButtons(), eCancelButton, eIsCreating, ShuttleGuiBase::EndVerticalLay(), eOkButton, ePreviewButton, Effect::PopulateOrExchange(), ShuttleGuiBase::SetBorder(), and ShuttleGuiBase::StartVerticalLay().

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

2691 {
2692  ShuttleGui S(this, eIsCreating);
2693 
2694  S.SetBorder(5);
2695  S.StartVerticalLay(true);
2696  {
2697  PopulateOrExchange(S);
2698 
2699  long buttons = eOkButton;
2700  if (mType != EffectTypeAnalyze)
2701  {
2702  buttons |= eCancelButton;
2703  if (mType == EffectTypeProcess)
2704  {
2705  buttons |= ePreviewButton;
2706  }
2707  }
2708  S.AddStandardButtons(buttons|mAdditionalButtons);
2709  }
2710  S.EndVerticalLay();
2711 
2712  Layout();
2713  Fit();
2714  SetMinSize(GetSize());
2715  Center();
2716 }
int mAdditionalButtons
Definition: Effect.h:586
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
int mType
Definition: Effect.h:585
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: Effect.cpp:2721
void EffectDialog::OnOk ( wxCommandEvent &  evt)
virtual

Definition at line 2752 of file Effect.cpp.

References Effect::TransferDataFromWindow().

2753 {
2754  // On wxGTK (wx2.8.12), the default action is still executed even if
2755  // the button is disabled. This appears to affect all wxDialogs, not
2756  // just our Effects dialogs. So, this is a only temporary workaround
2757  // for legacy effects that disable the OK button. Hopefully this has
2758  // been corrected in wx3.
2759  if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
2760  {
2761  EndModal(true);
2762  }
2763 
2764  return;
2765 }
bool TransferDataFromWindow() override
Definition: Effect.cpp:2734
bool Validate() override
Definition: Effect.cpp:2742
void EffectDialog::OnPreview ( wxCommandEvent &  evt)
virtual

Reimplemented in EffectNoiseReduction::Dialog.

Definition at line 2747 of file Effect.cpp.

2748 {
2749  return;
2750 }
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 2721 of file Effect.cpp.

2722 {
2723  return;
2724 }
bool EffectDialog::TransferDataFromWindow ( )
override

Definition at line 2734 of file Effect.cpp.

References eIsGettingFromDialog, and Effect::PopulateOrExchange().

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

2735 {
2737  PopulateOrExchange(S);
2738 
2739  return true;
2740 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: Effect.cpp:2721
bool EffectDialog::TransferDataToWindow ( )
override

Definition at line 2726 of file Effect.cpp.

References eIsSettingToDialog, and Effect::PopulateOrExchange().

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

2727 {
2728  ShuttleGui S(this, eIsSettingToDialog);
2729  PopulateOrExchange(S);
2730 
2731  return true;
2732 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: Effect.cpp:2721
bool EffectDialog::Validate ( )
override

Definition at line 2742 of file Effect.cpp.

2743 {
2744  return true;
2745 }
EffectDialog::wxDECLARE_NO_COPY_CLASS ( EffectDialog  )
private

Member Data Documentation

int EffectDialog::mAdditionalButtons
private

Definition at line 586 of file Effect.h.

int EffectDialog::mType
private

Definition at line 585 of file Effect.h.


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