Audacity 3.2.0
|
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI. More...
#include <ShuttleGui.h>
Public Member Functions | |
ShuttleGui (wxWindow *pParent, teShuttleMode ShuttleMode, bool vertical=true, wxSize minSize={ 250, 100 }) | |
~ShuttleGui (void) | |
ShuttleGui & | Optional (bool &bVar) |
ShuttleGui & | Id (int id) |
ShuttleGui & | Focus (bool focused=true) |
ShuttleGui & | Disable (bool disabled=true) |
ShuttleGui & | ToolTip (const TranslatableString &tip) |
ShuttleGui & | Name (const TranslatableString &name) |
ShuttleGui & | NameSuffix (const TranslatableString &suffix) |
template<typename Factory > | |
ShuttleGui & | Validator (const Factory &f) |
template<typename V , typename... Args> | |
ShuttleGui & | Validator (Args &&...args) |
template<typename Tag , typename Argument , typename Handler > | |
auto | ConnectRoot (wxEventTypeTag< Tag > eventType, void(Handler::*func)(Argument &)) -> std::enable_if_t< std::is_base_of_v< Argument, Tag >, ShuttleGui & > |
ShuttleGui & | Position (int flags) |
ShuttleGui & | Size (wxSize size) |
ShuttleGui & | Prop (int iProp) |
ShuttleGui & | Style (long iStyle) |
ShuttleGui & | MinSize () |
ShuttleGui & | MinSize (wxSize sz) |
void | AddStandardButtons (long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL) |
wxSizerItem * | AddSpace (int width, int height, int prop=0) |
wxSizerItem * | AddSpace (int size) |
teShuttleMode | GetMode () |
Public Member Functions inherited from ShuttleGuiBase | |
ShuttleGuiBase (wxWindow *pParent, teShuttleMode ShuttleMode, bool vertical, wxSize minSize) | |
virtual | ~ShuttleGuiBase () |
void | Init (bool vertical, wxSize minSize) |
void | ResetId () |
void | HandleOptionality (const TranslatableString &Prompt) |
wxStaticText * | AddPrompt (const TranslatableString &Prompt, int wrapWidth=0) |
Right aligned text string. More... | |
void | AddUnits (const TranslatableString &Prompt, int wrapWidth=0) |
Left aligned text string. More... | |
void | AddTitle (const TranslatableString &Prompt, int wrapWidth=0) |
Centred text string. More... | |
wxWindow * | AddWindow (wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE) |
wxSlider * | AddSlider (const TranslatableString &Prompt, int pos, int Max, int Min=0) |
wxSlider * | AddVSlider (const TranslatableString &Prompt, int pos, int Max) |
wxSpinCtrl * | AddSpinCtrl (const TranslatableString &Prompt, int Value, int Max, int Min) |
SpinControl * | AddSpinControl (const wxSize &size, const TranslatableString &Prompt, double Value, double Max, double Min) |
wxTreeCtrl * | AddTree () |
wxRadioButton * | AddRadioButton (const TranslatableString &Prompt, int selector=0, int initValue=0) |
wxRadioButton * | AddRadioButtonToGroup (const TranslatableString &Prompt, int selector=1, int initValue=0) |
wxButton * | AddButton (const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false) |
wxBitmapButton * | AddBitmapButton (const wxBitmap &Bitmap, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false) |
wxStaticText * | AddVariableText (const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0) |
ReadOnlyText * | AddReadOnlyText (const TranslatableString &Caption, const wxString &Value) |
wxTextCtrl * | AddTextBox (const TranslatableString &Caption, const wxString &Value, const int nChars) |
wxTextCtrl * | AddNumericTextBox (const TranslatableString &Caption, const wxString &Value, const int nChars, bool acceptEnter=false) |
wxTextCtrl * | AddTextWindow (const wxString &Value) |
Multiline text box that grows. More... | |
wxListBox * | AddListBox (const wxArrayStringEx &choices) |
wxListCtrl * | AddListControl (std::initializer_list< const ListControlColumn > columns={}, long listControlStyles=0) |
wxListCtrl * | AddListControlReportMode (std::initializer_list< const ListControlColumn > columns={}, long listControlStyles=0) |
wxGrid * | AddGrid () |
wxCheckBox * | AddCheckBox (const TranslatableString &Prompt, bool Selected) |
wxCheckBox * | AddCheckBoxOnRight (const TranslatableString &Prompt, bool Selected) |
wxCheckBox * | AddCheckBox (const TranslatableString &Prompt, const wxChar *)=delete |
wxCheckBox * | AddCheckBox (const TranslatableString &Prompt, const char *)=delete |
wxCheckBox * | AddCheckBoxOnRight (const TranslatableString &Prompt, const wxChar *)=delete |
wxCheckBox * | AddCheckBoxOnRight (const TranslatableString &Prompt, const char *)=delete |
wxComboBox * | AddCombo (const TranslatableString &Prompt, const wxString &Selected, const wxArrayStringEx &choices) |
wxChoice * | AddChoice (const TranslatableString &Prompt, const TranslatableStrings &choices, int Selected=-1) |
wxChoice * | AddChoice (const TranslatableString &Prompt, const TranslatableStrings &choices, const TranslatableString &selected) |
void | AddIcon (wxBitmap *pBmp) |
void | AddFixedText (const TranslatableString &Str, bool bCenter=false, int wrapWidth=0) |
void | AddConstTextBox (const TranslatableString &Caption, const TranslatableString &Value) |
Single line text box of fixed size. More... | |
void | StartHorizontalLay (int PositionFlags=wxALIGN_CENTRE, int iProp=1) |
void | EndHorizontalLay () |
void | StartVerticalLay (int iProp=1) |
void | StartVerticalLay (int PositionFlags, int iProp) |
void | EndVerticalLay () |
void | StartWrapLay (int PositionFlags=wxEXPAND, int iProp=0) |
void | EndWrapLay () |
wxScrolledWindow * | StartScroller (int iStyle=0) |
void | EndScroller () |
wxPanel * | StartPanel (int iStyle=0) |
void | EndPanel () |
void | StartMultiColumn (int nCols, int PositionFlags=wxALIGN_LEFT) |
void | EndMultiColumn () |
void | StartTwoColumn () |
void | EndTwoColumn () |
void | StartThreeColumn () |
void | EndThreeColumn () |
wxStaticBox * | StartStatic (const TranslatableString &Str, int iProp=0) |
void | EndStatic () |
wxNotebook * | StartNotebook () |
void | EndNotebook () |
wxSimplebook * | StartSimplebook () |
void | EndSimplebook () |
wxNotebookPage * | StartNotebookPage (const TranslatableString &Name) |
void | EndNotebookPage () |
wxPanel * | StartInvisiblePanel (int border=0) |
void | EndInvisiblePanel () |
void | StartRadioButtonGroup (ChoiceSetting &Setting) |
Call this before any TieRadioButton calls. More... | |
void | EndRadioButtonGroup () |
bool | DoStep (int iStep) |
int | TranslateToIndex (const wxString &Value, const wxArrayStringEx &Choices) |
String-to-Index. More... | |
wxString | TranslateFromIndex (const int nIn, const wxArrayStringEx &Choices) |
Index-to-String. More... | |
wxTextCtrl * | TieTextBox (const TranslatableString &Caption, wxString &Value, const int nChars=0) |
wxTextCtrl * | TieTextBox (const TranslatableString &Prompt, int &Selected, const int nChars=0) |
wxTextCtrl * | TieTextBox (const TranslatableString &Prompt, double &Value, const int nChars=0) |
wxTextCtrl * | TieNumericTextBox (const TranslatableString &Prompt, int &Value, const int nChars=0, bool acceptEnter=false) |
wxTextCtrl * | TieNumericTextBox (const TranslatableString &Prompt, double &Value, const int nChars=0, bool acceptEnter=false) |
wxCheckBox * | TieCheckBox (const TranslatableString &Prompt, bool &Var) |
wxCheckBox * | TieCheckBoxOnRight (const TranslatableString &Prompt, bool &Var) |
wxChoice * | TieChoice (const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices) |
wxChoice * | TieChoice (const TranslatableString &Prompt, int &Selected, const TranslatableStrings &choices) |
wxSlider * | TieSlider (const TranslatableString &Prompt, int &pos, const int max, const int min=0) |
wxSlider * | TieSlider (const TranslatableString &Prompt, double &pos, const double max, const double min=0.0) |
wxSlider * | TieSlider (const TranslatableString &Prompt, float &pos, const float fMin, const float fMax) |
wxSlider * | TieVSlider (const TranslatableString &Prompt, float &pos, const float fMin, const float fMax) |
wxRadioButton * | TieRadioButton () |
This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair. More... | |
wxSpinCtrl * | TieSpinCtrl (const TranslatableString &Prompt, int &Value, const int max, const int min=0) |
SpinControl * | TieSpinControl (const wxSize &size, const TranslatableString &Prompt, double &Value, const double max, const double min=0) |
virtual wxCheckBox * | TieCheckBox (const TranslatableString &Prompt, const BoolSetting &Setting) |
virtual wxCheckBox * | TieCheckBoxOnRight (const TranslatableString &Prompt, const BoolSetting &Setting) |
virtual wxChoice * | TieChoice (const TranslatableString &Prompt, ChoiceSetting &choiceSetting) |
virtual wxChoice * | TieNumberAsChoice (const TranslatableString &Prompt, IntSetting &Setting, const TranslatableStrings &Choices, const std::vector< int > *pInternalChoices=nullptr, int iNoMatchSelector=0) |
virtual wxTextCtrl * | TieTextBox (const TranslatableString &Prompt, const StringSetting &Setting, const int nChars) |
virtual wxTextCtrl * | TieIntegerTextBox (const TranslatableString &Prompt, const IntSetting &Setting, const int nChars) |
virtual wxTextCtrl * | TieNumericTextBox (const TranslatableString &Prompt, const DoubleSetting &Setting, const int nChars, bool acceptEnter=false) |
virtual wxSlider * | TieSlider (const TranslatableString &Prompt, const IntSetting &Setting, const int max, const int min=0) |
virtual wxSpinCtrl * | TieSpinCtrl (const TranslatableString &Prompt, const IntSetting &Setting, const int max, const int min) |
void | SetBorder (int Border) |
int | GetBorder () const noexcept |
void | SetSizerProportion (int iProp) |
void | SetStretchyCol (int i) |
Used to modify an already placed FlexGridSizer to make a column stretchy. More... | |
void | SetStretchyRow (int i) |
Used to modify an already placed FlexGridSizer to make a row stretchy. More... | |
wxWindow * | GetParent () |
ShuttleGuiBase & | Prop (int iProp) |
void | UseUpId () |
wxSizer * | GetSizer () |
Static Public Member Functions | |
static void | SetMinSize (wxWindow *window, const TranslatableStrings &items) |
static void | SetMinSize (wxWindow *window, const wxArrayStringEx &items) |
Static Public Member Functions inherited from ShuttleGuiBase | |
static void | ApplyItem (int step, const DialogDefinition::Item &item, wxWindow *pWind, wxWindow *pDlg) |
Additional Inherited Members | |
Protected Member Functions inherited from ShuttleGuiBase | |
void | SetProportions (int Default) |
void | PushSizer () |
void | PopSizer () |
void | UpdateSizersCore (bool bPrepend, int Flags, bool prompt=false) |
void | UpdateSizers () |
void | UpdateSizersC () |
void | UpdateSizersAtStart () |
long | GetStyle (long Style) |
Protected Attributes inherited from ShuttleGuiBase | |
wxWindow *const | mpDlg |
wxSizer * | pSizerStack [nMaxNestedSizers] |
std::unique_ptr< ShuttlePrefs > | mpShuttle |
int | miNoMatchSelector |
teShuttleMode | mShuttleMode |
Used in choices to determine which item to use on no match. More... | |
int | miSizerProp |
int | mSizerDepth |
int | miBorder |
int | miProp |
int | miId |
int | miIdNext |
int | miIdSetByUser |
int | miPropSetByUser |
bool * | mpbOptionalFlag |
std::unique_ptr< wxSizer > | mpSubSizer |
wxSizer * | mpSizer |
wxWindow * | mpParent |
wxWindow * | mpWind |
DialogDefinition::Item | mItem |
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
ShuttleGui extends the idea of the data Shuttle class to include creation of dialog controls. As part of this it provides an interface to sizers that leads to shorter more readable code.
It also allows the code that is used to create dialogs to be reused to shuttle information in and out.
Most of the ShuttleGui functions are actually defined in ShuttleGuiBase.
There is documentation on how to use this class in The Shuttle System
Definition at line 639 of file ShuttleGui.h.
ShuttleGui::ShuttleGui | ( | wxWindow * | pParent, |
teShuttleMode | ShuttleMode, | ||
bool | vertical = true , |
||
wxSize | minSize = { 250, 100 } |
||
) |
Definition at line 2310 of file ShuttleGui.cpp.
References eIsCreating, eIsCreatingFromPrefs, eIsGettingFromDialog, eIsSavingToPrefs, ShuttleGuiBase::Init(), ShuttleGuiBase::mpShuttle, and ShuttleGuiBase::mShuttleMode.
ShuttleGui::~ShuttleGui | ( | void | ) |
Definition at line 2334 of file ShuttleGui.cpp.
|
inline |
Definition at line 752 of file ShuttleGui.h.
References AddSpace(), and size.
Referenced by AddSpace().
wxSizerItem * ShuttleGui::AddSpace | ( | int | width, |
int | height, | ||
int | prop = 0 |
||
) |
Definition at line 2524 of file ShuttleGui.cpp.
References eIsCreating, ShuttleGuiBase::mpSizer, and ShuttleGuiBase::mShuttleMode.
Referenced by ErrorReportDialog::ErrorReportDialog(), audacity::cloud::audiocom::ShareAudioDialog::Populate(), audacity::cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), PitchAndSpeedDialog::PopulateOrExchange(), and audacity::cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().
void ShuttleGui::AddStandardButtons | ( | long | buttons = eOkButton | eCancelButton , |
wxWindow * | extra = NULL |
||
) |
Definition at line 2509 of file ShuttleGui.cpp.
References CreateStdButtonSizer(), eIsCreating, ShuttleGuiBase::EndVerticalLay(), ShuttleGuiBase::miSizerProp, ShuttleGuiBase::mpParent, ShuttleGuiBase::mpSubSizer, ShuttleGuiBase::mShuttleMode, ShuttleGuiBase::PopSizer(), ShuttleGuiBase::StartVerticalLay(), and ShuttleGuiBase::UpdateSizers().
|
inline |
Definition at line 708 of file ShuttleGui.h.
References ConnectRoot().
Referenced by ConnectRoot().
|
inline |
Definition at line 659 of file ShuttleGui.h.
References Disable().
Referenced by Disable().
|
inline |
Definition at line 653 of file ShuttleGui.h.
References Focus().
Referenced by Focus().
|
inline |
Definition at line 760 of file ShuttleGui.h.
ShuttleGui & ShuttleGui::Id | ( | int | id | ) |
Definition at line 2339 of file ShuttleGui.cpp.
References id, and ShuttleGuiBase::miIdSetByUser.
Referenced by PitchAndSpeedDialog::PopulateOrExchange().
|
inline |
Definition at line 741 of file ShuttleGui.h.
References MinSize().
Referenced by ErrorReportDialog::ErrorReportDialog(), and MinSize().
|
inline |
Definition at line 743 of file ShuttleGui.h.
References MinSize().
|
inline |
Definition at line 672 of file ShuttleGui.h.
Referenced by ErrorReportDialog::ErrorReportDialog(), Name(), and PitchAndSpeedDialog::PopulateOrExchange().
|
inline |
Definition at line 680 of file ShuttleGui.h.
References NameSuffix().
Referenced by NameSuffix().
ShuttleGui & ShuttleGui::Optional | ( | bool & | bVar | ) |
Definition at line 2345 of file ShuttleGui.cpp.
References ShuttleGuiBase::mpbOptionalFlag.
|
inline |
Definition at line 720 of file ShuttleGui.h.
References Position().
Referenced by Position().
|
inline |
Definition at line 733 of file ShuttleGui.h.
References ShuttleGuiBase::Prop().
Referenced by audacity::cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel().
|
static |
Definition at line 2535 of file ShuttleGui.cpp.
References SetMinSize(), and TranslatableString::StrippedTranslation().
Referenced by DevicePrefs::OnDevice(), DevicePrefs::OnHost(), MidiIOPrefs::OnHost(), SetMinSize(), and ShuttleGuiBase::TieChoice().
|
static |
Definition at line 2542 of file ShuttleGui.cpp.
|
inline |
|
inline |
Definition at line 735 of file ShuttleGui.h.
References Style().
Referenced by ErrorReportDialog::ErrorReportDialog(), and Style().
|
inline |
Definition at line 665 of file ShuttleGui.h.
References ToolTip().
Referenced by ToolTip().
|
inline |
Definition at line 696 of file ShuttleGui.h.
References eIsCreating, and Validator().
|
inline |
Definition at line 687 of file ShuttleGui.h.
References eIsCreating, and Validator().
Referenced by Validator().