Audacity  2.2.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ShuttleGuiBase Class Reference

Base class for shuttling data to and from a GUI. More...

#include <ShuttleGui.h>

Inheritance diagram for ShuttleGuiBase:
ShuttleGui ShuttleGuiGetDefinition

Public Member Functions

 ShuttleGuiBase (wxWindow *pParent, teShuttleMode ShuttleMode)
 
virtual ~ShuttleGuiBase ()
 
void Init ()
 
void ResetId ()
 
void HandleOptionality (const wxString &Prompt)
 
void AddPrompt (const wxString &Prompt)
 Right aligned text string. More...
 
void AddUnits (const wxString &Prompt)
 Left aligned text string. More...
 
void AddTitle (const wxString &Prompt)
 Centred text string. More...
 
wxWindow * AddWindow (wxWindow *pWindow, int Flags=wxALIGN_CENTRE|wxALL)
 
wxSlider * AddSlider (const wxString &Prompt, int pos, int Max, int Min=0)
 
wxSlider * AddVSlider (const wxString &Prompt, int pos, int Max)
 
wxSpinCtrl * AddSpinCtrl (const wxString &Prompt, int Value, int Max, int Min)
 
wxTreeCtrl * AddTree ()
 
wxRadioButton * AddRadioButton (const wxString &Prompt)
 
wxRadioButton * AddRadioButtonToGroup (const wxString &Prompt)
 
wxButton * AddButton (const wxString &Text, int PositionFlags=wxALIGN_CENTRE)
 
wxBitmapButton * AddBitmapButton (const wxBitmap &Bitmap, int PositionFlags=wxALIGN_CENTRE)
 
wxStaticText * AddVariableText (const wxString &Str, bool bCenter=false, int PositionFlags=0)
 
wxTextCtrl * AddTextBox (const wxString &Caption, const wxString &Value, const int nChars)
 
wxTextCtrl * AddNumericTextBox (const wxString &Caption, const wxString &Value, const int nChars)
 
wxTextCtrl * AddTextWindow (const wxString &Value)
 Multiline text box that grows. More...
 
wxListBox * AddListBox (const wxArrayString *pChoices, long style=0)
 
wxListCtrl * AddListControl ()
 
wxListCtrl * AddListControlReportMode ()
 
wxGrid * AddGrid ()
 
wxCheckBox * AddCheckBox (const wxString &Prompt, const wxString &Selected)
 
wxCheckBox * AddCheckBoxOnRight (const wxString &Prompt, const wxString &Selected)
 
wxComboBox * AddCombo (const wxString &Prompt, const wxString &Selected, const wxArrayString *pChoices, long style=0)
 
wxChoice * AddChoice (const wxString &Prompt, const wxString &Selected, const wxArrayString *pChoices)
 
wxMenuBar * AddMenuBar ()
 
wxMenu * AddMenu (const wxString &Title)
 
void AddIcon (wxBitmap *pBmp)
 
void AddIconButton (const wxString &Command, const wxString &Params, wxBitmap *pBmp)
 
void AddFixedText (const wxString &Str, bool bCenter=false)
 
void AddConstTextBox (const wxString &Caption, const wxString &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 ()
 
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 wxString &Str, int iProp=0)
 
void EndStatic ()
 
wxNotebook * StartNotebook ()
 
void EndNotebook ()
 
wxNotebookPageStartNotebookPage (const wxString &Name)
 
void StartNotebookPage (const wxString &Name, wxNotebookPage *pPage)
 
void EndNotebookPage ()
 
wxPanel * StartInvisiblePanel ()
 
void EndInvisiblePanel ()
 
void StartRadioButtonGroup (const wxString &SettingName)
 
void EndRadioButtonGroup ()
 
void StartRadioButtonGroup (const wxString &SettingName, const int iDefaultValue)
 
void StartRadioButtonGroup (const wxString &SettingName, const wxString &DefaultValue)
 
void DoDataShuttle (const wxString &Name, WrappedType &WrappedRef)
 
bool DoStep (int iStep)
 
int TranslateToIndex (const wxString &Value, const wxArrayString &Choices)
 String-to-Index. More...
 
wxString TranslateFromIndex (const int nIn, const wxArrayString &Choices)
 Index-to-String. More...
 
int TranslateToIndex (const int Value, const std::vector< int > &Choices)
 Int-to-Index (choices can be items like e.g 0x400120 ) More...
 
int TranslateFromIndex (const int nIn, const std::vector< int > &Choices)
 Index-to-int (choices can be items like e.g 0x400120 ) More...
 
wxTextCtrl * TieTextBox (const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
 
wxTextCtrl * TieTextBox (const wxString &Caption, wxString &Value, const int nChars=0)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, int &Selected, const int nChars=0)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, double &Value, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
 
wxTextCtrl * TieNumericTextBox (const wxString &Caption, wxString &Value, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, int &Selected, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, double &Value, const int nChars=0)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, WrappedType &WrappedRef)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, const wxString &Selected)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, bool &Var)
 
wxCheckBox * TieCheckBoxOnRight (const wxString &Prompt, WrappedType &WrappedRef)
 
wxCheckBox * TieCheckBoxOnRight (const wxString &Prompt, bool &Var)
 
wxChoice * TieChoice (const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
 
wxChoice * TieChoice (const wxString &Prompt, wxString &Selected, const wxArrayString *pChoices)
 
wxChoice * TieChoice (const wxString &Prompt, int &Selected, const wxArrayString *pChoices)
 
wxSlider * TieSlider (const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
 
wxSlider * TieSlider (const wxString &Prompt, int &pos, const int max, const int min=0)
 
wxSlider * TieSlider (const wxString &Prompt, double &pos, const double max, const double min=0.0)
 
wxSlider * TieSlider (const wxString &Prompt, float &pos, const float fMin, const float fMax)
 
wxSlider * TieVSlider (const wxString &Prompt, float &pos, const float fMin, const float fMax)
 
wxRadioButton * TieRadioButton (const wxString &Prompt, WrappedType &WrappedRef)
 
wxRadioButton * TieRadioButton (const wxString &Prompt, const int iValue)
 This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair. More...
 
wxRadioButton * TieRadioButton (const wxString &Prompt, const wxString &Value)
 This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair. More...
 
wxSpinCtrl * TieSpinCtrl (const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
 
wxSpinCtrl * TieSpinCtrl (const wxString &Prompt, int &Value, const int max, const int min=0)
 
virtual wxCheckBox * TieCheckBox (const wxString &Prompt, const wxString &SettingName, const bool bDefault)
 
virtual wxCheckBox * TieCheckBoxOnRight (const wxString &Prompt, const wxString &SettingName, const bool bDefault)
 
virtual wxChoice * TieChoice (const wxString &Prompt, EnumSetting &enumSetting)
 
virtual wxChoice * TieChoice (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const wxArrayString &Choices, const wxArrayString &InternalChoices)
 
virtual wxChoice * TieChoice (const wxString &Prompt, const wxString &SettingName, const int Default, const wxArrayString &Choices, const std::vector< int > &InternalChoices)
 
virtual wxChoice * TieNumberAsChoice (const wxString &Prompt, const wxString &SettingName, const int Default, const wxArrayString &Choices, const std::vector< int > &InternalChoices)
 
virtual wxTextCtrl * TieTextBox (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const int nChars)
 
virtual wxTextCtrl * TieTextBox (const wxString &Prompt, const wxString &SettingName, const double &Default, const int nChars)
 
virtual wxTextCtrl * TieNumericTextBox (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const int nChars)
 
virtual wxTextCtrl * TieNumericTextBox (const wxString &Prompt, const wxString &SettingName, const double &Default, const int nChars)
 
virtual wxSlider * TieSlider (const wxString &Prompt, const wxString &SettingName, const int iDefault, const int max, const int min=0)
 
virtual wxSpinCtrl * TieSpinCtrl (const wxString &Prompt, const wxString &SettingName, const int Value, const int max, const int min)
 
void EnableCtrl (bool bEnable)
 
void SetSizeHints (int minX, int minY)
 Used to modify an already placed Window. More...
 
void SetBorder (int Border)
 
void SetStyle (int Style)
 
void SetNoMatchSelector (int iSelector)
 
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 ()
 
ShuttleGuiBaseProp (int iProp)
 
void UseUpId ()
 
wxSizer * GetSizer ()
 

Static Public Member Functions

static void SetSizeHints (wxWindow *window, const wxArrayString &items)
 

Protected Member Functions

void SetProportions (int Default)
 
void PushSizer ()
 
void PopSizer ()
 
void UpdateSizersCore (bool bPrepend, int Flags)
 
void UpdateSizers ()
 
void UpdateSizersC ()
 
void UpdateSizersAtStart ()
 
long Style (long Style)
 

Protected Attributes

wxWindow * mpLastWind
 
wxWindow * mpDlg
 
wxSizer * pSizerStack [nMaxNestedSizers]
 
std::unique_ptr< ShuttlempShuttle
 
int miNoMatchSelector
 
teShuttleMode mShuttleMode
 Used in choices to determine which item to use on no match. More...
 
wxString mSettingName
 
int mRadioCount
 The setting controlled by a group. More...
 
WrappedType mRadioValue
 The index of this radio item. -1 for none. More...
 
wxString mRadioValueString
 The wrapped value associated with the active radio button. More...
 
int mRadioValueInt
 Unwrapped string value. More...
 
int miSizerProp
 Unwrapped integer value. More...
 
int mSizerDepth
 
int miBorder
 
long miStyle
 
int miProp
 
int miId
 
int miIdNext
 
int miIdSetByUser
 
int miPropSetByUser
 
bool * mpbOptionalFlag
 
std::unique_ptr< wxSizer > mpSubSizer
 
wxSizer * mpSizer
 
wxWindow * mpParent
 
wxWindow * mpWind
 
wxMenuBar * mpMenuBar
 
wxMenu * mpMenu
 

Private Member Functions

void SetSizeHints (const wxArrayString &items)
 

Detailed Description

Base class for shuttling data to and from a GUI.

see also ShuttleGui

Use the:

The code in this file is fairly repetitive. We are dealing with

A technique used to reduce the size of the Tie functions is to have one generic Tie function that uses WrappedType for its data type. Type specific Tie functions themselves call the generic variant.

A second technique used to reduce the size of Tie functions only comes into play for two-step Tie functions. (A two step Tie function is one that transfers data between the registry and the GUI via an intermediate temporary variable). In the two step style, a function ShuttleGuiBase::DoStep() determines which transfers in the function are to be done, reducing repetitive if-then-else's.

Although unusual, these two techniques make the code easier to add to and much easier to check for correctness. The alternative 'more obvious' code that just repeats code as needed is considerably longer.

You would rarely use ShuttleGuiBase directly, instead you'd use ShuttleGui.

There is DOxygen documentation on how to use the ShuttleGui class in The Shuttle System .

Definition at line 80 of file ShuttleGui.h.

Constructor & Destructor Documentation

ShuttleGuiBase::ShuttleGuiBase ( wxWindow *  pParent,
teShuttleMode  ShuttleMode 
)

Definition at line 120 of file ShuttleGui.cpp.

References eIsCreating, Init(), mpbOptionalFlag, mpDlg, mpParent, and mShuttleMode.

121 {
122  wxASSERT( (pParent != NULL ) || ( ShuttleMode != eIsCreating));
123  mpbOptionalFlag = nullptr;
124  mpParent = pParent;
125  mShuttleMode = ShuttleMode;
126  mpDlg = pParent;
127  Init();
128 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
bool * mpbOptionalFlag
Definition: ShuttleGui.h:355
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
ShuttleGuiBase::~ShuttleGuiBase ( )
virtual

Definition at line 130 of file ShuttleGui.cpp.

131 {
132 }

Member Function Documentation

wxBitmapButton * ShuttleGuiBase::AddBitmapButton ( const wxBitmap &  Bitmap,
int  PositionFlags = wxALIGN_CENTRE 
)

Definition at line 355 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizersCore(), and UseUpId().

356 {
357  UseUpId();
358  if( mShuttleMode != eIsCreating )
359  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxBitmapButton);
360  wxBitmapButton * pBtn;
361  mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, Bitmap,
362  wxDefaultPosition, wxDefaultSize, Style( wxNO_BORDER ) );
363  pBtn->SetBackgroundColour(
364  wxColour( 246,246,243));
365 // wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
366  miProp=0;
367  UpdateSizersCore(false, PositionFlags | wxALL);
368  return pBtn;
369 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void UpdateSizersCore(bool bPrepend, int Flags)
long Style(long Style)
wxButton * ShuttleGuiBase::AddButton ( const wxString &  Text,
int  PositionFlags = wxALIGN_CENTRE 
)

Definition at line 341 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizersCore(), and UseUpId().

Referenced by NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), ExportCL::Export(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), BenchmarkDialog::MakeBenchmarkDialog(), ApplyMacroDialog::OnApplyToFiles(), DirectoriesPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), ApplyMacroDialog::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), LabelDialog::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), and HelpSystem::ShowHtmlText().

342 {
343  UseUpId();
344  if( mShuttleMode != eIsCreating )
345  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxButton);
346  wxButton * pBtn;
347  mpWind = pBtn = safenew wxButton(GetParent(), miId, Text, wxDefaultPosition, wxDefaultSize,
348  Style( 0 ) );
349  mpWind->SetName(wxStripMenuCodes(Text));
350  miProp=0;
351  UpdateSizersCore(false, PositionFlags | wxALL);
352  return pBtn;
353 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void UpdateSizersCore(bool bPrepend, int Flags)
long Style(long Style)
wxCheckBox * ShuttleGuiBase::AddCheckBox ( const wxString &  Prompt,
const wxString &  Selected 
)

Definition at line 298 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpbOptionalFlag, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by NyquistEffect::BuildPromptWindow(), FreqWindow::FreqWindow(), BenchmarkDialog::MakeBenchmarkDialog(), SplashDialog::Populate(), EffectNormalize::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), TieCheckBox(), and WarningDialog::WarningDialog().

299 {
300  HandleOptionality( Prompt );
301  wxString realPrompt = Prompt;
302  if( mpbOptionalFlag )
303  {
304  AddPrompt( "");
305  //realPrompt = wxT("");
306  }
307 
308  UseUpId();
309  if( mShuttleMode != eIsCreating )
310  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
311  wxCheckBox * pCheckBox;
312  miProp=0;
313  mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, realPrompt, wxDefaultPosition, wxDefaultSize,
314  Style( 0 ));
315  pCheckBox->SetValue(Selected == wxT("true"));
316  pCheckBox->SetName(wxStripMenuCodes(Prompt));
317  UpdateSizers();
318  return pCheckBox;
319 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
wxWindow * GetParent()
Definition: ShuttleGui.h:294
bool * mpbOptionalFlag
Definition: ShuttleGui.h:355
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight ( const wxString &  Prompt,
const wxString &  Selected 
)

For a consistant two-column layout we want labels on the left and controls on the right. CheckBoxes break that rule, so we fake it by placing a static text label and then a tick box with an empty label.

Definition at line 324 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by TieCheckBoxOnRight().

325 {
326  HandleOptionality( Prompt );
327  AddPrompt( Prompt );
328  UseUpId();
329  if( mShuttleMode != eIsCreating )
330  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
331  wxCheckBox * pCheckBox;
332  miProp=0;
333  mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, wxT(""), wxDefaultPosition, wxDefaultSize,
334  Style( 0 ));
335  pCheckBox->SetValue(Selected==wxT("true"));
336  pCheckBox->SetName(wxStripMenuCodes(Prompt));
337  UpdateSizers();
338  return pCheckBox;
339 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxChoice * ShuttleGuiBase::AddChoice ( const wxString &  Prompt,
const wxString &  Selected,
const wxArrayString *  pChoices 
)

Definition at line 371 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by ExportMP3::AskResample(), NyquistEffect::BuildEffectWindow(), EffectPresetsDialog::EffectPresetsDialog(), FreqWindow::FreqWindow(), ImportRawDialog::ImportRawDialog(), LangChoiceDialog::LangChoiceDialog(), DevicePrefs::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), DeviceToolBar::ShowComboDialog(), and TieChoice().

372 {
373  HandleOptionality( Prompt );
374  AddPrompt( Prompt );
375  UseUpId();
376  if( mShuttleMode != eIsCreating )
377  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxChoice);
378  wxChoice * pChoice;
379  miProp=0;
380 
381  mpWind = pChoice = safenew wxChoice(
382  GetParent(),
383  miId,
384  wxDefaultPosition,
385  wxDefaultSize,
386  *pChoices,
387  Style( 0 ) );
388 
389  pChoice->SetSizeHints( 180,-1);// Use -1 for 'default size' - Platform specific.
390  pChoice->SetName(wxStripMenuCodes(Prompt));
391  pChoice->SetStringSelection( Selected );
392 
393  UpdateSizers();
394  return pChoice;
395 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxComboBox * ShuttleGuiBase::AddCombo ( const wxString &  Prompt,
const wxString &  Selected,
const wxArrayString *  pChoices,
long  style = 0 
)

Definition at line 440 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by RateMenuTable::OnRateOther(), AudacityProject::OnResample(), and ExportCLOptions::PopulateOrExchange().

441 {
442  HandleOptionality( Prompt );
443  AddPrompt( Prompt );
444  UseUpId();
445  if( mShuttleMode != eIsCreating )
446  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxComboBox);
447  wxComboBox * pCombo;
448  miProp=0;
449 
450  int n = pChoices->GetCount();
451  if( n>50 ) n=50;
452  int i;
453  wxString Choices[50];
454  for(i=0;i<n;i++)
455  {
456  Choices[i] = (*pChoices)[i];
457  }
458 
459  mpWind = pCombo = safenew wxComboBox(GetParent(), miId, Selected, wxDefaultPosition, wxDefaultSize,
460  n, Choices, Style( style ));
461  mpWind->SetName(wxStripMenuCodes(Prompt));
462 
463  UpdateSizers();
464  return pCombo;
465 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
void ShuttleGuiBase::AddConstTextBox ( const wxString &  Caption,
const wxString &  Value 
)

Single line text box of fixed size.

Definition at line 629 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by EditCurvesDialog::PopulateOrExchange().

630 {
631  HandleOptionality( Prompt );
632  AddPrompt( Prompt );
633  UseUpId();
634  if( mShuttleMode != eIsCreating )
635  return;
636 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
637  miProp=0;
638  UpdateSizers();
639  miProp=0;
640  mpWind = safenew wxStaticText(GetParent(), miId, Value, wxDefaultPosition, wxDefaultSize,
641  Style( 0 ));
642  mpWind->SetName(Value); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
643  UpdateSizers();
644 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
void ShuttleGuiBase::AddFixedText ( const wxString &  Str,
bool  bCenter = false 
)

Definition at line 397 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, miProp, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), UpdateSizersC(), and UseUpId().

Referenced by ApplyMacroDialog::ApplyMacroToProject(), ContrastDialog::ContrastDialog(), ErrorDialog::ErrorDialog(), MeterPanel::OnPreferences(), DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), LabelDialog::PopulateOrExchange(), and WarningDialog::WarningDialog().

398 {
399  UseUpId();
400  if( mShuttleMode != eIsCreating )
401  return;
402  mpWind = safenew wxStaticText(GetParent(), miId, Str, wxDefaultPosition, wxDefaultSize,
403  Style( wxALIGN_LEFT ));
404  mpWind->SetName(wxStripMenuCodes(Str)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
405  if( bCenter )
406  {
407  miProp=1;
408  UpdateSizersC();
409  }
410  else
411  UpdateSizers();
412 }
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
void UpdateSizersC()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxGrid * ShuttleGuiBase::AddGrid ( )

Definition at line 675 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, SetProportions(), Style(), UpdateSizers(), and UseUpId().

676 {
677  UseUpId();
678  if( mShuttleMode != eIsCreating )
679  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxGrid);
680  wxGrid * pGrid;
681  SetProportions( 1 );
682  mpWind = pGrid = safenew wxGrid(GetParent(), miId, wxDefaultPosition,
683  wxDefaultSize, Style( wxWANTS_CHARS ));
684  pGrid->SetMinSize( wxSize( 120, 150 ));
685  UpdateSizers();
686  return pGrid;
687 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
void ShuttleGuiBase::AddIcon ( wxBitmap *  pBmp)

Definition at line 718 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpWind, mShuttleMode, safenew, Style(), UpdateSizersC(), and UseUpId().

719 {
720  UseUpId();
721  if( mShuttleMode != eIsCreating )
722 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
723  return;
724  wxBitmapButton * pBtn;
725  mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, *pBmp,
726  wxDefaultPosition, wxDefaultSize, Style( wxBU_AUTODRAW ) );
727  pBtn->SetWindowStyle( 0 );
728  UpdateSizersC();
729 }
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
void UpdateSizersC()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
void ShuttleGuiBase::AddIconButton ( const wxString &  Command,
const wxString &  Params,
wxBitmap *  pBmp 
)
wxListBox * ShuttleGuiBase::AddListBox ( const wxArrayString *  pChoices,
long  style = 0 
)

Definition at line 646 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, SetProportions(), UpdateSizers(), and UseUpId().

Referenced by EffectPresetsDialog::EffectPresetsDialog().

647 {
648  UseUpId();
649  if( mShuttleMode != eIsCreating )
650  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListBox);
651  wxListBox * pListBox;
652  SetProportions( 1 );
653  mpWind = pListBox = safenew wxListBox(GetParent(), miId,
654  wxDefaultPosition, wxDefaultSize,*pChoices, style);
655  pListBox->SetMinSize( wxSize( 120,150 ));
656  UpdateSizers();
657  return pListBox;
658 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
wxListCtrl * ShuttleGuiBase::AddListControl ( )

Definition at line 661 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, SetProportions(), Style(), UpdateSizers(), and UseUpId().

Referenced by MacroCommandDialog::PopulateOrExchange(), and ExtImportPrefs::PopulateOrExchange().

662 {
663  UseUpId();
664  if( mShuttleMode != eIsCreating )
665  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListCtrl);
666  wxListCtrl * pListCtrl;
667  SetProportions( 1 );
668  mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId,
669  wxDefaultPosition, wxDefaultSize, Style( wxLC_ICON ));
670  pListCtrl->SetMinSize( wxSize( 120,150 ));
671  UpdateSizers();
672  return pListCtrl;
673 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
wxListCtrl * ShuttleGuiBase::AddListControlReportMode ( )

Definition at line 689 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, SetProportions(), Style(), UpdateSizers(), and UseUpId().

Referenced by HistoryWindow::HistoryWindow(), ApplyMacroDialog::OnApplyToFiles(), MousePrefs::PopulateOrExchange(), ApplyMacroDialog::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), and PluginRegistrationDialog::PopulateOrExchange().

690 {
691  UseUpId();
692  if( mShuttleMode != eIsCreating )
693  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListCtrl);
694  wxListCtrl * pListCtrl;
695  SetProportions( 1 );
696  mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId,
697  wxDefaultPosition, wxSize(230,120),//wxDefaultSize,
698  Style( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER ));
699 // pListCtrl->SetMinSize( wxSize( 120,150 ));
700  UpdateSizers();
701  return pListCtrl;
702 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
wxMenu * ShuttleGuiBase::AddMenu ( const wxString &  Title)

Definition at line 750 of file ShuttleGui.cpp.

References mpMenu, mpMenuBar, and safenew.

751 {
752  mpMenuBar->Append( (mpMenu = safenew wxMenu), Title );
753  return mpMenu;
754 }
#define safenew
Definition: Audacity.h:230
wxMenu * mpMenu
Definition: ShuttleGui.h:362
wxMenuBar * mpMenuBar
Definition: ShuttleGui.h:361
wxMenuBar * ShuttleGuiBase::AddMenuBar ( )

Definition at line 737 of file ShuttleGui.cpp.

References mpMenuBar, and mpParent.

738 {
739  auto menuBar = std::make_unique<wxMenuBar>();
740  mpMenuBar = menuBar.get();
741 
742  wxFrame * pFrame = (wxFrame*)mpParent;
743  pFrame->SetThemeEnabled( true );
744  mpMenuBar->SetThemeEnabled( true );
745  pFrame->SetMenuBar(menuBar.release());
746 
747  return mpMenuBar;
748 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
wxMenuBar * mpMenuBar
Definition: ShuttleGui.h:361
wxTextCtrl * ShuttleGuiBase::AddNumericTextBox ( const wxString &  Caption,
const wxString &  Value,
const int  nChars 
)

Definition at line 572 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by TieNumericTextBox().

573 {
574  HandleOptionality( Caption );
575  AddPrompt( Caption );
576  UseUpId();
577  if( mShuttleMode != eIsCreating )
578  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
579  wxTextCtrl * pTextCtrl;
580  wxSize Size(wxDefaultSize);
581  if( nChars > 0 )
582  {
583  Size.SetWidth( nChars *5 );
584  }
585  miProp=0;
586 
587 #ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
588  long flags = wxTE_RIGHT;
589 #else
590  long flags = wxTE_LEFT;
591 #endif
592 
593  wxTextValidator Validator(wxFILTER_NUMERIC);
594  mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
595  wxDefaultPosition, Size, Style( flags ),
596  Validator // It's OK to pass this. It will be cloned.
597  );
598 #if wxUSE_ACCESSIBILITY
599  // so that name can be set on a standard control
600  mpWind->SetAccessible(safenew WindowAccessible(mpWind));
601 #endif
602  mpWind->SetName(wxStripMenuCodes(Caption));
603  UpdateSizers();
604  return pTextCtrl;
605 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
A Validator is an object which checks whether a wxVariant satisfies a certain criterion. This is a base validator which allows anything.
Definition: Validators.h:48
void ShuttleGuiBase::AddPrompt ( const wxString &  Prompt)

Right aligned text string.

Definition at line 239 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miProp, mpbOptionalFlag, mpWind, mShuttleMode, safenew, Style(), TieCheckBox(), and UpdateSizersCore().

Referenced by AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddNumericTextBox(), AddSlider(), AddSpinCtrl(), AddTextBox(), NyquistEffect::BuildEffectWindow(), EffectPresetsDialog::EffectPresetsDialog(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), LabelTrackMenuTable::OnSetFont(), DevicePrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), ApplyMacroDialog::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and PluginRegistrationDialog::PopulateOrExchange().

240 {
241  if( mShuttleMode != eIsCreating )
242  return;
243  //wxLogDebug( "Prompt: [%s] Id:%i (%i)", Prompt.c_str(), miId, miIdSetByUser ) ;
244  if( mpbOptionalFlag ){
245  bool * pVar = mpbOptionalFlag;
246  mpbOptionalFlag = nullptr;
247  TieCheckBox( "", *pVar);
248  //return;
249  }
250  if( Prompt.IsEmpty() )
251  return;
252  miProp=1;
253  mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize,
254  Style( wxALIGN_RIGHT ));
255  mpWind->SetName(wxStripMenuCodes(Prompt)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
256  UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL );
257 }
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
bool * mpbOptionalFlag
Definition: ShuttleGui.h:355
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void UpdateSizersCore(bool bPrepend, int Flags)
wxCheckBox * TieCheckBox(const wxString &Prompt, WrappedType &WrappedRef)
long Style(long Style)
wxRadioButton * ShuttleGuiBase::AddRadioButton ( const wxString &  Prompt)
Todo:
This function and the next one, suitably adapted, could be used by TieRadioButton.

Definition at line 468 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by MeterPanel::OnPreferences(), ExportMultiple::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and PluginRegistrationDialog::PopulateOrExchange().

469 {
472  UseUpId();
473  if( mShuttleMode != eIsCreating )
474  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton);
475  wxRadioButton * pRad;
476  mpWind = pRad = safenew wxRadioButton(GetParent(), miId, Prompt,
477  wxDefaultPosition, wxDefaultSize, Style( wxRB_GROUP ) );
478  mpWind->SetName(wxStripMenuCodes(Prompt));
479  pRad->SetValue(true );
480  UpdateSizers();
481  return pRad;
482 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxRadioButton * ShuttleGuiBase::AddRadioButtonToGroup ( const wxString &  Prompt)

Definition at line 484 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by MeterPanel::OnPreferences(), ExportMultiple::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and PluginRegistrationDialog::PopulateOrExchange().

485 {
486  UseUpId();
487  if( mShuttleMode != eIsCreating )
488  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton);
489  wxRadioButton * pRad;
490  mpWind = pRad = safenew wxRadioButton(GetParent(), miId, Prompt,
491  wxDefaultPosition, wxDefaultSize, Style( 0 ) );
492  mpWind->SetName(wxStripMenuCodes(Prompt));
493  UpdateSizers();
494  return pRad;
495 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxSlider * ShuttleGuiBase::AddSlider ( const wxString &  Prompt,
int  pos,
int  Max,
int  Min = 0 
)

Definition at line 497 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by NyquistEffect::BuildEffectWindow(), EffectClickRemoval::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), and TieSlider().

498 {
499  HandleOptionality( Prompt );
500  AddPrompt( Prompt );
501  UseUpId();
502  if( mShuttleMode != eIsCreating )
503  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSlider);
504  wxSlider * pSlider;
505  mpWind = pSlider = safenew wxSlider(GetParent(), miId,
506  pos, Min, Max,
507  wxDefaultPosition, wxDefaultSize,
508  Style( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS )
509  );
510 #if wxUSE_ACCESSIBILITY
511  // so that name can be set on a standard control
512  mpWind->SetAccessible(safenew WindowAccessible(mpWind));
513 #endif
514  mpWind->SetName(wxStripMenuCodes(Prompt));
515  miProp=1;
516  UpdateSizers();
517  return pSlider;
518 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxSpinCtrl * ShuttleGuiBase::AddSpinCtrl ( const wxString &  Prompt,
int  Value,
int  Max,
int  Min 
)

Definition at line 520 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by TieSpinCtrl().

521 {
522  HandleOptionality( Prompt );
523  AddPrompt( Prompt );
524  UseUpId();
525  if( mShuttleMode != eIsCreating )
526  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSpinCtrl);
527  wxSpinCtrl * pSpinCtrl;
528  mpWind = pSpinCtrl = safenew wxSpinCtrl(GetParent(), miId,
529  wxEmptyString,
530  wxDefaultPosition, wxDefaultSize,
531  Style( wxSP_VERTICAL | wxSP_ARROW_KEYS ),
532  Min, Max, Value
533  );
534  mpWind->SetName(wxStripMenuCodes(Prompt));
535  miProp=1;
536  UpdateSizers();
537  return pSpinCtrl;
538 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxTextCtrl * ShuttleGuiBase::AddTextBox ( const wxString &  Caption,
const wxString &  Value,
const int  nChars 
)

Definition at line 540 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), and UseUpId().

Referenced by NyquistEffect::BuildEffectWindow(), ContrastDialog::ContrastDialog(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), ImportRawDialog::ImportRawDialog(), BenchmarkDialog::MakeBenchmarkDialog(), MeterPanel::OnPreferences(), EffectUIHost::OnSaveAs(), EffectPaulstretch::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectEcho::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), FindDialog::PopulateOrExchange(), SliderDialog::SliderDialog(), and TieTextBox().

541 {
542  HandleOptionality( Caption );
543  AddPrompt( Caption );
544  UseUpId();
545  if( mShuttleMode != eIsCreating )
546  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
547  wxTextCtrl * pTextCtrl;
548  wxSize Size(wxDefaultSize);
549  if( nChars > 0 )
550  {
551  Size.SetWidth( nChars *5 );
552  }
553  miProp=0;
554 
555 #ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
556  long flags = wxTE_RIGHT;
557 #else
558  long flags = wxTE_LEFT;
559 #endif
560 
561  mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
562  wxDefaultPosition, Size, Style( flags ));
563 #if wxUSE_ACCESSIBILITY
564  // so that name can be set on a standard control
565  mpWind->SetAccessible(safenew WindowAccessible(mpWind));
566 #endif
567  mpWind->SetName(wxStripMenuCodes(Caption));
568  UpdateSizers();
569  return pTextCtrl;
570 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxTextCtrl * ShuttleGuiBase::AddTextWindow ( const wxString &  Value)

Multiline text box that grows.

Definition at line 608 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, SetProportions(), Style(), UpdateSizers(), and UseUpId().

Referenced by NyquistEffect::BuildPromptWindow(), ExportCL::Export(), LongMessageDialog::Init(), BenchmarkDialog::MakeBenchmarkDialog(), AudacityProject::OnAudioDeviceInfo(), TagsEditor::OnEdit(), MacroCommandDialog::PopulateOrExchange(), and HelpSystem::ShowInfoDialog().

609 {
610  UseUpId();
611  if( mShuttleMode != eIsCreating )
612  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
613  wxTextCtrl * pTextCtrl;
614  SetProportions( 1 );
615  mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
616  wxDefaultPosition, wxDefaultSize, Style( wxTE_MULTILINE ));
617 #if wxUSE_ACCESSIBILITY
618  // so that name can be set on a standard control
619  mpWind->SetAccessible(safenew WindowAccessible(mpWind));
620 #endif
621  UpdateSizers();
622  // Start off at start of window...
623  pTextCtrl->SetInsertionPoint( 0 );
624  pTextCtrl->ShowPosition( 0 );
625  return pTextCtrl;
626 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
void ShuttleGuiBase::AddTitle ( const wxString &  Prompt)

Centred text string.

Definition at line 274 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), mpWind, mShuttleMode, safenew, Style(), and UpdateSizers().

Referenced by ExportMP3::AskResample(), ContrastDialog::ContrastDialog(), ExportPlugin::OptionsCreate(), KeyConfigPrefs::Populate(), KeyConfigPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), FindDialog::PopulateOrExchange(), and HelpSystem::ShowInfoDialog().

275 {
276  if( Prompt.IsEmpty() )
277  return;
278  if( mShuttleMode != eIsCreating )
279  return;
280  mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize,
281  Style( wxALIGN_CENTRE ));
282  mpWind->SetName(Prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
283  UpdateSizers();
284 }
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxTreeCtrl * ShuttleGuiBase::AddTree ( )

Definition at line 704 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpWind, mShuttleMode, safenew, SetProportions(), Style(), UpdateSizers(), and UseUpId().

705 {
706  UseUpId();
707  if( mShuttleMode != eIsCreating )
708  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTreeCtrl);
709  wxTreeCtrl * pTreeCtrl;
710  SetProportions( 1 );
711  mpWind = pTreeCtrl = safenew wxTreeCtrl(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
712  Style( wxTR_HAS_BUTTONS ));
713  pTreeCtrl->SetMinSize( wxSize( 120,650 ));
714  UpdateSizers();
715  return pTreeCtrl;
716 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
void ShuttleGuiBase::AddUnits ( const wxString &  Prompt)

Left aligned text string.

Definition at line 260 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miProp, mpWind, mShuttleMode, safenew, Style(), and UpdateSizersCore().

Referenced by NyquistEffect::BuildEffectWindow(), ImportRawDialog::ImportRawDialog(), PlaybackPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), and TagsEditor::PopulateOrExchange().

261 {
262  if( Prompt.IsEmpty() )
263  return;
264  if( mShuttleMode != eIsCreating )
265  return;
266  miProp=1;
267  mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize,
268  Style( wxALIGN_LEFT ));
269  mpWind->SetName(Prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
270  UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL );
271 }
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void UpdateSizersCore(bool bPrepend, int Flags)
long Style(long Style)
wxStaticText * ShuttleGuiBase::AddVariableText ( const wxString &  Str,
bool  bCenter = false,
int  PositionFlags = 0 
)

Definition at line 414 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, Style(), UpdateSizers(), UpdateSizersC(), UpdateSizersCore(), and UseUpId().

Referenced by NyquistEffect::BuildPromptWindow(), HistoryWindow::HistoryWindow(), DirectoriesPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

415 {
416  UseUpId();
417  if( mShuttleMode != eIsCreating )
418  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxStaticText);
419 
420  wxStaticText *pStatic;
421  mpWind = pStatic = safenew wxStaticText(GetParent(), miId, Str, wxDefaultPosition, wxDefaultSize,
422  Style( wxALIGN_LEFT ));
423  mpWind->SetName(wxStripMenuCodes(Str)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
424  if( bCenter )
425  {
426  miProp=1;
427  if( PositionFlags )
428  UpdateSizersCore( false, PositionFlags );
429  else
430  UpdateSizersC();
431  }
432  else
433  if( PositionFlags )
434  UpdateSizersCore( false, PositionFlags );
435  else
436  UpdateSizers();
437  return pStatic;
438 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
void UpdateSizersC()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void UpdateSizersCore(bool bPrepend, int Flags)
long Style(long Style)
wxSlider* ShuttleGuiBase::AddVSlider ( const wxString &  Prompt,
int  pos,
int  Max 
)
wxWindow * ShuttleGuiBase::AddWindow ( wxWindow *  pWindow,
int  Flags = wxALIGN_CENTRE | wxALL 
)

Very generic 'Add' function. We can add anything we like. Useful for unique controls

Definition at line 288 of file ShuttleGui.cpp.

References eIsCreating, mpWind, mShuttleMode, SetProportions(), and UpdateSizersCore().

Referenced by AboutDialog::AboutDialog(), ContrastDialog::ContrastDialog(), Exporter::CreateUserPane(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), LabelTrackMenuTable::OnSetFont(), SplashDialog::Populate(), AboutDialog::PopulateAudacityPage(), AboutDialog::PopulateInformationPage(), AboutDialog::PopulateLicensePage(), EffectSilence::PopulateOrExchange(), TimeDialog::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), LabelDialog::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), PrefsDialog::PrefsDialog(), HelpSystem::ShowHtmlText(), and SliderDialog::SliderDialog().

289 {
290  if( mShuttleMode != eIsCreating )
291  return pWindow;
292  mpWind = pWindow;
293  SetProportions( 0 );
294  UpdateSizersCore(false, Flags);
295  return pWindow;
296 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void UpdateSizersCore(bool bPrepend, int Flags)
void SetProportions(int Default)
void ShuttleGuiBase::DoDataShuttle ( const wxString &  Name,
WrappedType WrappedRef 
)

When we're exchanging with the configured shuttle rather than with the GUI We use this function.

Definition at line 1082 of file ShuttleGui.cpp.

References mpShuttle.

Referenced by EndRadioButtonGroup(), StartRadioButtonGroup(), TieCheckBox(), TieCheckBoxOnRight(), TieChoice(), TieNumericTextBox(), TieSlider(), TieSpinCtrl(), and TieTextBox().

1083 {
1084  wxASSERT( mpShuttle );
1085  mpShuttle->TransferWrappedType( Name, WrappedRef );
1086 }
std::unique_ptr< Shuttle > mpShuttle
Definition: ShuttleGui.h:328
bool ShuttleGuiBase::DoStep ( int  iStep)

Code-Condenser function.

We have functions which need to do:

// Either: Values are coming in:
DoDataShuttle( SettingName, WrappedRef );
TieMyControl( Prompt, WrappedRef );
// Or: Values are going out:
TieMyControl( Prompt, WrappedRef );
DoDataShuttle( SettingName, WrappedRef );

So we make a list of all the possible steps, and have DoStep choose which ones are actually done, like this:

if( DoStep(1) ) DoFirstThing();
if( DoStep(2) ) DoSecondThing();
if( DoStep(3) ) DoThirdThing();

The repeated choice logic can then be taken out of those functions.

JKC: This paves the way for doing data validation too, though when we add that we wil need to renumber the steps.

Definition at line 1696 of file ShuttleGui.cpp.

References eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsSettingToDialog, and mShuttleMode.

Referenced by TieCheckBox(), TieCheckBoxOnRight(), TieChoice(), TieNumericTextBox(), TieSlider(), TieSpinCtrl(), and TieTextBox().

1697 {
1698  // Get value and create
1699  if( mShuttleMode == eIsCreating )
1700  {
1701  return (iStep==1) || (iStep==2);
1702  }
1703  // Like creating, get the value and set.
1705  {
1706  return (iStep==1) || (iStep==2);
1707  }
1709  {
1710  return (iStep==2) || (iStep==3);
1711  }
1713  return iStep ==2;
1714  wxASSERT( false );
1715  return false;
1716 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EnableCtrl ( bool  bEnable)

Definition at line 186 of file ShuttleGui.cpp.

References eIsCreating, mpLastWind, and mShuttleMode.

187 {
188  if( mShuttleMode != eIsCreating )
189  return;
190  mpLastWind->Enable( bEnable );
191 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpLastWind
Definition: ShuttleGui.h:324
void ShuttleGuiBase::EndHorizontalLay ( )

Definition at line 1033 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by ApplyMacroDialog::ApplyMacroToProject(), ExportMP3::AskResample(), NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), Exporter::CreateUserPane(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), BenchmarkDialog::MakeBenchmarkDialog(), ApplyMacroDialog::OnApplyToFiles(), MeterPanel::OnPreferences(), RateMenuTable::OnRateOther(), AudacityProject::OnResample(), EffectUIHost::OnSaveAs(), ExportPlugin::OptionsCreate(), BatchPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), ApplyMacroDialog::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), LabelDialog::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), PrefsDialog::PrefsDialog(), DeviceToolBar::ShowComboDialog(), HelpSystem::ShowHtmlText(), and HelpSystem::ShowInfoDialog().

1034 {
1035  if( mShuttleMode != eIsCreating )
1036  return;
1037  PopSizer();
1038 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndInvisiblePanel ( )

Definition at line 1012 of file ShuttleGui.cpp.

References EndPanel().

1013 {
1014  EndPanel();
1015 }
void ShuttleGuiBase::EndMultiColumn ( )

Definition at line 1073 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by NyquistEffect::BuildEffectWindow(), NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), ImportRawDialog::ImportRawDialog(), BenchmarkDialog::MakeBenchmarkDialog(), LabelTrackMenuTable::OnSetFont(), DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), SoundActivatedRecord::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), DemoCommand::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), GetTrackInfoCommand::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), DragCommand::PopulateOrExchange(), SetLabelCommand::PopulateOrExchange(), OpenProjectCommand::PopulateOrExchange(), SetClipCommand::PopulateOrExchange(), SetEnvelopeCommand::PopulateOrExchange(), SetProjectCommand::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), ImportCommand::PopulateOrExchange(), CompareAudioCommand::PopulateOrExchange(), HelpCommand::PopulateOrExchange(), MessageCommand::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), SetTrackBase::PopulateOrExchange(), GetInfoCommand::PopulateOrExchange(), GetPreferenceCommand::PopulateOrExchange(), SelectTimeCommand::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), EffectPaulstretch::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectFindClipping::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), ExportCommand::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), SaveProjectCommand::PopulateOrExchange(), EffectEcho::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), SetTrackStatusCommand::PopulateOrExchange(), SetPreferenceCommand::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), SelectFrequenciesCommand::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), SetTrackAudioCommand::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), SelectTracksCommand::PopulateOrExchange(), ScreenshotCommand::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), SetTrackVisualsCommand::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

1074 {
1075  if( mShuttleMode != eIsCreating )
1076  return;
1077  PopSizer();
1078 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndNotebook ( )

Definition at line 897 of file ShuttleGui.cpp.

References mpParent.

Referenced by AboutDialog::AboutDialog().

898 {
899  //PopSizer();
900  mpParent = mpParent->GetParent();
901 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
void ShuttleGuiBase::EndNotebookPage ( )

Definition at line 948 of file ShuttleGui.cpp.

References eIsCreating, mpParent, mShuttleMode, and PopSizer().

Referenced by AboutDialog::PopulateAudacityPage(), AboutDialog::PopulateInformationPage(), and AboutDialog::PopulateLicensePage().

949 {
950  if( mShuttleMode != eIsCreating )
951  return;
952  PopSizer();
953  mpParent = mpParent->GetParent();
954 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndPanel ( )

Definition at line 875 of file ShuttleGui.cpp.

References eIsCreating, mpParent, mShuttleMode, and PopSizer().

Referenced by EndInvisiblePanel(), EffectUIHost::OnSaveAs(), ScreenFrame::PopulateOrExchange(), and HelpSystem::ShowHtmlText().

876 {
877  if( mShuttleMode != eIsCreating )
878  return;
879  PopSizer();
880  mpParent = mpParent->GetParent();
881 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndRadioButtonGroup ( )

Call this after any TieRadioButton calls. It's generic too. We don't need type-specific ones.

Definition at line 1474 of file ShuttleGui.cpp.

References DoDataShuttle(), eIsGettingFromDialog, WrappedType::Init(), mRadioCount, mRadioValue, mSettingName, and mShuttleMode.

Referenced by ImportExportPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), and ExportMP3Options::PopulateOrExchange().

1475 {
1478  mRadioValue.Init();// Clear it out...
1479  mSettingName = wxT("");
1480  mRadioCount = -1; // So we detect a problem.
1481 }
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:338
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:336
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxString mSettingName
Definition: ShuttleGui.h:335
void ShuttleGuiBase::EndScroller ( )

Definition at line 828 of file ShuttleGui.cpp.

References eIsCreating, mpParent, mpSizer, mShuttleMode, and PopSizer().

Referenced by NyquistEffect::BuildEffectWindow(), BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), and ExtImportPrefs::PopulateOrExchange().

829 {
830  if( mShuttleMode != eIsCreating )
831  return;
832  wxSize ScrollSize = mpSizer->GetMinSize();
833  int yMin = ScrollSize.y+4;
834  int xMin = ScrollSize.x+4;
835  if( yMin > 400)
836  {
837  yMin = 400;
838  xMin+=50;// extra space for vertical scrollbar.
839  }
840 
841  mpParent->SetMinSize( wxSize(xMin, yMin) );
842 
843  PopSizer();
844  mpParent = mpParent->GetParent();
845 }
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndStatic ( )

Definition at line 780 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by ApplyMacroDialog::ApplyMacroToProject(), ExportMP3::AskResample(), ContrastDialog::ContrastDialog(), Exporter::CreateUserPane(), HistoryWindow::HistoryWindow(), ApplyMacroDialog::OnApplyToFiles(), MeterPanel::OnPreferences(), KeyConfigPrefs::Populate(), BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), MousePrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), TimeDialog::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ApplyMacroDialog::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and LadspaEffectOptionsDialog::PopulateOrExchange().

781 {
782  if( mShuttleMode != eIsCreating )
783  return;
784  PopSizer();
785 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndThreeColumn ( )
inline
void ShuttleGuiBase::EndTwoColumn ( )
inline
void ShuttleGuiBase::EndVerticalLay ( )

Definition at line 1058 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by ShuttleGui::AddStandardButtons(), ExportMP3::AskResample(), NyquistEffect::BuildPromptWindow(), Exporter::CreateUserPane(), EffectPresetsDialog::EffectPresetsDialog(), ErrorDialog::ErrorDialog(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), ImportRawDialog::ImportRawDialog(), AudacityCommandDialog::Init(), LongMessageDialog::Init(), EffectDialog::Init(), LangChoiceDialog::LangChoiceDialog(), BenchmarkDialog::MakeBenchmarkDialog(), ApplyMacroDialog::OnApplyToFiles(), AudacityProject::OnAudioDeviceInfo(), TagsEditor::OnEdit(), MeterPanel::OnPreferences(), RateMenuTable::OnRateOther(), AudacityProject::OnResample(), EffectUIHost::OnSaveAs(), LabelTrackMenuTable::OnSetFont(), SplashDialog::Populate(), KeyConfigPrefs::Populate(), AboutDialog::PopulateAudacityPage(), AboutDialog::PopulateInformationPage(), AboutDialog::PopulateLicensePage(), SoundActivatedRecord::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), TimeDialog::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), LabelDialog::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), PrefsDialog::PrefsDialog(), DeviceToolBar::ShowComboDialog(), HelpSystem::ShowInfoDialog(), SliderDialog::SliderDialog(), and WarningDialog::WarningDialog().

1059 {
1060  if( mShuttleMode != eIsCreating )
1061  return;
1062  PopSizer();
1063 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow* ShuttleGuiBase::GetParent ( )
inline

Definition at line 294 of file ShuttleGui.h.

Referenced by AboutDialog::AboutDialog(), AddBitmapButton(), AddButton(), AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddFixedText(), AddGrid(), AddIcon(), AddListBox(), AddListControl(), AddListControlReportMode(), AddNumericTextBox(), AddPrompt(), AddRadioButton(), AddRadioButtonToGroup(), AddSlider(), AddSpinCtrl(), AddTextBox(), AddTextWindow(), AddTitle(), AddTree(), AddUnits(), AddVariableText(), Exporter::CreateUserPane(), SplashDialog::Populate(), AboutDialog::PopulateAudacityPage(), AboutDialog::PopulateInformationPage(), AboutDialog::PopulateLicensePage(), EffectSilence::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), StartInvisiblePanel(), StartNotebook(), StartNotebookPage(), StartPanel(), StartScroller(), StartStatic(), and TieRadioButton().

295  {
296  // This assertion justifies the use of safenew in many places where GetParent()
297  // is used to construct a window
298  wxASSERT(mpParent != NULL);
299  return mpParent;
300  }
wxWindow * mpParent
Definition: ShuttleGui.h:359
wxSizer* ShuttleGuiBase::GetSizer ( )
inline

Definition at line 304 of file ShuttleGui.h.

Referenced by EffectEqualization::PopulateOrExchange().

304 {return mpSizer;}
wxSizer * mpSizer
Definition: ShuttleGui.h:358
void ShuttleGuiBase::HandleOptionality ( const wxString &  Prompt)

Definition at line 225 of file ShuttleGui.cpp.

References eIsCreating, mpbOptionalFlag, mShuttleMode, and TieCheckBox().

Referenced by AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddNumericTextBox(), AddSlider(), AddSpinCtrl(), AddTextBox(), TieCheckBox(), TieCheckBoxOnRight(), TieChoice(), TieNumericTextBox(), TieSlider(), TieSpinCtrl(), and TieTextBox().

226 {
227  // If creating, will be handled by an AddPrompt.
228  if( mShuttleMode == eIsCreating )
229  return;
230  //wxLogDebug( "Optionality: [%s] Id:%i (%i)", Prompt.c_str(), miId, miIdSetByUser ) ;
231  if( mpbOptionalFlag ){
232  bool * pVar = mpbOptionalFlag;
233  mpbOptionalFlag = nullptr;
234  TieCheckBox( Prompt, *pVar);
235  }
236 }
bool * mpbOptionalFlag
Definition: ShuttleGui.h:355
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxCheckBox * TieCheckBox(const wxString &Prompt, WrappedType &WrappedRef)
void ShuttleGuiBase::Init ( )

Definition at line 134 of file ShuttleGui.cpp.

References eIsCreating, miBorder, miNoMatchSelector, miProp, miPropSetByUser, miSizerProp, miStyle, mpParent, mpShuttle, mpSizer, mpSubSizer, mpWind, mRadioCount, mSettingName, mShuttleMode, mSizerDepth, PushSizer(), ResetId(), and safenew.

Referenced by ShuttleGui::ShuttleGui(), and ShuttleGuiBase().

135 {
136  mpShuttle = NULL;
137  mpSizer = NULL;
138  mpWind = NULL;
139  mpSubSizer = NULL;
140 
141  mSettingName = wxT("");
142  mRadioCount = -1;
143 
144  miBorder = 5;
145  miStyle = 0;
146  miProp=0;
147  miPropSetByUser=-1;
148  miSizerProp=0;
149  mSizerDepth=-1;
150 
151  ResetId();
152 
153  miNoMatchSelector = 0;
154 
155  if( mShuttleMode != eIsCreating )
156  return;
157 
158  mpSizer = mpParent->GetSizer();
159 
160 #if 0
161  if( mpSizer == NULL )
162  {
163  wxWindow * pGrandParent = mpParent->GetParent();
164  if( pGrandParent )
165  {
166  mpSizer = pGrandParent->GetSizer();
167  }
168  }
169 #endif
170 
171  if( !mpSizer )
172  {
173  mpParent->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
174  }
175  PushSizer();
176  mpSizer->SetMinSize(250,100);
177 }
std::unique_ptr< Shuttle > mpShuttle
Definition: ShuttleGui.h:328
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:342
#define safenew
Definition: Audacity.h:230
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:336
int miNoMatchSelector
Definition: ShuttleGui.h:330
wxString mSettingName
Definition: ShuttleGui.h:335
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
void ShuttleGuiBase::PopSizer ( )
protected

Definition at line 2102 of file ShuttleGui.cpp.

References mpSizer, mSizerDepth, and pSizerStack.

Referenced by ShuttleGui::AddStandardButtons(), EndHorizontalLay(), EndMultiColumn(), EndNotebookPage(), EndPanel(), EndScroller(), EndStatic(), and EndVerticalLay().

2103 {
2104  mSizerDepth--;
2105  wxASSERT( mSizerDepth >=0 );
2107 }
wxSizer * pSizerStack[nMaxNestedSizers]
Definition: ShuttleGui.h:326
wxSizer * mpSizer
Definition: ShuttleGui.h:358
ShuttleGuiBase & ShuttleGuiBase::Prop ( int  iProp)

Definition at line 731 of file ShuttleGui.cpp.

References miPropSetByUser.

Referenced by ShuttleGui::Prop().

732 {
733  miPropSetByUser = iProp;
734  return *this;
735 }
void ShuttleGuiBase::PushSizer ( )
protected

Definition at line 2109 of file ShuttleGui.cpp.

References mpSizer, mSizerDepth, nMaxNestedSizers, and pSizerStack.

Referenced by Init(), StartInvisiblePanel(), StartNotebookPage(), StartPanel(), StartScroller(), and UpdateSizersCore().

2110 {
2111  mSizerDepth++;
2112  wxASSERT( mSizerDepth < nMaxNestedSizers );
2114 }
wxSizer * pSizerStack[nMaxNestedSizers]
Definition: ShuttleGui.h:326
const int nMaxNestedSizers
Definition: ShuttleGui.h:33
wxSizer * mpSizer
Definition: ShuttleGui.h:358
void ShuttleGuiBase::ResetId ( )

Definition at line 179 of file ShuttleGui.cpp.

References miId, miIdNext, and miIdSetByUser.

Referenced by Init(), and PrefsDialog::ShuttleAll().

180 {
181  miIdSetByUser = -1;
182  miId = -1;
183  miIdNext = 3000;
184 }
void ShuttleGuiBase::SetBorder ( int  Border)
inline

Definition at line 286 of file ShuttleGui.h.

Referenced by ApplyMacroDialog::ApplyMacroToProject(), ExportMP3::AskResample(), ContrastDialog::ContrastDialog(), ErrorDialog::ErrorDialog(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), ImportRawDialog::ImportRawDialog(), AudacityCommandDialog::Init(), LongMessageDialog::Init(), EffectDialog::Init(), LangChoiceDialog::LangChoiceDialog(), BenchmarkDialog::MakeBenchmarkDialog(), RateMenuTable::OnRateOther(), EffectUIHost::OnSaveAs(), SplashDialog::Populate(), MousePrefs::PopulateOrExchange(), BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), SoundActivatedRecord::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), TimeDialog::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), HelpSystem::ShowInfoDialog(), and WarningDialog::WarningDialog().

286 {miBorder = Border;};
void ShuttleGuiBase::SetNoMatchSelector ( int  iSelector)
inline

Definition at line 288 of file ShuttleGui.h.

Referenced by QualityPrefs::PopulateOrExchange().

288 {miNoMatchSelector = iSelector;};
int miNoMatchSelector
Definition: ShuttleGui.h:330
void ShuttleGuiBase::SetProportions ( int  Default)
protected

Definition at line 2039 of file ShuttleGui.cpp.

References miProp, and miPropSetByUser.

Referenced by AddGrid(), AddListBox(), AddListControl(), AddListControlReportMode(), ShuttleGui::AddSpace(), AddTextWindow(), AddTree(), AddWindow(), StartInvisiblePanel(), StartNotebook(), StartNotebookPage(), StartPanel(), and StartScroller().

2040 {
2041  if( miPropSetByUser >=0 )
2042  {
2044  miPropSetByUser =-1;
2045  return;
2046  }
2047  miProp = Default;
2048 }
void ShuttleGuiBase::SetSizeHints ( int  minX,
int  minY 
)

Used to modify an already placed Window.

Definition at line 194 of file ShuttleGui.cpp.

References eIsCreating, mpLastWind, and mShuttleMode.

Referenced by NyquistEffect::BuildEffectWindow(), FreqWindow::FreqWindow(), DevicePrefs::OnDevice(), DevicePrefs::OnHost(), EffectDtmf::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), SetSizeHints(), and TieChoice().

195 {
196  if( mShuttleMode != eIsCreating )
197  return;
198  mpLastWind->SetSizeHints( minX, minY );
199 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpLastWind
Definition: ShuttleGui.h:324
void ShuttleGuiBase::SetSizeHints ( const wxArrayString &  items)
private

Definition at line 2405 of file ShuttleGui.cpp.

References eIsCreating, mpLastWind, mShuttleMode, and SetSizeHints().

2406 {
2407  if( mShuttleMode != eIsCreating )
2408  return;
2409 
2410  SetSizeHints( mpLastWind, items );
2411 }
void SetSizeHints(int minX, int minY)
Used to modify an already placed Window.
Definition: ShuttleGui.cpp:194
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpLastWind
Definition: ShuttleGui.h:324
void ShuttleGuiBase::SetSizeHints ( wxWindow *  window,
const wxArrayString &  items 
)
static

Definition at line 2374 of file ShuttleGui.cpp.

2375 {
2376  int maxw = 0;
2377 
2378  for( size_t i = 0; i < items.GetCount(); i++ )
2379  {
2380  int x;
2381  int y;
2382 
2383  window->GetTextExtent(items[i], &x, &y );
2384  if( x > maxw )
2385  {
2386  maxw = x;
2387  }
2388  }
2389 
2390  // Would be nice to know the sizes of the button and borders, but this is
2391  // the best we can do for now.
2392 #if defined(__WXMAC__)
2393  maxw += 50;
2394 #elif defined(__WXMSW__)
2395  maxw += 50;
2396 #elif defined(__WXGTK__)
2397  maxw += 50;
2398 #else
2399  maxw += 50;
2400 #endif
2401 
2402  window->SetSizeHints( maxw, -1 );
2403 }
void ShuttleGuiBase::SetSizerProportion ( int  iProp)
inline
void ShuttleGuiBase::SetStretchyCol ( int  i)

Used to modify an already placed FlexGridSizer to make a column stretchy.

Definition at line 203 of file ShuttleGui.cpp.

References eIsCreating, mpSizer, and mShuttleMode.

Referenced by NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), EffectPresetsDialog::EffectPresetsDialog(), FreqWindow::FreqWindow(), LabelTrackMenuTable::OnSetFont(), SplashDialog::Populate(), DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), SoundActivatedRecord::PopulateOrExchange(), SetTrackBase::PopulateOrExchange(), SelectTimeCommand::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), SetTrackStatusCommand::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), SelectFrequenciesCommand::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), SetTrackAudioCommand::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), SelectTracksCommand::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), SetTrackVisualsCommand::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

204 {
205  if( mShuttleMode != eIsCreating )
206  return;
207  wxFlexGridSizer *pSizer = wxDynamicCast(mpSizer, wxFlexGridSizer);
208  wxASSERT( pSizer );
209  pSizer->AddGrowableCol( i, 1 );
210 }
wxSizer * mpSizer
Definition: ShuttleGui.h:358
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::SetStretchyRow ( int  i)

Used to modify an already placed FlexGridSizer to make a row stretchy.

Definition at line 213 of file ShuttleGui.cpp.

References eIsCreating, mpSizer, and mShuttleMode.

Referenced by FreqWindow::FreqWindow(), LabelTrackMenuTable::OnSetFont(), EffectScienFilter::PopulateOrExchange(), and EffectEqualization::PopulateOrExchange().

214 {
215  if( mShuttleMode != eIsCreating )
216  return;
217  wxFlexGridSizer *pSizer = wxDynamicCast(mpSizer, wxFlexGridSizer);
218  wxASSERT( pSizer );
219  pSizer->AddGrowableRow( i, 1 );
220 }
wxSizer * mpSizer
Definition: ShuttleGui.h:358
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::SetStyle ( int  Style)
inline
void ShuttleGuiBase::StartHorizontalLay ( int  PositionFlags = wxALIGN_CENTRE,
int  iProp = 1 
)

Starts a Horizontal Layout.

  • Use wxEXPAND and 0 to expand horizontally but not vertically.
  • Use wxEXPAND and 1 to expand horizontally and vertically.
  • Use wxCENTRE and 1 for no expansion.
    Parameters
    PositionFlagTypically wxEXPAND or wxALIGN_CENTER.
    iPropProportionality for resizing.

Definition at line 1024 of file ShuttleGui.cpp.

References eIsCreating, miSizerProp, mpSubSizer, mShuttleMode, and UpdateSizersCore().

Referenced by ApplyMacroDialog::ApplyMacroToProject(), ExportMP3::AskResample(), NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), Exporter::CreateUserPane(), ExportCL::Export(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), LangChoiceDialog::LangChoiceDialog(), BenchmarkDialog::MakeBenchmarkDialog(), ApplyMacroDialog::OnApplyToFiles(), MeterPanel::OnPreferences(), RateMenuTable::OnRateOther(), AudacityProject::OnResample(), EffectUIHost::OnSaveAs(), ExportPlugin::OptionsCreate(), BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), ApplyMacroDialog::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), LabelDialog::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), PrefsDialog::PrefsDialog(), DeviceToolBar::ShowComboDialog(), HelpSystem::ShowHtmlText(), and HelpSystem::ShowInfoDialog().

1025 {
1026  if( mShuttleMode != eIsCreating )
1027  return;
1028  miSizerProp=iProp;
1029  mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
1030  UpdateSizersCore( false, PositionFlags | wxALL );
1031 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:342
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void UpdateSizersCore(bool bPrepend, int Flags)
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
wxPanel * ShuttleGuiBase::StartInvisiblePanel ( )

Definition at line 989 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miBorder, miId, mpDlg, mpParent, mpSizer, mpWind, mShuttleMode, PushSizer(), safenew, SetProportions(), UpdateSizers(), and UseUpId().

990 {
991  UseUpId();
992  if( mShuttleMode != eIsCreating )
993  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
994  wxPanel * pPanel;
995  mpWind = pPanel = safenew wxPanelWrapper(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
996  wxNO_BORDER);
997 
998  mpWind->SetBackgroundColour(
999  wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
1000  );
1001  SetProportions( 1 );
1002  miBorder=0;
1003  UpdateSizers(); // adds window in to current sizer.
1004 
1005  // create a sizer within the window...
1006  mpParent = pPanel;
1007  pPanel->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
1008  PushSizer();
1009  return pPanel;
1010 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * GetParent()
Definition: ShuttleGui.h:294
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
void ShuttleGuiBase::StartMultiColumn ( int  nCols,
int  PositionFlags = wxALIGN_LEFT 
)

Definition at line 1065 of file ShuttleGui.cpp.

References eIsCreating, mpSubSizer, mShuttleMode, and UpdateSizersCore().

Referenced by NyquistEffect::BuildEffectWindow(), NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), ImportRawDialog::ImportRawDialog(), BenchmarkDialog::MakeBenchmarkDialog(), LabelTrackMenuTable::OnSetFont(), SplashDialog::Populate(), DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), SoundActivatedRecord::PopulateOrExchange(), DemoCommand::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), GetTrackInfoCommand::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), DragCommand::PopulateOrExchange(), SetLabelCommand::PopulateOrExchange(), OpenProjectCommand::PopulateOrExchange(), SetClipCommand::PopulateOrExchange(), SetEnvelopeCommand::PopulateOrExchange(), SetProjectCommand::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), ImportCommand::PopulateOrExchange(), CompareAudioCommand::PopulateOrExchange(), HelpCommand::PopulateOrExchange(), MessageCommand::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), SetTrackBase::PopulateOrExchange(), GetInfoCommand::PopulateOrExchange(), GetPreferenceCommand::PopulateOrExchange(), SelectTimeCommand::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), EffectPaulstretch::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectFindClipping::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), ExportCommand::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), SaveProjectCommand::PopulateOrExchange(), EffectEcho::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), SetTrackStatusCommand::PopulateOrExchange(), SetPreferenceCommand::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), SelectFrequenciesCommand::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), SetTrackAudioCommand::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), SelectTracksCommand::PopulateOrExchange(), ScreenshotCommand::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), SetTrackVisualsCommand::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

1066 {
1067  if( mShuttleMode != eIsCreating )
1068  return;
1069  mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1070  UpdateSizersCore( false, PositionFlags | wxALL );
1071 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void UpdateSizersCore(bool bPrepend, int Flags)
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
wxNotebook * ShuttleGuiBase::StartNotebook ( )

Definition at line 883 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpParent, mpWind, mShuttleMode, safenew, SetProportions(), Style(), UpdateSizers(), and UseUpId().

Referenced by AboutDialog::AboutDialog().

884 {
885  UseUpId();
886  if( mShuttleMode != eIsCreating )
887  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxNotebook);
888  wxNotebook * pNotebook;
889  mpWind = pNotebook = safenew wxNotebook(GetParent(),
890  miId, wxDefaultPosition, wxDefaultSize, Style( 0 ));
891  SetProportions( 1 );
892  UpdateSizers();
893  mpParent = pNotebook;
894  return pNotebook;
895 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
wxNotebookPage * ShuttleGuiBase::StartNotebookPage ( const wxString &  Name)

Definition at line 904 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), mpParent, mpSizer, mShuttleMode, PushSizer(), safenew, and SetProportions().

Referenced by AboutDialog::PopulateAudacityPage(), AboutDialog::PopulateInformationPage(), and AboutDialog::PopulateLicensePage().

905 {
906  if( mShuttleMode != eIsCreating )
907  return NULL;
908 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
909  wxNotebook * pNotebook = (wxNotebook*)mpParent;
911  pPage->SetName(Name);
912 
913  pNotebook->AddPage(
914  pPage,
915  Name);
916  PushSizer();
917 
918  SetProportions( 1 );
919  mpParent = pPage;
920  pPage->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
921  mpSizer->SetMinSize(250, 500);
922  // UpdateSizers();
923  return pPage;
924 }
#define safenew
Definition: Audacity.h:230
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * GetParent()
Definition: ShuttleGui.h:294
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void SetProportions(int Default)
wxWindow wxNotebookPage
Definition: ShuttleGui.h:62
void ShuttleGuiBase::StartNotebookPage ( const wxString &  Name,
wxNotebookPage pPage 
)

Definition at line 926 of file ShuttleGui.cpp.

References eIsCreating, mpParent, mpSizer, mShuttleMode, PushSizer(), safenew, and SetProportions().

927 {
928  if( mShuttleMode != eIsCreating )
929  return;
930 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
931  wxNotebook * pNotebook = (wxNotebook*)mpParent;
932 // wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent());
933  pPage->Create( mpParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("panel"));
934  pPage->SetName(Name);
935 
936  pNotebook->AddPage(
937  pPage,
938  Name);
939  PushSizer();
940 
941  SetProportions( 1 );
942  mpParent = pPage;
943  pPage->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
944  mpSizer->SetMinSize(250, 500);
945  // UpdateSizers();
946 }
#define safenew
Definition: Audacity.h:230
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void SetProportions(int Default)
wxPanel * ShuttleGuiBase::StartPanel ( int  iStyle = 0)

Definition at line 847 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miBorder, miId, mpDlg, mpParent, mpSizer, mpWind, mShuttleMode, PushSizer(), safenew, SetProportions(), Style(), UpdateSizers(), and UseUpId().

Referenced by EffectUIHost::OnSaveAs(), ScreenFrame::PopulateOrExchange(), and HelpSystem::ShowHtmlText().

848 {
849  UseUpId();
850  if( mShuttleMode != eIsCreating )
851  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
852  wxPanel * pPanel;
853  mpWind = pPanel = safenew wxPanelWrapper( GetParent(), miId, wxDefaultPosition, wxDefaultSize,
854  Style( wxNO_BORDER ));
855 
856  if( iStyle != 0 )
857  {
858  mpWind->SetBackgroundColour(
859  iStyle==1
860  ? wxColour( 190,200,230) :
861  wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
862  );
863  }
864  SetProportions(0);
865  miBorder=2;
866  UpdateSizers(); // adds window in to current sizer.
867 
868  // create a sizer within the window...
869  mpParent = pPanel;
870  pPanel->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
871  PushSizer();
872  return pPanel;
873 }
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * GetParent()
Definition: ShuttleGui.h:294
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
void ShuttleGuiBase::StartRadioButtonGroup ( const wxString &  SettingName)

Call this before any TieRadioButton calls. This is the generic version and requires mRadioValue already initialised. Versions for specific types must do that initialisation.

Definition at line 1463 of file ShuttleGui.cpp.

References DoDataShuttle(), eIsCreating, eWrappedNotSet, WrappedType::eWrappedType, mRadioCount, mRadioValue, mSettingName, and mShuttleMode.

Referenced by ImportExportPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), and StartRadioButtonGroup().

1464 {
1465  wxASSERT( mRadioValue.eWrappedType != eWrappedNotSet );
1466  mSettingName = SettingName;
1467  mRadioCount = 0;
1468  if( mShuttleMode == eIsCreating )
1469  DoDataShuttle( SettingName, mRadioValue );
1470 }
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:338
teWrappedType eWrappedType
Definition: WrappedType.h:64
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:336
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxString mSettingName
Definition: ShuttleGui.h:335
void ShuttleGuiBase::StartRadioButtonGroup ( const wxString &  SettingName,
const int  iDefaultValue 
)

Integer specific version of StartRadioButtonGroup. All 'TieRadioButton()' enclosed must be ints.

Definition at line 1975 of file ShuttleGui.cpp.

References mRadioValue, mRadioValueInt, WrappedType::SetTo(), and StartRadioButtonGroup().

1976 {
1977  // Configure the generic type mechanism to use OUR integer.
1978  mRadioValueInt = iDefaultValue;
1980  // Now actually start the radio button group.
1981  StartRadioButtonGroup( SettingName );
1982 }
void SetTo(wxString &InStr)
Definition: WrappedType.h:41
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:338
int mRadioValueInt
Unwrapped string value.
Definition: ShuttleGui.h:340
void StartRadioButtonGroup(const wxString &SettingName)
void ShuttleGuiBase::StartRadioButtonGroup ( const wxString &  SettingName,
const wxString &  DefaultValue 
)

String specific version of StartRadioButtonGroup. All 'TieRadioButton()' enclosed must be strings.

Definition at line 1986 of file ShuttleGui.cpp.

References mRadioValue, mRadioValueString, WrappedType::SetTo(), and StartRadioButtonGroup().

1987 {
1988  // Configure the generic type mechanism to use OUR string.
1989  mRadioValueString = DefaultValue;
1991  // Now actually start the radio button group.
1992  StartRadioButtonGroup( SettingName );
1993 }
void SetTo(wxString &InStr)
Definition: WrappedType.h:41
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:338
wxString mRadioValueString
The wrapped value associated with the active radio button.
Definition: ShuttleGui.h:339
void StartRadioButtonGroup(const wxString &SettingName)
wxScrolledWindow * ShuttleGuiBase::StartScroller ( int  iStyle = 0)

This allows subsequent controls and static boxes to be in a scrolled panel. Very handy if you are running out of space on a dialog.

The iStyle parameter is used in some very hacky code that dynamically repopulates a dialog. It also controls the background colour. Look at the code for details.

Parameters
istyledeprecated parameter, but has been used for hacking.

Definition at line 795 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, mpDlg, mpParent, mpSizer, mpWind, mShuttleMode, PushSizer(), safenew, SetProportions(), Style(), UpdateSizers(), UpdateSizersAtStart(), and UseUpId().

Referenced by NyquistEffect::BuildEffectWindow(), BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), and ExtImportPrefs::PopulateOrExchange().

796 {
797  UseUpId();
798  if( mShuttleMode != eIsCreating )
799  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxScrolledWindow);
800 
801  wxScrolledWindow * pScroller;
802  mpWind = pScroller = safenew wxScrolledWindow(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
803  Style( wxSUNKEN_BORDER ) );
804  pScroller->SetScrollRate( 20,20 );
805 
806  // This fools NVDA into not saying "Panel" when the dialog gets focus
807  pScroller->SetName(wxT("\a"));
808  pScroller->SetLabel(wxT("\a"));
809 
810  SetProportions( 1 );
811  if( iStyle==2 )
812  {
814  }
815  else
816  {
817  // mpWind->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
818  UpdateSizers(); // adds window in to current sizer.
819  }
820 
821  // create a sizer within the window...
822  mpParent = pScroller;
823  pScroller->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
824  PushSizer();
825  return pScroller;
826 }
void UpdateSizersAtStart()
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * GetParent()
Definition: ShuttleGui.h:294
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
void SetProportions(int Default)
long Style(long Style)
wxStaticBox * ShuttleGuiBase::StartStatic ( const wxString &  Str,
int  iProp = 0 
)

Starts a static box around a number of controls.

Parameters
StrThe text of the title for the box.
iPropThe resizing proportion value. Use iProp == 0 for a minimum sized static box. Use iProp == 1 for a box that grows if there is space to spare.

Definition at line 763 of file ShuttleGui.cpp.

References eIsCreating, GetParent(), miId, miSizerProp, mpSubSizer, mShuttleMode, safenew, UpdateSizers(), and UseUpId().

Referenced by ApplyMacroDialog::ApplyMacroToProject(), ExportMP3::AskResample(), ContrastDialog::ContrastDialog(), Exporter::CreateUserPane(), HistoryWindow::HistoryWindow(), ApplyMacroDialog::OnApplyToFiles(), MeterPanel::OnPreferences(), KeyConfigPrefs::Populate(), BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), MousePrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), TimeDialog::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ApplyMacroDialog::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and LadspaEffectOptionsDialog::PopulateOrExchange().

764 {
765  UseUpId();
766  if( mShuttleMode != eIsCreating )
767  return NULL;
768  wxStaticBox * pBox = safenew wxStaticBox(GetParent(), miId,
769  Str );
770  pBox->SetLabel( Str );
771  pBox->SetName(wxStripMenuCodes(Str));
772  mpSubSizer = std::make_unique<wxStaticBoxSizer>(
773  pBox,
774  wxVERTICAL );
775  miSizerProp = iProp;
776  UpdateSizers();
777  return pBox;
778 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:342
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
void ShuttleGuiBase::StartThreeColumn ( )
inline
void ShuttleGuiBase::StartTwoColumn ( )
inline
void ShuttleGuiBase::StartVerticalLay ( int  iProp = 1)

Definition at line 1040 of file ShuttleGui.cpp.

References eIsCreating, miSizerProp, mpSubSizer, mShuttleMode, and UpdateSizers().

Referenced by ShuttleGui::AddStandardButtons(), ExportMP3::AskResample(), NyquistEffect::BuildPromptWindow(), Exporter::CreateUserPane(), EffectPresetsDialog::EffectPresetsDialog(), ErrorDialog::ErrorDialog(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), ImportRawDialog::ImportRawDialog(), AudacityCommandDialog::Init(), LongMessageDialog::Init(), EffectDialog::Init(), LangChoiceDialog::LangChoiceDialog(), BenchmarkDialog::MakeBenchmarkDialog(), ApplyMacroDialog::OnApplyToFiles(), AudacityProject::OnAudioDeviceInfo(), TagsEditor::OnEdit(), MeterPanel::OnPreferences(), RateMenuTable::OnRateOther(), AudacityProject::OnResample(), EffectUIHost::OnSaveAs(), LabelTrackMenuTable::OnSetFont(), SplashDialog::Populate(), KeyConfigPrefs::Populate(), AboutDialog::PopulateAudacityPage(), AboutDialog::PopulateInformationPage(), AboutDialog::PopulateLicensePage(), SoundActivatedRecord::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), TimeDialog::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), MacroCommandDialog::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), LabelDialog::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), MacrosWindow::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), PrefsDialog::PrefsDialog(), DeviceToolBar::ShowComboDialog(), HelpSystem::ShowInfoDialog(), SliderDialog::SliderDialog(), and WarningDialog::WarningDialog().

1041 {
1042  if( mShuttleMode != eIsCreating )
1043  return;
1044  miSizerProp=iProp;
1045  mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1046  UpdateSizers();
1047 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:342
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
void ShuttleGuiBase::StartVerticalLay ( int  PositionFlags,
int  iProp 
)

Definition at line 1049 of file ShuttleGui.cpp.

References eIsCreating, miSizerProp, mpSubSizer, mShuttleMode, and UpdateSizersCore().

1050 {
1051  if( mShuttleMode != eIsCreating )
1052  return;
1053  miSizerProp=iProp;
1054  mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1055  UpdateSizersCore( false, PositionFlags | wxALL );
1056 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:342
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void UpdateSizersCore(bool bPrepend, int Flags)
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
long ShuttleGuiBase::Style ( long  Style)
protected
wxCheckBox * ShuttleGuiBase::TieCheckBox ( const wxString &  Prompt,
WrappedType WrappedRef 
)

Definition at line 1094 of file ShuttleGui.cpp.

References AddCheckBox(), DoDataShuttle(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsGettingViaShuttle, eIsSavingViaShuttle, eIsSettingToDialog, HandleOptionality(), miId, mpDlg, mShuttleMode, WrappedType::ReadAsBool(), WrappedType::ReadAsString(), UseUpId(), and WrappedType::WriteToAsBool().

Referenced by AddPrompt(), HandleOptionality(), BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), SetLabelCommand::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), SetEnvelopeCommand::PopulateOrExchange(), SetProjectCommand::PopulateOrExchange(), OpenProjectCommand::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), SaveProjectCommand::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), SetTrackStatusCommand::PopulateOrExchange(), SetPreferenceCommand::PopulateOrExchange(), SetTrackAudioCommand::PopulateOrExchange(), ScreenshotCommand::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), SetTrackVisualsCommand::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), TieCheckBox(), ShuttleGuiGetDefinition::TieCheckBox(), and TieCheckBoxOnRight().

1095 {
1096  HandleOptionality( Prompt );
1097  // The Add function does a UseUpId(), so don't do it here in that case.
1098  if( mShuttleMode == eIsCreating )
1099  return AddCheckBox( Prompt, WrappedRef.ReadAsString());
1100 
1101  UseUpId();
1102 
1103  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1104  wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1105 
1106  switch( mShuttleMode )
1107  {
1108  // IF setting internal storage from the controls.
1109  case eIsGettingMetadata:
1110  break;
1111  case eIsGettingFromDialog:
1112  {
1113  wxASSERT( pCheckBox );
1114  WrappedRef.WriteToAsBool( pCheckBox->GetValue() );
1115  }
1116  break;
1117  case eIsSettingToDialog:
1118  {
1119  wxASSERT( pCheckBox );
1120  pCheckBox->SetValue( WrappedRef.ReadAsBool() );
1121  }
1122  break;
1123  // IF Saving settings to external storage...
1124  // or IF Getting settings from external storage.
1125  case eIsSavingViaShuttle:
1126  case eIsGettingViaShuttle:
1127  DoDataShuttle( Prompt, WrappedRef );
1128  break;
1129  default:
1130  wxASSERT( false );
1131  break;
1132  }
1133  return pCheckBox;
1134 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
void WriteToAsBool(const bool InBool)
wxString ReadAsString()
wxCheckBox * AddCheckBox(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:298
bool ReadAsBool()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxCheckBox* ShuttleGuiBase::TieCheckBox ( const wxString &  Prompt,
const wxString &  Selected 
)
wxCheckBox * ShuttleGuiBase::TieCheckBox ( const wxString &  Prompt,
bool &  Var 
)

Definition at line 1487 of file ShuttleGui.cpp.

References TieCheckBox().

1488 {
1489  WrappedType WrappedRef( Var );
1490  return TieCheckBox( Prompt, WrappedRef );
1491 }
wxCheckBox * TieCheckBox(const wxString &Prompt, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxCheckBox * ShuttleGuiBase::TieCheckBox ( const wxString &  Prompt,
const wxString &  SettingName,
const bool  bDefault 
)
virtual

Variant of the standard TieCheckBox which does the two step exchange between gui and stack variable and stack variable and shuttle.

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1721 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieCheckBox().

1725 {
1726  wxCheckBox * pCheck=NULL;
1727 
1728  bool bValue=bDefault;
1729  WrappedType WrappedRef( bValue );
1730  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1731  if( DoStep(2) ) pCheck = TieCheckBox( Prompt, WrappedRef );
1732  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1733 
1734  return pCheck;
1735 }
bool DoStep(int iStep)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxCheckBox * TieCheckBox(const wxString &Prompt, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight ( const wxString &  Prompt,
WrappedType WrappedRef 
)

Definition at line 1136 of file ShuttleGui.cpp.

References AddCheckBoxOnRight(), DoDataShuttle(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsGettingViaShuttle, eIsSavingViaShuttle, eIsSettingToDialog, HandleOptionality(), miId, mpDlg, mShuttleMode, WrappedType::ReadAsBool(), WrappedType::ReadAsString(), UseUpId(), and WrappedType::WriteToAsBool().

Referenced by TieCheckBoxOnRight(), and ShuttleGuiGetDefinition::TieCheckBoxOnRight().

1137 {
1138  HandleOptionality( Prompt );
1139  // The Add function does a UseUpId(), so don't do it here in that case.
1140  if( mShuttleMode == eIsCreating )
1141  return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString());
1142  UseUpId();
1143 
1144  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1145  wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1146 
1147  switch( mShuttleMode )
1148  {
1149  // IF setting internal storage from the controls.
1150  case eIsGettingMetadata:
1151  break;
1152  case eIsGettingFromDialog:
1153  {
1154  wxASSERT( pCheckBox );
1155  WrappedRef.WriteToAsBool( pCheckBox->GetValue() );
1156  }
1157  break;
1158  case eIsSettingToDialog:
1159  {
1160  wxASSERT( pCheckBox );
1161  pCheckBox->SetValue( WrappedRef.ReadAsBool() );
1162  }
1163  break;
1164  // IF Saving settings to external storage...
1165  // or IF Getting settings from external storage.
1166  case eIsSavingViaShuttle:
1167  case eIsGettingViaShuttle:
1168  DoDataShuttle( Prompt, WrappedRef );
1169  break;
1170  default:
1171  wxASSERT( false );
1172  break;
1173  }
1174  return pCheckBox;
1175 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxCheckBox * AddCheckBoxOnRight(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:324
wxWindow * mpDlg
Definition: ShuttleGui.h:325
void WriteToAsBool(const bool InBool)
wxString ReadAsString()
bool ReadAsBool()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight ( const wxString &  Prompt,
bool &  Var 
)

Definition at line 1494 of file ShuttleGui.cpp.

References AddCheckBoxOnRight(), eIsCreating, mShuttleMode, WrappedType::ReadAsString(), and TieCheckBox().

1495 {
1496  // Only odes anything different if it's creating.
1497  WrappedType WrappedRef( Var );
1498  if( mShuttleMode == eIsCreating )
1499  return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() );
1500  return TieCheckBox( Prompt, WrappedRef );
1501 }
wxCheckBox * AddCheckBoxOnRight(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:324
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxCheckBox * TieCheckBox(const wxString &Prompt, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight ( const wxString &  Prompt,
const wxString &  SettingName,
const bool  bDefault 
)
virtual

Variant of the standard TieCheckBox which does the two step exchange between gui and stack variable and stack variable and shuttle.

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1739 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieCheckBoxOnRight().

1743 {
1744  wxCheckBox * pCheck=NULL;
1745 
1746  bool bValue=bDefault;
1747  WrappedType WrappedRef( bValue );
1748  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1749  if( DoStep(2) ) pCheck = TieCheckBoxOnRight( Prompt, WrappedRef );
1750  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1751 
1752  return pCheck;
1753 }
wxCheckBox * TieCheckBoxOnRight(const wxString &Prompt, WrappedType &WrappedRef)
bool DoStep(int iStep)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
WrappedType WrappedRef,
const wxArrayString *  pChoices 
)

Definition at line 1353 of file ShuttleGui.cpp.

References AddChoice(), DoDataShuttle(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsGettingViaShuttle, eIsSavingViaShuttle, eIsSettingToDialog, HandleOptionality(), WrappedType::IsString(), miId, mpDlg, mShuttleMode, WrappedType::ReadAsInt(), WrappedType::ReadAsString(), SetSizeHints(), UseUpId(), WrappedType::WriteToAsInt(), and WrappedType::WriteToAsString().

Referenced by WaveformPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), DragCommand::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), GetTrackInfoCommand::PopulateOrExchange(), SetClipCommand::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), GetInfoCommand::PopulateOrExchange(), SelectTimeCommand::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), SelectTracksCommand::PopulateOrExchange(), ScreenshotCommand::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), SetTrackVisualsCommand::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), TieChoice(), ShuttleGuiGetDefinition::TieChoice(), and TieNumberAsChoice().

1357 {
1358  HandleOptionality( Prompt );
1359 
1360  // The Add function does a UseUpId(), so don't do it here in that case.
1361  if( mShuttleMode != eIsCreating )
1362  UseUpId();
1363 
1364  wxChoice * pChoice=NULL;
1365  switch( mShuttleMode )
1366  {
1367  case eIsCreating:
1368  {
1369  if( WrappedRef.IsString() )
1370  pChoice = AddChoice( Prompt, WrappedRef.ReadAsString(), pChoices );
1371  else
1372  {
1373  wxString Temp;
1374  if( pChoices && ( WrappedRef.ReadAsInt() < (int)pChoices->GetCount() ) )
1375  {
1376  Temp = (*pChoices)[WrappedRef.ReadAsInt()];
1377  }
1378  pChoice = AddChoice( Prompt, Temp, pChoices );
1379  }
1380  }
1381  break;
1382  // IF setting internal storage from the controls.
1383  case eIsGettingMetadata:
1384  break;
1385  case eIsGettingFromDialog:
1386  {
1387  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1388  pChoice = wxDynamicCast(pWnd, wxChoice);
1389  wxASSERT( pChoice );
1390  if( WrappedRef.IsString())
1391  WrappedRef.WriteToAsString( pChoice->GetStringSelection());
1392  else
1393  WrappedRef.WriteToAsInt( pChoice->GetSelection() );
1394  }
1395  break;
1396  case eIsSettingToDialog:
1397  {
1398  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1399  pChoice = wxDynamicCast(pWnd, wxChoice);
1400  wxASSERT( pChoice );
1401  if( WrappedRef.IsString() )
1402  pChoice->SetStringSelection( WrappedRef.ReadAsString() );
1403  else
1404  pChoice->SetSelection( WrappedRef.ReadAsInt() );
1405  }
1406  break;
1407  // IF Saving settings to external storage...
1408  // or IF Getting settings from external storage.
1409  case eIsSavingViaShuttle:
1410  case eIsGettingViaShuttle:
1411  DoDataShuttle( Prompt, WrappedRef );
1412  break;
1413  default:
1414  wxASSERT( false );
1415  break;
1416  }
1417  SetSizeHints(*pChoices);
1418  return pChoice;
1419 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
void SetSizeHints(int minX, int minY)
Used to modify an already placed Window.
Definition: ShuttleGui.cpp:194
void WriteToAsInt(const int InInt)
wxWindow * mpDlg
Definition: ShuttleGui.h:325
wxString ReadAsString()
void WriteToAsString(const wxString &InStr)
wxChoice * AddChoice(const wxString &Prompt, const wxString &Selected, const wxArrayString *pChoices)
Definition: ShuttleGui.cpp:371
bool IsString()
Definition: WrappedType.cpp:34
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
wxString &  Selected,
const wxArrayString *  pChoices 
)

Definition at line 1578 of file ShuttleGui.cpp.

References TieChoice().

1582 {
1583  WrappedType WrappedRef( Selected );
1584  return TieChoice( Prompt, WrappedRef, pChoices );
1585 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
int &  Selected,
const wxArrayString *  pChoices 
)

Definition at line 1587 of file ShuttleGui.cpp.

References TieChoice().

1591 {
1592  WrappedType WrappedRef( Selected );
1593  return TieChoice( Prompt, WrappedRef, pChoices );
1594 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
EnumSetting enumSetting 
)
virtual

Variant of the standard TieChoice which does the two step exchange between gui and stack variable and stack variable and shuttle.

Parameters
PromptThe prompt shown beside the control.
SettingEncapsulates setting name, internal and visible choice strings, and a designation of one of those as default.

Definition at line 1874 of file ShuttleGui.cpp.

References ident(), EnumSetting::Read(), and TieChoice().

1877 {
1878  // Do this to force any needed migrations first
1879  enumSetting.Read();
1880 
1881  wxArrayString visibleChoices, internalChoices;
1882  for (const auto &ident : enumSetting) {
1883  visibleChoices.push_back( ident.Translation() );
1884  internalChoices.push_back( ident.Internal() );
1885  }
1886  return TieChoice(
1887  Prompt, enumSetting.Key(), enumSetting.Default().Internal(),
1888  visibleChoices, internalChoices );
1889 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
static CommandHandlerObject & ident(AudacityProject &project)
Definition: Menus.cpp:298
wxString Read() const
Definition: Prefs.cpp:379
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
const wxString &  SettingName,
const wxString &  Default,
const wxArrayString &  Choices,
const wxArrayString &  InternalChoices 
)
virtual

Variant of the standard TieChoice which does the two step exchange between gui and stack variable and stack variable and shuttle.

Parameters
PromptThe prompt shown beside the control.
SettingNameThe setting name as stored in gPrefs
DefaultThe default value for this control (translated)
ChoicesAn array of choices that appear on screen.
InternalChoicesThe corresponding values (as a string array)

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1898 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), TieChoice(), TranslateFromIndex(), and TranslateToIndex().

1904 {
1905  wxChoice * pChoice=(wxChoice*)NULL;
1906 
1907  int TempIndex=0;
1908 // int TempIndex = TranslateToIndex( Default, InternalChoices );
1909  wxString TempStr = Default;
1910  WrappedType WrappedRef( TempStr );
1911  // Get from prefs does 1 and 2.
1912  // Put to prefs does 2 and 3.
1913  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); // Get Index from Prefs.
1914  if( DoStep(1) ) TempIndex = TranslateToIndex( TempStr, InternalChoices ); // To an index
1915  if( DoStep(2) ) pChoice = TieChoice( Prompt, TempIndex, &Choices ); // Get/Put index from GUI.
1916  if( DoStep(3) ) TempStr = TranslateFromIndex( TempIndex, InternalChoices ); // To a string
1917  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); // Put into Prefs.
1918  return pChoice;
1919 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
int TranslateToIndex(const wxString &Value, const wxArrayString &Choices)
String-to-Index.
wxString TranslateFromIndex(const int nIn, const wxArrayString &Choices)
Index-to-String.
bool DoStep(int iStep)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
const wxString &  SettingName,
const int  Default,
const wxArrayString &  Choices,
const std::vector< int > &  InternalChoices 
)
virtual

Variant of the standard TieChoice which does the two step exchange between gui and stack variable and stack variable and shuttle. Difference to previous one is that the Translated choices and default are integers, not Strings.

Parameters
PromptThe prompt shown beside the control.
SettingNameThe setting name as stored in gPrefs
DefaultThe default value for this control (translated)
ChoicesAn array of choices that appear on screen.
InternalChoicesThe corresponding values (as an integer array)

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1930 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), TieChoice(), TranslateFromIndex(), and TranslateToIndex().

1936 {
1937  wxChoice * pChoice=(wxChoice*)NULL;
1938 
1939  int TempIndex=0;
1940  int TranslatedInt = Default;
1941  WrappedType WrappedRef( TranslatedInt );
1942  // Get from prefs does 1 and 2.
1943  // Put to prefs does 2 and 3.
1944  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); // Get Int from Prefs.
1945  if( DoStep(1) ) TempIndex = TranslateToIndex( TranslatedInt, InternalChoices ); // Int to an index.
1946  if( DoStep(2) ) pChoice = TieChoice( Prompt, TempIndex, &Choices ); // Get/Put index from GUI.
1947  if( DoStep(3) ) TranslatedInt = TranslateFromIndex( TempIndex, InternalChoices ); // Index to int
1948  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); // Put into Prefs.
1949  return pChoice;
1950 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
int TranslateToIndex(const wxString &Value, const wxArrayString &Choices)
String-to-Index.
wxString TranslateFromIndex(const int nIn, const wxArrayString &Choices)
Index-to-String.
bool DoStep(int iStep)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxChoice * ShuttleGuiBase::TieNumberAsChoice ( const wxString &  Prompt,
const wxString &  SettingName,
const int  Default,
const wxArrayString &  Choices,
const std::vector< int > &  InternalChoices 
)
virtual

Variant of the standard TieChoice which does the two step exchange between gui and stack variable and stack variable and shuttle. The Translated choices and default are integers, not Strings. Behaves identically to the previous, but is meant for use when the choices are non-exhaustive and there is a companion control for abitrary entry.

Parameters
PromptThe prompt shown beside the control.
SettingNameThe setting name as stored in gPrefs
DefaultThe default value for this control (translated)
ChoicesAn array of choices that appear on screen.
InternalChoicesThe corresponding values (as an integer array)

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1962 of file ShuttleGui.cpp.

References TieChoice().

Referenced by QualityPrefs::PopulateOrExchange(), and ShuttleGuiGetDefinition::TieNumberAsChoice().

1968 {
1970  Prompt, SettingName, Default, Choices, InternalChoices );
1971 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Prompt,
WrappedType WrappedRef,
const int  nChars 
)

Definition at line 1263 of file ShuttleGui.cpp.

References AddNumericTextBox(), DoDataShuttle(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsGettingViaShuttle, eIsSavingViaShuttle, eIsSettingToDialog, HandleOptionality(), miId, mpDlg, mShuttleMode, WrappedType::ReadAsString(), UseUpId(), and WrappedType::WriteToAsString().

Referenced by DirectoriesPrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), SetLabelCommand::PopulateOrExchange(), DragCommand::PopulateOrExchange(), SetClipCommand::PopulateOrExchange(), SetEnvelopeCommand::PopulateOrExchange(), SetProjectCommand::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), SetTrackBase::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), SetTrackVisualsCommand::PopulateOrExchange(), TieNumericTextBox(), and ShuttleGuiGetDefinition::TieNumericTextBox().

1264 {
1265  HandleOptionality( Prompt );
1266  // The Add function does a UseUpId(), so don't do it here in that case.
1267  if( mShuttleMode == eIsCreating )
1268  return AddNumericTextBox( Prompt, WrappedRef.ReadAsString(), nChars );
1269 
1270  UseUpId();
1271  wxTextCtrl * pTextBox=NULL;
1272 
1273  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1274  pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1275 
1276  switch( mShuttleMode )
1277  {
1278  // IF setting internal storage from the controls.
1279  case eIsGettingMetadata:
1280  break;
1281  case eIsGettingFromDialog:
1282  {
1283  wxASSERT( pTextBox );
1284  WrappedRef.WriteToAsString( pTextBox->GetValue() );
1285  }
1286  break;
1287  case eIsSettingToDialog:
1288  {
1289  wxASSERT( pTextBox );
1290  pTextBox->SetValue( WrappedRef.ReadAsString() );
1291  }
1292  break;
1293  // IF Saving settings to external storage...
1294  // or IF Getting settings from external storage.
1295  case eIsGettingViaShuttle:
1296  case eIsSavingViaShuttle:
1297  DoDataShuttle( Prompt, WrappedRef );
1298  break;
1299  default:
1300  wxASSERT( false );
1301  break;
1302  }
1303  return pTextBox;
1304 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
wxTextCtrl * AddNumericTextBox(const wxString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:572
wxString ReadAsString()
void WriteToAsString(const wxString &InStr)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Caption,
wxString &  Value,
const int  nChars = 0 
)

Definition at line 1527 of file ShuttleGui.cpp.

References TieNumericTextBox().

1528 {
1529  WrappedType WrappedRef(Selected);
1530  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1531 }
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Prompt,
int &  Selected,
const int  nChars = 0 
)

Definition at line 1533 of file ShuttleGui.cpp.

References TieNumericTextBox().

1534 {
1535  WrappedType WrappedRef( Selected );
1536  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1537 }
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Prompt,
double &  Value,
const int  nChars = 0 
)

Definition at line 1539 of file ShuttleGui.cpp.

References TieNumericTextBox().

1540 {
1541  WrappedType WrappedRef( Value );
1542  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1543 }
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Prompt,
const wxString &  SettingName,
const wxString &  Default,
const int  nChars 
)
virtual

Variant of the standard TieTextBox which does the two step exchange between gui and stack variable and stack variable and shuttle.

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1815 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieNumericTextBox().

1820 {
1821  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1822 
1823  wxString Temp = Default;
1824  WrappedType WrappedRef( Temp );
1825  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1826  if( DoStep(2) ) pText = TieNumericTextBox( Prompt, WrappedRef, nChars );
1827  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1828  return pText;
1829 }
bool DoStep(int iStep)
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Prompt,
const wxString &  SettingName,
const double &  Default,
const int  nChars 
)
virtual

Variant of the standard TieTextBox which does the two step exchange between gui and stack variable and stack variable and shuttle. This one does it for double values...

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1852 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieNumericTextBox().

1857 {
1858  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1859 
1860  double Temp = Default;
1861  WrappedType WrappedRef( Temp );
1862  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1863  if( DoStep(2) ) pText = TieNumericTextBox( Prompt, WrappedRef, nChars );
1864  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1865  return pText;
1866 }
bool DoStep(int iStep)
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxRadioButton * ShuttleGuiBase::TieRadioButton ( const wxString &  Prompt,
WrappedType WrappedRef 
)

Definition at line 1421 of file ShuttleGui.cpp.

References eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, GetParent(), miId, mpDlg, mpWind, mRadioCount, mRadioValue, mShuttleMode, safenew, UpdateSizers(), UseUpId(), WrappedType::ValuesMatch(), and WrappedType::WriteToAsWrappedType().

Referenced by ImportExportPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), and TieRadioButton().

1422 {
1423  wxASSERT( mRadioCount >= 0); // Did you remember to use StartRadioButtonGroup() ?
1424  mRadioCount++;
1425  UseUpId();
1426  wxRadioButton * pRadioButton = NULL;
1427 
1428  switch( mShuttleMode )
1429  {
1430  case eIsCreating:
1431  {
1432  mpWind = pRadioButton = safenew wxRadioButton(GetParent(), miId, Prompt,
1433  wxDefaultPosition, wxDefaultSize,
1434  (mRadioCount==1)?wxRB_GROUP:0);
1435  pRadioButton->SetValue(WrappedRef.ValuesMatch( mRadioValue ));
1436  pRadioButton->SetName(wxStripMenuCodes(Prompt));
1437  UpdateSizers();
1438  }
1439  break;
1440  case eIsGettingMetadata:
1441  break;
1442  case eIsGettingFromDialog:
1443  {
1444  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1445  pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1446  wxASSERT( pRadioButton );
1447  if( pRadioButton->GetValue() )
1448  {
1449  mRadioValue.WriteToAsWrappedType( WrappedRef );
1450  }
1451  }
1452  break;
1453  default:
1454  wxASSERT( false );
1455  break;
1456  }
1457  return pRadioButton;
1458 }
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:338
void WriteToAsWrappedType(const WrappedType &W)
Definition: WrappedType.cpp:78
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
wxWindow * GetParent()
Definition: ShuttleGui.h:294
bool ValuesMatch(const WrappedType &W)
Definition: WrappedType.cpp:41
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:336
wxRadioButton * ShuttleGuiBase::TieRadioButton ( const wxString &  Prompt,
const int  iValue 
)

This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair.

Definition at line 1997 of file ShuttleGui.cpp.

References TieRadioButton().

2000 {
2001  int iTemp = iValue;
2002  WrappedType WrappedRef( iTemp );
2003  return TieRadioButton( Prompt, WrappedRef );
2004 }
wxRadioButton * TieRadioButton(const wxString &Prompt, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxRadioButton * ShuttleGuiBase::TieRadioButton ( const wxString &  Prompt,
const wxString &  Value 
)

This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair.

Definition at line 2007 of file ShuttleGui.cpp.

References TieRadioButton().

2010 {
2011  // In what follows, WrappedRef is used in read only mode, but we
2012  // don't have a 'read-only' version, so we copy to deal with the constness.
2013  wxString Temp = Value;
2014  WrappedType WrappedRef( Temp );
2015  return TieRadioButton( Prompt, WrappedRef );
2016 }
wxRadioButton * TieRadioButton(const wxString &Prompt, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxSlider * ShuttleGuiBase::TieSlider ( const wxString &  Prompt,
WrappedType WrappedRef,
const int  max,
const int  min = 0 
)

Definition at line 1306 of file ShuttleGui.cpp.

References AddSlider(), DoDataShuttle(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsGettingViaShuttle, eIsSavingViaShuttle, eIsSettingToDialog, HandleOptionality(), miId, min(), mpDlg, mShuttleMode, WrappedType::ReadAsInt(), UseUpId(), and WrappedType::WriteToAsInt().

Referenced by RecordingPrefs::PopulateOrExchange(), SoundActivatedRecord::PopulateOrExchange(), SetTrackAudioCommand::PopulateOrExchange(), TieSlider(), ShuttleGuiGetDefinition::TieSlider(), and TieVSlider().

1307 {
1308  HandleOptionality( Prompt );
1309  // The Add function does a UseUpId(), so don't do it here in that case.
1310  if( mShuttleMode != eIsCreating )
1311  UseUpId();
1312  wxSlider * pSlider=NULL;
1313  switch( mShuttleMode )
1314  {
1315  case eIsCreating:
1316  {
1317  pSlider = AddSlider( Prompt, WrappedRef.ReadAsInt(), max, min );
1318  }
1319  break;
1320  // IF setting internal storage from the controls.
1321  case eIsGettingMetadata:
1322  break;
1323  case eIsGettingFromDialog:
1324  {
1325  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1326  pSlider = wxDynamicCast(pWnd, wxSlider);
1327  wxASSERT( pSlider );
1328  WrappedRef.WriteToAsInt( pSlider->GetValue() );
1329  }
1330  break;
1331  case eIsSettingToDialog:
1332  {
1333  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1334  pSlider = wxDynamicCast(pWnd, wxSlider);
1335  wxASSERT( pSlider );
1336  pSlider->SetValue( WrappedRef.ReadAsInt() );
1337  }
1338  break;
1339  // IF Saving settings to external storage...
1340  // or IF Getting settings from external storage.
1341  case eIsSavingViaShuttle:
1342  case eIsGettingViaShuttle:
1343  DoDataShuttle( Prompt, WrappedRef );
1344  break;
1345  default:
1346  wxASSERT( false );
1347  break;
1348  }
1349  return pSlider;
1350 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
void WriteToAsInt(const int InInt)
wxWindow * mpDlg
Definition: ShuttleGui.h:325
int min(int a, int b)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxSlider * AddSlider(const wxString &Prompt, int pos, int Max, int Min=0)
Definition: ShuttleGui.cpp:497
wxSlider * ShuttleGuiBase::TieSlider ( const wxString &  Prompt,
int &  pos,
const int  max,
const int  min = 0 
)

Definition at line 1545 of file ShuttleGui.cpp.

References TieSlider().

1546 {
1547  WrappedType WrappedRef( pos );
1548  return TieSlider( Prompt, WrappedRef, max, min );
1549 }
wxSlider * TieSlider(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
int min(int a, int b)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxSlider * ShuttleGuiBase::TieSlider ( const wxString &  Prompt,
double &  pos,
const double  max,
const double  min = 0.0 
)

Definition at line 1551 of file ShuttleGui.cpp.

References TieSlider().

1552 {
1553  WrappedType WrappedRef( pos );
1554  return TieSlider( Prompt, WrappedRef, max, min );
1555 }
wxSlider * TieSlider(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
int min(int a, int b)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxSlider * ShuttleGuiBase::TieSlider ( const wxString &  Prompt,
float &  pos,
const float  fMin,
const float  fMax 
)

Definition at line 1557 of file ShuttleGui.cpp.

References TieSlider().

1558 {
1559  const float RoundFix=0.0000001f;
1560  int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1561  wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1562  pos = iVal*(fMax-fMin)*0.01+fMin;
1563  return pWnd;
1564 }
wxSlider * TieSlider(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
wxSlider * ShuttleGuiBase::TieSlider ( const wxString &  Prompt,
const wxString &  SettingName,
const int  iDefault,
const int  max,
const int  min = 0 
)
virtual

Variant of the standard TieSlider which does the two step exchange between gui and stack variable and stack variable and shuttle.

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1757 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieSlider().

1763 {
1764  wxSlider * pSlider=NULL;
1765 
1766  int iValue=iDefault;
1767  WrappedType WrappedRef( iValue );
1768  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1769  if( DoStep(2) ) pSlider = TieSlider( Prompt, WrappedRef, max, min );
1770  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1771 
1772  return pSlider;
1773 }
wxSlider * TieSlider(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
bool DoStep(int iStep)
int min(int a, int b)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl ( const wxString &  Prompt,
WrappedType WrappedRef,
const int  max,
const int  min = 0 
)

Definition at line 1177 of file ShuttleGui.cpp.

References AddSpinCtrl(), DoDataShuttle(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsGettingViaShuttle, eIsSavingViaShuttle, eIsSettingToDialog, HandleOptionality(), miId, min(), mpDlg, mShuttleMode, WrappedType::ReadAsInt(), UseUpId(), and WrappedType::WriteToAsInt().

Referenced by TieSpinCtrl(), and ShuttleGuiGetDefinition::TieSpinCtrl().

1178 {
1179  HandleOptionality( Prompt );
1180  // The Add function does a UseUpId(), so don't do it here in that case.
1181  if( mShuttleMode == eIsCreating )
1182  return AddSpinCtrl( Prompt, WrappedRef.ReadAsInt(), max, min );
1183 
1184  UseUpId();
1185  wxSpinCtrl * pSpinCtrl=NULL;
1186 
1187  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1188  pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1189 
1190  switch( mShuttleMode )
1191  {
1192  // IF setting internal storage from the controls.
1193  case eIsGettingMetadata:
1194  break;
1195  case eIsGettingFromDialog:
1196  {
1197  wxASSERT( pSpinCtrl );
1198  WrappedRef.WriteToAsInt( pSpinCtrl->GetValue() );
1199  }
1200  break;
1201  case eIsSettingToDialog:
1202  {
1203  wxASSERT( pSpinCtrl );
1204  pSpinCtrl->SetValue( WrappedRef.ReadAsInt() );
1205  }
1206  break;
1207  // IF Saving settings to external storage...
1208  // or IF Getting settings from external storage.
1209  case eIsGettingViaShuttle:
1210  case eIsSavingViaShuttle:
1211  DoDataShuttle( Prompt, WrappedRef );
1212  break;
1213  default:
1214  wxASSERT( false );
1215  break;
1216  }
1217  return pSpinCtrl;
1218 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
void WriteToAsInt(const int InInt)
wxSpinCtrl * AddSpinCtrl(const wxString &Prompt, int Value, int Max, int Min)
Definition: ShuttleGui.cpp:520
wxWindow * mpDlg
Definition: ShuttleGui.h:325
int min(int a, int b)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl ( const wxString &  Prompt,
int &  Value,
const int  max,
const int  min = 0 
)

Definition at line 1503 of file ShuttleGui.cpp.

References TieSpinCtrl().

1504 {
1505  WrappedType WrappedRef(Value);
1506  return TieSpinCtrl( Prompt, WrappedRef, max, min );
1507 }
wxSpinCtrl * TieSpinCtrl(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
int min(int a, int b)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl ( const wxString &  Prompt,
const wxString &  SettingName,
const int  Value,
const int  max,
const int  min 
)
virtual

Variant of the standard TieSpinCtrl which does the two step exchange between gui and stack variable and stack variable and shuttle.

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1777 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieSpinCtrl().

1783 {
1784  wxSpinCtrl * pSpinCtrl=NULL;
1785 
1786  int iValue = Value;
1787  WrappedType WrappedRef( iValue );
1788  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1789  if( DoStep(2) ) pSpinCtrl = TieSpinCtrl( Prompt, WrappedRef, max, min );
1790  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1791 
1792  return pSpinCtrl;
1793 }
wxSpinCtrl * TieSpinCtrl(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
bool DoStep(int iStep)
int min(int a, int b)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Prompt,
WrappedType WrappedRef,
const int  nChars 
)

Definition at line 1220 of file ShuttleGui.cpp.

References AddTextBox(), DoDataShuttle(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsGettingViaShuttle, eIsSavingViaShuttle, eIsSettingToDialog, HandleOptionality(), miId, mpDlg, mShuttleMode, WrappedType::ReadAsString(), UseUpId(), and WrappedType::WriteToAsString().

Referenced by DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), DragCommand::PopulateOrExchange(), SetLabelCommand::PopulateOrExchange(), DemoCommand::PopulateOrExchange(), OpenProjectCommand::PopulateOrExchange(), SetProjectCommand::PopulateOrExchange(), CompareAudioCommand::PopulateOrExchange(), ImportCommand::PopulateOrExchange(), HelpCommand::PopulateOrExchange(), MessageCommand::PopulateOrExchange(), GetPreferenceCommand::PopulateOrExchange(), SelectTimeCommand::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), EffectFindClipping::PopulateOrExchange(), ExportCommand::PopulateOrExchange(), SaveProjectCommand::PopulateOrExchange(), SetPreferenceCommand::PopulateOrExchange(), SetTrackStatusCommand::PopulateOrExchange(), SelectFrequenciesCommand::PopulateOrExchange(), SelectTracksCommand::PopulateOrExchange(), ScreenshotCommand::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), TieTextBox(), and ShuttleGuiGetDefinition::TieTextBox().

1221 {
1222  HandleOptionality( Prompt );
1223  // The Add function does a UseUpId(), so don't do it here in that case.
1224  if( mShuttleMode == eIsCreating )
1225  return AddTextBox( Prompt, WrappedRef.ReadAsString(), nChars );
1226 
1227  UseUpId();
1228  wxTextCtrl * pTextBox=NULL;
1229 
1230  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1231  pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1232 
1233  switch( mShuttleMode )
1234  {
1235  // IF setting internal storage from the controls.
1236  case eIsGettingMetadata:
1237  break;
1238  case eIsGettingFromDialog:
1239  {
1240  wxASSERT( pTextBox );
1241  WrappedRef.WriteToAsString( pTextBox->GetValue() );
1242  }
1243  break;
1244  case eIsSettingToDialog:
1245  {
1246  wxASSERT( pTextBox );
1247  pTextBox->SetValue( WrappedRef.ReadAsString() );
1248  }
1249  break;
1250  // IF Saving settings to external storage...
1251  // or IF Getting settings from external storage.
1252  case eIsGettingViaShuttle:
1253  case eIsSavingViaShuttle:
1254  DoDataShuttle( Prompt, WrappedRef );
1255  break;
1256  default:
1257  wxASSERT( false );
1258  break;
1259  }
1260  return pTextBox;
1261 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
wxString ReadAsString()
wxTextCtrl * AddTextBox(const wxString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:540
void WriteToAsString(const wxString &InStr)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Caption,
wxString &  Value,
const int  nChars = 0 
)

Definition at line 1509 of file ShuttleGui.cpp.

References TieTextBox().

1510 {
1511  WrappedType WrappedRef(Selected);
1512  return TieTextBox( Prompt, WrappedRef, nChars );
1513 }
wxTextCtrl * TieTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Prompt,
int &  Selected,
const int  nChars = 0 
)

Definition at line 1515 of file ShuttleGui.cpp.

References TieTextBox().

1516 {
1517  WrappedType WrappedRef( Selected );
1518  return TieTextBox( Prompt, WrappedRef, nChars );
1519 }
wxTextCtrl * TieTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Prompt,
double &  Value,
const int  nChars = 0 
)

Definition at line 1521 of file ShuttleGui.cpp.

References TieTextBox().

1522 {
1523  WrappedType WrappedRef( Value );
1524  return TieTextBox( Prompt, WrappedRef, nChars );
1525 }
wxTextCtrl * TieTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Prompt,
const wxString &  SettingName,
const wxString &  Default,
const int  nChars 
)
virtual

Variant of the standard TieTextBox which does the two step exchange between gui and stack variable and stack variable and shuttle.

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1797 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieTextBox().

1802 {
1803  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1804 
1805  wxString Temp = Default;
1806  WrappedType WrappedRef( Temp );
1807  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1808  if( DoStep(2) ) pText = TieTextBox( Prompt, WrappedRef, nChars );
1809  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1810  return pText;
1811 }
bool DoStep(int iStep)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxTextCtrl * TieTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Prompt,
const wxString &  SettingName,
const double &  Default,
const int  nChars 
)
virtual

Variant of the standard TieTextBox which does the two step exchange between gui and stack variable and stack variable and shuttle. This one does it for double values...

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1833 of file ShuttleGui.cpp.

References DoDataShuttle(), DoStep(), and TieTextBox().

1838 {
1839  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1840 
1841  double Temp = Default;
1842  WrappedType WrappedRef( Temp );
1843  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1844  if( DoStep(2) ) pText = TieTextBox( Prompt, WrappedRef, nChars );
1845  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1846  return pText;
1847 }
bool DoStep(int iStep)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxTextCtrl * TieTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxSlider * ShuttleGuiBase::TieVSlider ( const wxString &  Prompt,
float &  pos,
const float  fMin,
const float  fMax 
)

Definition at line 1566 of file ShuttleGui.cpp.

References TieSlider().

1567 {
1568  int iVal=(pos-fMin)*100.0/(fMax-fMin);
1569 // if( mShuttleMode == eIsCreating )
1570 // {
1571 // return AddVSlider( Prompt, iVal, 100 );
1572 // }
1573  wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1574  pos = iVal*(fMax-fMin)*0.01+fMin;
1575  return pWnd;
1576 }
wxSlider * TieSlider(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
wxString ShuttleGuiBase::TranslateFromIndex ( const int  nIn,
const wxArrayString &  Choices 
)

Index-to-String.

Definition at line 1614 of file ShuttleGui.cpp.

References miNoMatchSelector.

Referenced by TieChoice().

1615 {
1616  int n = nIn;
1617  if( n== wxNOT_FOUND )
1619  miNoMatchSelector = 0;
1620  if( n < (int)Choices.GetCount() )
1621  {
1622  return Choices[n];
1623  }
1624  return wxT("");
1625 }
int miNoMatchSelector
Definition: ShuttleGui.h:330
int ShuttleGuiBase::TranslateFromIndex ( const int  nIn,
const std::vector< int > &  Choices 
)

Index-to-int (choices can be items like e.g 0x400120 )

Definition at line 1638 of file ShuttleGui.cpp.

References miNoMatchSelector.

1639 {
1640  int n = nIn;
1641  if( n== wxNOT_FOUND )
1643  miNoMatchSelector = 0;
1644  if( n < (int)Choices.size() )
1645  {
1646  return Choices[n];
1647  }
1648  return 0;
1649 }
int miNoMatchSelector
Definition: ShuttleGui.h:330
int ShuttleGuiBase::TranslateToIndex ( const wxString &  Value,
const wxArrayString &  Choices 
)

String-to-Index.

Definition at line 1604 of file ShuttleGui.cpp.

References miNoMatchSelector.

Referenced by TieChoice().

1605 {
1606  int n = Choices.Index( Value );
1607  if( n== wxNOT_FOUND )
1609  miNoMatchSelector = 0;
1610  return n;
1611 }
int miNoMatchSelector
Definition: ShuttleGui.h:330
int ShuttleGuiBase::TranslateToIndex ( const int  Value,
const std::vector< int > &  Choices 
)

Int-to-Index (choices can be items like e.g 0x400120 )

Definition at line 1628 of file ShuttleGui.cpp.

References make_iterator_range(), and miNoMatchSelector.

1629 {
1630  int n = make_iterator_range(Choices).index( Value );
1631  if( n == wxNOT_FOUND )
1633  miNoMatchSelector = 0;
1634  return n;
1635 }
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:1079
int miNoMatchSelector
Definition: ShuttleGui.h:330
void ShuttleGuiBase::UpdateSizers ( )
protected
void ShuttleGuiBase::UpdateSizersAtStart ( )
protected

Definition at line 2099 of file ShuttleGui.cpp.

References UpdateSizersCore().

Referenced by StartScroller().

2100 { UpdateSizersCore( true, wxEXPAND | wxALL );}
void UpdateSizersCore(bool bPrepend, int Flags)
void ShuttleGuiBase::UpdateSizersC ( )
protected

Definition at line 2094 of file ShuttleGui.cpp.

References UpdateSizersCore().

Referenced by AddFixedText(), AddIcon(), and AddVariableText().

2095 { UpdateSizersCore( false, wxALIGN_CENTRE | wxALL );}
void UpdateSizersCore(bool bPrepend, int Flags)
void ShuttleGuiBase::UpdateSizersCore ( bool  bPrepend,
int  Flags 
)
protected

Definition at line 2051 of file ShuttleGui.cpp.

References miBorder, miProp, miSizerProp, mpLastWind, mpParent, mpSizer, mpSubSizer, mpWind, and PushSizer().

Referenced by AddBitmapButton(), AddButton(), AddPrompt(), AddUnits(), AddVariableText(), AddWindow(), StartHorizontalLay(), StartMultiColumn(), StartVerticalLay(), UpdateSizers(), UpdateSizersAtStart(), and UpdateSizersC().

2052 {
2053  if( mpWind && mpParent )
2054  {
2055  if( mpSizer){
2056  if( bPrepend )
2057  {
2058  mpSizer->Prepend(mpWind, miProp, Flags,miBorder);
2059  }
2060  else
2061  {
2062  mpSizer->Add(mpWind, miProp, Flags,miBorder);
2063  }
2064  }
2065  }
2066 
2067  if( mpSubSizer && mpSizer )
2068  {
2069  // When adding sizers into sizers, don't add a border.
2070  // unless it's a static box sizer.
2071  wxSizer *const pSubSizer = mpSubSizer.get();
2072  if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
2073  {
2074  mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags , miBorder);
2075  }
2076  else
2077  {
2078  mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags ,0);//miBorder);
2079  }
2080  mpSizer = pSubSizer;
2081  PushSizer();
2082  }
2083  mpLastWind = mpWind;
2084  mpWind = NULL;
2085  miProp = 0;
2086  miSizerProp =0;
2087 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:342
wxSizer * mpSizer
Definition: ShuttleGui.h:358
wxWindow * mpParent
Definition: ShuttleGui.h:359
wxWindow * mpWind
Definition: ShuttleGui.h:360
wxWindow * mpLastWind
Definition: ShuttleGui.h:324
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
void ShuttleGuiBase::UseUpId ( )

The Ids increment as we add NEW controls. However, the user can force the id manually, for example if they need a specific Id for a button, and then let it resume normal numbering later. UseUpId() sets miId to the next Id, either using the user specicfied one, or resuming the sequence.

Definition at line 2028 of file ShuttleGui.cpp.

References miId, miIdNext, and miIdSetByUser.

Referenced by ShuttleGui::AddAttachableScrollBar(), AddBitmapButton(), AddButton(), AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddFixedText(), AddGrid(), ShuttleGui::AddGuiWaveTrack(), AddIcon(), AddListBox(), AddListControl(), AddListControlReportMode(), AddNumericTextBox(), AddRadioButton(), AddRadioButtonToGroup(), AddSlider(), AddSpinCtrl(), AddTextBox(), AddTextWindow(), AddTree(), AddVariableText(), StartInvisiblePanel(), StartNotebook(), StartPanel(), StartScroller(), StartStatic(), TieCheckBox(), TieCheckBoxOnRight(), TieChoice(), TieNumericTextBox(), TieRadioButton(), TieSlider(), TieSpinCtrl(), and TieTextBox().

2029 {
2030  if( miIdSetByUser > 0)
2031  {
2032  miId = miIdSetByUser;
2033  miIdSetByUser = -1;
2034  return;
2035  }
2036  miId = miIdNext++;
2037 }

Member Data Documentation

int ShuttleGuiBase::miBorder
protected

Definition at line 344 of file ShuttleGui.h.

Referenced by Init(), StartInvisiblePanel(), StartPanel(), and UpdateSizersCore().

int ShuttleGuiBase::miId
protected
int ShuttleGuiBase::miIdNext
protected

Definition at line 350 of file ShuttleGui.h.

Referenced by ResetId(), and UseUpId().

int ShuttleGuiBase::miIdSetByUser
protected

Definition at line 351 of file ShuttleGui.h.

Referenced by ShuttleGui::Id(), ResetId(), and UseUpId().

int ShuttleGuiBase::miNoMatchSelector
protected

Controls source/destination of shuttled data. You can leave this NULL if you are shuttling to variables

Definition at line 330 of file ShuttleGui.h.

Referenced by Init(), TranslateFromIndex(), and TranslateToIndex().

int ShuttleGuiBase::miProp
protected
int ShuttleGuiBase::miPropSetByUser
protected

Definition at line 353 of file ShuttleGui.h.

Referenced by Init(), Prop(), and SetProportions().

int ShuttleGuiBase::miSizerProp
protected

Unwrapped integer value.

Definition at line 342 of file ShuttleGui.h.

Referenced by ShuttleGui::AddStandardButtons(), Init(), StartHorizontalLay(), StartStatic(), StartVerticalLay(), and UpdateSizersCore().

long ShuttleGuiBase::miStyle
protected

Definition at line 345 of file ShuttleGui.h.

Referenced by Init(), and Style().

bool* ShuttleGuiBase::mpbOptionalFlag
protected
wxWindow* ShuttleGuiBase::mpDlg
protected
wxWindow* ShuttleGuiBase::mpLastWind
protected

Definition at line 324 of file ShuttleGui.h.

Referenced by EnableCtrl(), SetSizeHints(), and UpdateSizersCore().

wxMenu* ShuttleGuiBase::mpMenu
protected

Definition at line 362 of file ShuttleGui.h.

Referenced by AddMenu().

wxMenuBar* ShuttleGuiBase::mpMenuBar
protected

Definition at line 361 of file ShuttleGui.h.

Referenced by AddMenu(), and AddMenuBar().

wxWindow* ShuttleGuiBase::mpParent
protected
std::unique_ptr<Shuttle> ShuttleGuiBase::mpShuttle
protected

Definition at line 328 of file ShuttleGui.h.

Referenced by DoDataShuttle(), Init(), and ShuttleGui::ShuttleGui().

wxSizer* ShuttleGuiBase::mpSizer
protected
std::unique_ptr<wxSizer> ShuttleGuiBase::mpSubSizer
protected
wxWindow* ShuttleGuiBase::mpWind
protected
int ShuttleGuiBase::mRadioCount
protected

The setting controlled by a group.

Definition at line 336 of file ShuttleGui.h.

Referenced by EndRadioButtonGroup(), Init(), StartRadioButtonGroup(), and TieRadioButton().

WrappedType ShuttleGuiBase::mRadioValue
protected

The index of this radio item. -1 for none.

Definition at line 338 of file ShuttleGui.h.

Referenced by EndRadioButtonGroup(), StartRadioButtonGroup(), and TieRadioButton().

int ShuttleGuiBase::mRadioValueInt
protected

Unwrapped string value.

Definition at line 340 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

wxString ShuttleGuiBase::mRadioValueString
protected

The wrapped value associated with the active radio button.

Definition at line 339 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

wxString ShuttleGuiBase::mSettingName
protected

Definition at line 335 of file ShuttleGui.h.

Referenced by EndRadioButtonGroup(), Init(), and StartRadioButtonGroup().

teShuttleMode ShuttleGuiBase::mShuttleMode
protected
int ShuttleGuiBase::mSizerDepth
protected

Definition at line 343 of file ShuttleGui.h.

Referenced by Init(), PopSizer(), and PushSizer().

wxSizer* ShuttleGuiBase::pSizerStack[nMaxNestedSizers]
protected

Definition at line 326 of file ShuttleGui.h.

Referenced by PopSizer(), and PushSizer().


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