Audacity  2.2.2
Public Member Functions | Protected Member Functions | Protected Attributes | 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

Public Member Functions

 ShuttleGuiBase (wxWindow *pParent, teShuttleMode ShuttleMode)
 
 ~ShuttleGuiBase (void)
 
void Init ()
 
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 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)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, const wxString &SettingName, const bool bDefault)
 
wxCheckBox * TieCheckBoxOnRight (const wxString &Prompt, const wxString &SettingName, const bool bDefault)
 
wxChoice * TieChoice (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const wxArrayString &Choices, const wxArrayString &TranslatedChoices)
 
wxChoice * TieChoice (const wxString &Prompt, const wxString &SettingName, const int Default, const wxArrayString &Choices, const std::vector< int > &TranslatedChoices)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const int nChars)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, const wxString &SettingName, const double &Default, const int nChars)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const int nChars)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, const wxString &SettingName, const double &Default, const int nChars)
 
wxSlider * TieSlider (const wxString &Prompt, const wxString &SettingName, const int iDefault, const int max, const int min=0)
 
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 ()
 

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
 
std::unique_ptr< wxSizer > mpSubSizer
 
wxSizer * mpSizer
 
wxWindow * mpParent
 
wxWindow * mpWind
 
wxMenuBar * mpMenuBar
 
wxMenu * mpMenu
 

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 73 of file ShuttleGui.h.

Constructor & Destructor Documentation

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

Definition at line 114 of file ShuttleGui.cpp.

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

115 {
116  wxASSERT( (pParent != NULL ) || ( ShuttleMode != eIsCreating));
117 
118  mpParent = pParent;
119  mShuttleMode = ShuttleMode;
120  mpDlg = pParent;
121  Init();
122 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
ShuttleGuiBase::~ShuttleGuiBase ( void  )

Definition at line 124 of file ShuttleGui.cpp.

125 {
126 }

Member Function Documentation

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

Definition at line 315 of file ShuttleGui.cpp.

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

316 {
317  UseUpId();
318  if( mShuttleMode != eIsCreating )
319  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxBitmapButton);
320  wxBitmapButton * pBtn;
321  mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, Bitmap,
322  wxDefaultPosition, wxDefaultSize, Style( wxNO_BORDER ) );
323  pBtn->SetBackgroundColour(
324  wxColour( 246,246,243));
325 // wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
326  miProp=0;
327  UpdateSizersCore(false, PositionFlags | wxALL);
328  return pBtn;
329 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void UpdateSizersCore(bool bPrepend, int Flags)
long Style(long Style)
wxButton * ShuttleGuiBase::AddButton ( const wxString &  Text,
int  PositionFlags = wxALIGN_CENTRE 
)

Definition at line 301 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(), BatchProcessDialog::OnApplyToFiles(), DirectoriesPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), BatchProcessDialog::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EditChainsDialog::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), and HelpSystem::ShowHtmlText().

302 {
303  UseUpId();
304  if( mShuttleMode != eIsCreating )
305  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxButton);
306  wxButton * pBtn;
307  mpWind = pBtn = safenew wxButton(GetParent(), miId, Text, wxDefaultPosition, wxDefaultSize,
308  Style( 0 ) );
309  mpWind->SetName(wxStripMenuCodes(Text));
310  miProp=0;
311  UpdateSizersCore(false, PositionFlags | wxALL);
312  return pBtn;
313 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void UpdateSizersCore(bool bPrepend, int Flags)
long Style(long Style)
wxCheckBox * ShuttleGuiBase::AddCheckBox ( const wxString &  Prompt,
const wxString &  Selected 
)

Definition at line 267 of file ShuttleGui.cpp.

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

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

268 {
269  UseUpId();
270  if( mShuttleMode != eIsCreating )
271  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
272  wxCheckBox * pCheckBox;
273  miProp=0;
274  mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, Prompt, wxDefaultPosition, wxDefaultSize,
275  Style( 0 ));
276  pCheckBox->SetValue(Selected == wxT("true"));
277  pCheckBox->SetName(wxStripMenuCodes(Prompt));
278  UpdateSizers();
279  return pCheckBox;
280 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 285 of file ShuttleGui.cpp.

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

Referenced by TieCheckBoxOnRight().

286 {
287  UseUpId();
288  if( mShuttleMode != eIsCreating )
289  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
290  wxCheckBox * pCheckBox;
291  miProp=0;
292  AddPrompt( Prompt );
293  mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, wxT(""), wxDefaultPosition, wxDefaultSize,
294  Style( 0 ));
295  pCheckBox->SetValue(Selected==wxT("true"));
296  pCheckBox->SetName(wxStripMenuCodes(Prompt));
297  UpdateSizers();
298  return pCheckBox;
299 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxChoice * ShuttleGuiBase::AddChoice ( const wxString &  Prompt,
const wxString &  Selected,
const wxArrayString *  pChoices 
)

Definition at line 331 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), 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().

332 {
333  UseUpId();
334  if( mShuttleMode != eIsCreating )
335  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxChoice);
336  wxChoice * pChoice;
337  miProp=0;
338 
339  AddPrompt( Prompt );
340  mpWind = pChoice = safenew wxChoice(
341  GetParent(),
342  miId,
343  wxDefaultPosition,
344  wxDefaultSize,
345  *pChoices,
346  Style( 0 ) );
347 
348  pChoice->SetSizeHints( 180,-1);// Use -1 for 'default size' - Platform specific.
349  pChoice->SetName(wxStripMenuCodes(Prompt));
350  pChoice->SetStringSelection( Selected );
351 
352  UpdateSizers();
353  return pChoice;
354 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxComboBox * ShuttleGuiBase::AddCombo ( const wxString &  Prompt,
const wxString &  Selected,
const wxArrayString *  pChoices,
long  style = 0 
)

Definition at line 399 of file ShuttleGui.cpp.

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

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

400 {
401  UseUpId();
402  if( mShuttleMode != eIsCreating )
403  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxComboBox);
404  wxComboBox * pCombo;
405  miProp=0;
406 
407  int n = pChoices->GetCount();
408  if( n>50 ) n=50;
409  int i;
410  wxString Choices[50];
411  for(i=0;i<n;i++)
412  {
413  Choices[i] = (*pChoices)[i];
414  }
415 
416  AddPrompt( Prompt );
417 
418  mpWind = pCombo = safenew wxComboBox(GetParent(), miId, Selected, wxDefaultPosition, wxDefaultSize,
419  n, Choices, Style( style ));
420  mpWind->SetName(wxStripMenuCodes(Prompt));
421 
422  UpdateSizers();
423  return pCombo;
424 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
void ShuttleGuiBase::AddConstTextBox ( const wxString &  Caption,
const wxString &  Value 
)

Single line text box of fixed size.

Definition at line 568 of file ShuttleGui.cpp.

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

Referenced by EditCurvesDialog::PopulateOrExchange().

569 {
570  UseUpId();
571  if( mShuttleMode != eIsCreating )
572  return;
573 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
574  miProp=0;
575  AddPrompt( Prompt );
576  UpdateSizers();
577  miProp=0;
578  mpWind = safenew wxStaticText(GetParent(), miId, Value, wxDefaultPosition, wxDefaultSize,
579  Style( 0 ));
580  mpWind->SetName(Value); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
581  UpdateSizers();
582 }
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
void ShuttleGuiBase::AddFixedText ( const wxString &  Str,
bool  bCenter = false 
)

Definition at line 356 of file ShuttleGui.cpp.

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

Referenced by ContrastDialog::ContrastDialog(), ErrorDialog::ErrorDialog(), BatchProcessDialog::OnApplyToProject(), MeterPanel::OnPreferences(), DirectoriesPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), and EffectDtmf::PopulateOrExchange().

357 {
358  UseUpId();
359  if( mShuttleMode != eIsCreating )
360  return;
361  mpWind = safenew wxStaticText(GetParent(), miId, Str, wxDefaultPosition, wxDefaultSize,
362  Style( wxALIGN_LEFT ));
363  mpWind->SetName(wxStripMenuCodes(Str)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
364  if( bCenter )
365  {
366  miProp=1;
367  UpdateSizersC();
368  }
369  else
370  UpdateSizers();
371 }
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
void UpdateSizersC()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxGrid * ShuttleGuiBase::AddGrid ( )

Definition at line 613 of file ShuttleGui.cpp.

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

614 {
615  UseUpId();
616  if( mShuttleMode != eIsCreating )
617  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxGrid);
618  wxGrid * pGrid;
619  SetProportions( 1 );
620  mpWind = pGrid = safenew wxGrid(GetParent(), miId, wxDefaultPosition,
621  wxDefaultSize, Style( wxWANTS_CHARS ));
622  pGrid->SetMinSize( wxSize( 120, 150 ));
623  UpdateSizers();
624  return pGrid;
625 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
long Style(long Style)
void ShuttleGuiBase::AddIcon ( wxBitmap *  pBmp)

Definition at line 656 of file ShuttleGui.cpp.

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

657 {
658  UseUpId();
659  if( mShuttleMode != eIsCreating )
660 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
661  return;
662  wxBitmapButton * pBtn;
663  mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, *pBmp,
664  wxDefaultPosition, wxDefaultSize, Style( wxBU_AUTODRAW ) );
665  pBtn->SetWindowStyle( 0 );
666  UpdateSizersC();
667 }
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
void UpdateSizersC()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 584 of file ShuttleGui.cpp.

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

Referenced by EffectPresetsDialog::EffectPresetsDialog().

585 {
586  UseUpId();
587  if( mShuttleMode != eIsCreating )
588  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListBox);
589  wxListBox * pListBox;
590  SetProportions( 1 );
591  mpWind = pListBox = safenew wxListBox(GetParent(), miId,
592  wxDefaultPosition, wxDefaultSize,*pChoices, style);
593  pListBox->SetMinSize( wxSize( 120,150 ));
594  UpdateSizers();
595  return pListBox;
596 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
wxListCtrl * ShuttleGuiBase::AddListControl ( )

Definition at line 599 of file ShuttleGui.cpp.

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

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

600 {
601  UseUpId();
602  if( mShuttleMode != eIsCreating )
603  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListCtrl);
604  wxListCtrl * pListCtrl;
605  SetProportions( 1 );
606  mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId,
607  wxDefaultPosition, wxDefaultSize, Style( wxLC_ICON ));
608  pListCtrl->SetMinSize( wxSize( 120,150 ));
609  UpdateSizers();
610  return pListCtrl;
611 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
long Style(long Style)
wxListCtrl * ShuttleGuiBase::AddListControlReportMode ( )

Definition at line 627 of file ShuttleGui.cpp.

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

Referenced by HistoryWindow::HistoryWindow(), BatchProcessDialog::OnApplyToFiles(), MousePrefs::PopulateOrExchange(), BatchProcessDialog::PopulateOrExchange(), EditChainsDialog::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), and PluginRegistrationDialog::PopulateOrExchange().

628 {
629  UseUpId();
630  if( mShuttleMode != eIsCreating )
631  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListCtrl);
632  wxListCtrl * pListCtrl;
633  SetProportions( 1 );
634  mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId,
635  wxDefaultPosition, wxSize(230,120),//wxDefaultSize,
636  Style( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER ));
637 // pListCtrl->SetMinSize( wxSize( 120,150 ));
638  UpdateSizers();
639  return pListCtrl;
640 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
long Style(long Style)
wxMenu * ShuttleGuiBase::AddMenu ( const wxString &  Title)

Definition at line 688 of file ShuttleGui.cpp.

References mpMenu, mpMenuBar, and safenew.

689 {
690  mpMenuBar->Append( (mpMenu = safenew wxMenu), Title );
691  return mpMenu;
692 }
#define safenew
Definition: Audacity.h:223
wxMenu * mpMenu
Definition: ShuttleGui.h:319
wxMenuBar * mpMenuBar
Definition: ShuttleGui.h:318
wxMenuBar * ShuttleGuiBase::AddMenuBar ( )

Definition at line 675 of file ShuttleGui.cpp.

References mpMenuBar, and mpParent.

676 {
677  auto menuBar = std::make_unique<wxMenuBar>();
678  mpMenuBar = menuBar.get();
679 
680  wxFrame * pFrame = (wxFrame*)mpParent;
681  pFrame->SetThemeEnabled( true );
682  mpMenuBar->SetThemeEnabled( true );
683  pFrame->SetMenuBar(menuBar.release());
684 
685  return mpMenuBar;
686 }
wxWindow * mpParent
Definition: ShuttleGui.h:316
wxMenuBar * mpMenuBar
Definition: ShuttleGui.h:318
wxTextCtrl * ShuttleGuiBase::AddNumericTextBox ( const wxString &  Caption,
const wxString &  Value,
const int  nChars 
)

Definition at line 520 of file ShuttleGui.cpp.

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

Referenced by TieNumericTextBox().

521 {
522  UseUpId();
523  if( mShuttleMode != eIsCreating )
524  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
525  wxTextCtrl * pTextCtrl;
526  wxSize Size(wxDefaultSize);
527  if( nChars > 0 )
528  {
529  Size.SetWidth( nChars *5 );
530  }
531  AddPrompt( Caption );
532  miProp=0;
533 
534 #ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
535  long flags = wxTE_RIGHT;
536 #else
537  long flags = wxTE_LEFT;
538 #endif
539 
540  wxTextValidator Validator(wxFILTER_NUMERIC);
541  mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
542  wxDefaultPosition, Size, Style( flags ),
543  Validator // It's OK to pass this. It will be cloned.
544  );
545  mpWind->SetName(wxStripMenuCodes(Caption));
546  UpdateSizers();
547  return pTextCtrl;
548 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 215 of file ShuttleGui.cpp.

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

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

216 {
217  if( Prompt.IsEmpty() )
218  return;
219  if( mShuttleMode != eIsCreating )
220  return;
221  miProp=1;
222  mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize,
223  Style( wxALIGN_RIGHT ));
224  mpWind->SetName(wxStripMenuCodes(Prompt)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
225  UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL );
226 }
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void UpdateSizersCore(bool bPrepend, int Flags)
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 427 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().

428 {
431  UseUpId();
432  if( mShuttleMode != eIsCreating )
433  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton);
434  wxRadioButton * pRad;
435  mpWind = pRad = safenew wxRadioButton(GetParent(), miId, Prompt,
436  wxDefaultPosition, wxDefaultSize, Style( wxRB_GROUP ) );
437  mpWind->SetName(wxStripMenuCodes(Prompt));
438  pRad->SetValue(true );
439  UpdateSizers();
440  return pRad;
441 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxRadioButton * ShuttleGuiBase::AddRadioButtonToGroup ( const wxString &  Prompt)

Definition at line 443 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().

444 {
445  UseUpId();
446  if( mShuttleMode != eIsCreating )
447  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton);
448  wxRadioButton * pRad;
449  mpWind = pRad = safenew wxRadioButton(GetParent(), miId, Prompt,
450  wxDefaultPosition, wxDefaultSize, Style( 0 ) );
451  mpWind->SetName(wxStripMenuCodes(Prompt));
452  UpdateSizers();
453  return pRad;
454 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxSlider * ShuttleGuiBase::AddSlider ( const wxString &  Prompt,
int  pos,
int  Max,
int  Min = 0 
)

Definition at line 456 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), 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().

457 {
458  UseUpId();
459  if( mShuttleMode != eIsCreating )
460  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSlider);
461  AddPrompt( Prompt );
462  wxSlider * pSlider;
463  mpWind = pSlider = safenew wxSlider(GetParent(), miId,
464  pos, Min, Max,
465  wxDefaultPosition, wxDefaultSize,
466  Style( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS )
467  );
468  mpWind->SetName(wxStripMenuCodes(Prompt));
469  miProp=1;
470  UpdateSizers();
471  return pSlider;
472 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxSpinCtrl * ShuttleGuiBase::AddSpinCtrl ( const wxString &  Prompt,
int  Value,
int  Max,
int  Min 
)

Definition at line 474 of file ShuttleGui.cpp.

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

Referenced by TieSpinCtrl().

475 {
476  UseUpId();
477  if( mShuttleMode != eIsCreating )
478  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSpinCtrl);
479  AddPrompt( Prompt );
480  wxSpinCtrl * pSpinCtrl;
481  mpWind = pSpinCtrl = safenew wxSpinCtrl(GetParent(), miId,
482  wxEmptyString,
483  wxDefaultPosition, wxDefaultSize,
484  Style( wxSP_VERTICAL | wxSP_ARROW_KEYS ),
485  Min, Max, Value
486  );
487  mpWind->SetName(wxStripMenuCodes(Prompt));
488  miProp=1;
489  UpdateSizers();
490  return pSpinCtrl;
491 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxTextCtrl * ShuttleGuiBase::AddTextBox ( const wxString &  Caption,
const wxString &  Value,
const int  nChars 
)

Definition at line 493 of file ShuttleGui.cpp.

References AddPrompt(), eIsCreating, GetParent(), 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(), BatchCommandDialog::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectEcho::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), FindDialog::PopulateOrExchange(), SliderDialog::SliderDialog(), and TieTextBox().

494 {
495  UseUpId();
496  if( mShuttleMode != eIsCreating )
497  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
498  wxTextCtrl * pTextCtrl;
499  wxSize Size(wxDefaultSize);
500  if( nChars > 0 )
501  {
502  Size.SetWidth( nChars *5 );
503  }
504  AddPrompt( Caption );
505  miProp=0;
506 
507 #ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
508  long flags = wxTE_RIGHT;
509 #else
510  long flags = wxTE_LEFT;
511 #endif
512 
513  mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
514  wxDefaultPosition, Size, Style( flags ));
515  mpWind->SetName(wxStripMenuCodes(Caption));
516  UpdateSizers();
517  return pTextCtrl;
518 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:215
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxTextCtrl * ShuttleGuiBase::AddTextWindow ( const wxString &  Value)

Multiline text box that grows.

Definition at line 551 of file ShuttleGui.cpp.

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

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

552 {
553  UseUpId();
554  if( mShuttleMode != eIsCreating )
555  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
556  wxTextCtrl * pTextCtrl;
557  SetProportions( 1 );
558  mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
559  wxDefaultPosition, wxDefaultSize, Style( wxTE_MULTILINE ));
560  UpdateSizers();
561  // Start off at start of window...
562  pTextCtrl->SetInsertionPoint( 0 );
563  pTextCtrl->ShowPosition( 0 );
564  return pTextCtrl;
565 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
long Style(long Style)
void ShuttleGuiBase::AddTitle ( const wxString &  Prompt)

Centred text string.

Definition at line 243 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().

244 {
245  if( Prompt.IsEmpty() )
246  return;
247  if( mShuttleMode != eIsCreating )
248  return;
249  mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize,
250  Style( wxALIGN_CENTRE ));
251  mpWind->SetName(Prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
252  UpdateSizers();
253 }
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
long Style(long Style)
wxTreeCtrl * ShuttleGuiBase::AddTree ( )

Definition at line 642 of file ShuttleGui.cpp.

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

643 {
644  UseUpId();
645  if( mShuttleMode != eIsCreating )
646  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTreeCtrl);
647  wxTreeCtrl * pTreeCtrl;
648  SetProportions( 1 );
649  mpWind = pTreeCtrl = safenew wxTreeCtrl(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
650  Style( wxTR_HAS_BUTTONS ));
651  pTreeCtrl->SetMinSize( wxSize( 120,650 ));
652  UpdateSizers();
653  return pTreeCtrl;
654 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
long Style(long Style)
void ShuttleGuiBase::AddUnits ( const wxString &  Prompt)

Left aligned text string.

Definition at line 229 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(), TagsEditor::PopulateOrExchange(), and WarningDialog::WarningDialog().

230 {
231  if( Prompt.IsEmpty() )
232  return;
233  if( mShuttleMode != eIsCreating )
234  return;
235  miProp=1;
236  mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize,
237  Style( wxALIGN_LEFT ));
238  mpWind->SetName(Prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
239  UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL );
240 }
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 373 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(), EffectDistortion::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

374 {
375  UseUpId();
376  if( mShuttleMode != eIsCreating )
377  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxStaticText);
378 
379  wxStaticText *pStatic;
380  mpWind = pStatic = safenew wxStaticText(GetParent(), miId, Str, wxDefaultPosition, wxDefaultSize,
381  Style( wxALIGN_LEFT ));
382  mpWind->SetName(wxStripMenuCodes(Str)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
383  if( bCenter )
384  {
385  miProp=1;
386  if( PositionFlags )
387  UpdateSizersCore( false, PositionFlags );
388  else
389  UpdateSizersC();
390  }
391  else
392  if( PositionFlags )
393  UpdateSizersCore( false, PositionFlags );
394  else
395  UpdateSizers();
396  return pStatic;
397 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
void UpdateSizersC()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 257 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(), EffectToneGen::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), PrefsDialog::PrefsDialog(), HelpSystem::ShowHtmlText(), HelpSystem::ShowInfoDialog(), and SliderDialog::SliderDialog().

258 {
259  if( mShuttleMode != eIsCreating )
260  return pWindow;
261  mpWind = pWindow;
262  SetProportions( 0 );
263  UpdateSizersCore(false, Flags);
264  return pWindow;
265 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 1015 of file ShuttleGui.cpp.

References mpShuttle.

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

1016 {
1017  wxASSERT( mpShuttle );
1018  mpShuttle->TransferWrappedType( Name, WrappedRef );
1019 }
std::unique_ptr< Shuttle > mpShuttle
Definition: ShuttleGui.h:287
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 1604 of file ShuttleGui.cpp.

References eIsCreating, eIsGettingFromDialog, eIsSettingToDialog, and mShuttleMode.

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

1605 {
1606  // Get value and create
1607  if( mShuttleMode == eIsCreating )
1608  {
1609  return (iStep==1) || (iStep==2);
1610  }
1611  // Like creating, get the value and set.
1613  {
1614  return (iStep==1) || (iStep==2);
1615  }
1617  {
1618  return (iStep==2) || (iStep==3);
1619  }
1620  wxASSERT( false );
1621  return false;
1622 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::EnableCtrl ( bool  bEnable)

Definition at line 175 of file ShuttleGui.cpp.

References eIsCreating, mpLastWind, and mShuttleMode.

176 {
177  if( mShuttleMode != eIsCreating )
178  return;
179  mpLastWind->Enable( bEnable );
180 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpLastWind
Definition: ShuttleGui.h:283
void ShuttleGuiBase::EndHorizontalLay ( )

Definition at line 975 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by ExportMP3::AskResample(), NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), Exporter::CreateUserPane(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), BenchmarkDialog::MakeBenchmarkDialog(), BatchProcessDialog::OnApplyToFiles(), BatchProcessDialog::OnApplyToProject(), MeterPanel::OnPreferences(), RateMenuTable::OnRateOther(), AudacityProject::OnResample(), EffectUIHost::OnSaveAs(), ExportPlugin::OptionsCreate(), BatchPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), BatchProcessDialog::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EditChainsDialog::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), ExtImportPrefs::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().

976 {
977  if( mShuttleMode != eIsCreating )
978  return;
979  PopSizer();
980 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::EndInvisiblePanel ( )

Definition at line 954 of file ShuttleGui.cpp.

References EndPanel().

955 {
956  EndPanel();
957 }
void ShuttleGuiBase::EndMultiColumn ( )

Definition at line 1006 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(), SoundActivatedRecord::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), EffectPaulstretch::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), EffectFindClipping::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectEcho::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

1007 {
1008  if( mShuttleMode != eIsCreating )
1009  return;
1010  PopSizer();
1011 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::EndNotebook ( )

Definition at line 839 of file ShuttleGui.cpp.

References mpParent.

Referenced by AboutDialog::AboutDialog().

840 {
841  //PopSizer();
842  mpParent = mpParent->GetParent();
843 }
wxWindow * mpParent
Definition: ShuttleGui.h:316
void ShuttleGuiBase::EndNotebookPage ( )

Definition at line 890 of file ShuttleGui.cpp.

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

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

891 {
892  if( mShuttleMode != eIsCreating )
893  return;
894  PopSizer();
895  mpParent = mpParent->GetParent();
896 }
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::EndPanel ( )

Definition at line 817 of file ShuttleGui.cpp.

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

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

818 {
819  if( mShuttleMode != eIsCreating )
820  return;
821  PopSizer();
822  mpParent = mpParent->GetParent();
823 }
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::EndRadioButtonGroup ( )

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

Definition at line 1382 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().

1383 {
1386  mRadioValue.Init();// Clear it out...
1387  mSettingName = wxT("");
1388  mRadioCount = -1; // So we detect a problem.
1389 }
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:297
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:295
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxString mSettingName
Definition: ShuttleGui.h:294
void ShuttleGuiBase::EndScroller ( )

Definition at line 770 of file ShuttleGui.cpp.

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

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

771 {
772  if( mShuttleMode != eIsCreating )
773  return;
774  wxSize ScrollSize = mpSizer->GetMinSize();
775  int yMin = ScrollSize.y+4;
776  int xMin = ScrollSize.x+4;
777  if( yMin > 400)
778  {
779  yMin = 400;
780  xMin+=50;// extra space for vertical scrollbar.
781  }
782 
783  mpParent->SetMinSize( wxSize(xMin, yMin) );
784 
785  PopSizer();
786  mpParent = mpParent->GetParent();
787 }
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::EndStatic ( )

Definition at line 718 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

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

719 {
720  if( mShuttleMode != eIsCreating )
721  return;
722  PopSizer();
723 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::EndThreeColumn ( )
inline
void ShuttleGuiBase::EndTwoColumn ( )
inline
void ShuttleGuiBase::EndVerticalLay ( )

Definition at line 991 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(), EffectDialog::Init(), LangChoiceDialog::LangChoiceDialog(), BenchmarkDialog::MakeBenchmarkDialog(), BatchProcessDialog::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(), BatchProcessDialog::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), TimerRecordDialog::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(), and SliderDialog::SliderDialog().

992 {
993  if( mShuttleMode != eIsCreating )
994  return;
995  PopSizer();
996 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow* ShuttleGuiBase::GetParent ( )
inline

Definition at line 259 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(), EffectNoise::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), StartInvisiblePanel(), StartNotebook(), StartNotebookPage(), StartPanel(), StartScroller(), StartStatic(), and TieRadioButton().

260  {
261  // This assertion justifies the use of safenew in many places where GetParent()
262  // is used to construct a window
263  wxASSERT(mpParent != NULL);
264  return mpParent;
265  }
wxWindow * mpParent
Definition: ShuttleGui.h:316
wxSizer* ShuttleGuiBase::GetSizer ( )
inline

Definition at line 269 of file ShuttleGui.h.

Referenced by EffectEqualization::PopulateOrExchange().

269 {return mpSizer;}
wxSizer * mpSizer
Definition: ShuttleGui.h:315
void ShuttleGuiBase::Init ( )

Definition at line 128 of file ShuttleGui.cpp.

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

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

129 {
130  mpShuttle = NULL;
131  mpSizer = NULL;
132  mpWind = NULL;
133  mpSubSizer = NULL;
134 
135  mSettingName = wxT("");
136  mRadioCount = -1;
137 
138  miBorder = 5;
139  miStyle = 0;
140  miProp=0;
141  miPropSetByUser=-1;
142  miSizerProp=0;
143  mSizerDepth=-1;
144 
145  miIdSetByUser = -1;
146  miId = -1;
147  miIdNext = 3000;
148 
149  miNoMatchSelector = 0;
150 
151  if( mShuttleMode != eIsCreating )
152  return;
153 
154  mpSizer = mpParent->GetSizer();
155 
156 #if 0
157  if( mpSizer == NULL )
158  {
159  wxWindow * pGrandParent = mpParent->GetParent();
160  if( pGrandParent )
161  {
162  mpSizer = pGrandParent->GetSizer();
163  }
164  }
165 #endif
166 
167  if( !mpSizer )
168  {
169  mpParent->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
170  }
171  PushSizer();
172  mpSizer->SetMinSize(250,100);
173 }
std::unique_ptr< Shuttle > mpShuttle
Definition: ShuttleGui.h:287
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:301
#define safenew
Definition: Audacity.h:223
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:295
int miNoMatchSelector
Definition: ShuttleGui.h:289
wxString mSettingName
Definition: ShuttleGui.h:294
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:314
void ShuttleGuiBase::PopSizer ( )
protected

Definition at line 1964 of file ShuttleGui.cpp.

References mpSizer, mSizerDepth, and pSizerStack.

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

1965 {
1966  mSizerDepth--;
1967  wxASSERT( mSizerDepth >=0 );
1969 }
wxSizer * pSizerStack[nMaxNestedSizers]
Definition: ShuttleGui.h:285
wxSizer * mpSizer
Definition: ShuttleGui.h:315
ShuttleGuiBase & ShuttleGuiBase::Prop ( int  iProp)

Definition at line 669 of file ShuttleGui.cpp.

References miPropSetByUser.

Referenced by ShuttleGui::Prop().

670 {
671  miPropSetByUser = iProp;
672  return *this;
673 }
void ShuttleGuiBase::PushSizer ( )
protected

Definition at line 1971 of file ShuttleGui.cpp.

References mpSizer, mSizerDepth, nMaxNestedSizers, and pSizerStack.

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

1972 {
1973  mSizerDepth++;
1974  wxASSERT( mSizerDepth < nMaxNestedSizers );
1976 }
wxSizer * pSizerStack[nMaxNestedSizers]
Definition: ShuttleGui.h:285
const int nMaxNestedSizers
Definition: ShuttleGui.h:27
wxSizer * mpSizer
Definition: ShuttleGui.h:315
void ShuttleGuiBase::SetBorder ( int  Border)
inline

Definition at line 251 of file ShuttleGui.h.

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

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

Definition at line 253 of file ShuttleGui.h.

Referenced by QualityPrefs::PopulateOrExchange().

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

Definition at line 1901 of file ShuttleGui.cpp.

References miProp, and miPropSetByUser.

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

1902 {
1903  if( miPropSetByUser >=0 )
1904  {
1906  miPropSetByUser =-1;
1907  return;
1908  }
1909  miProp = Default;
1910 }
void ShuttleGuiBase::SetSizeHints ( int  minX,
int  minY 
)

Used to modify an already placed Window.

Definition at line 183 of file ShuttleGui.cpp.

References eIsCreating, mpLastWind, and mShuttleMode.

Referenced by ShuttleGui::SetSizeHints().

184 {
185  if( mShuttleMode != eIsCreating )
186  return;
187  mpLastWind->SetSizeHints( minX, minY );
188 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpLastWind
Definition: ShuttleGui.h:283
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 192 of file ShuttleGui.cpp.

References eIsCreating, mpSizer, and mShuttleMode.

Referenced by NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), EffectPresetsDialog::EffectPresetsDialog(), FreqWindow::FreqWindow(), LabelTrackMenuTable::OnSetFont(), SplashDialog::Populate(), SoundActivatedRecord::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

193 {
194  if( mShuttleMode != eIsCreating )
195  return;
196  wxFlexGridSizer *pSizer = wxDynamicCast(mpSizer, wxFlexGridSizer);
197  wxASSERT( pSizer );
198  pSizer->AddGrowableCol( i, 1 );
199 }
wxSizer * mpSizer
Definition: ShuttleGui.h:315
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void ShuttleGuiBase::SetStretchyRow ( int  i)

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

Definition at line 202 of file ShuttleGui.cpp.

References eIsCreating, mpSizer, and mShuttleMode.

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

203 {
204  if( mShuttleMode != eIsCreating )
205  return;
206  wxFlexGridSizer *pSizer = wxDynamicCast(mpSizer, wxFlexGridSizer);
207  wxASSERT( pSizer );
208  pSizer->AddGrowableRow( i, 1 );
209 }
wxSizer * mpSizer
Definition: ShuttleGui.h:315
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
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 966 of file ShuttleGui.cpp.

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

Referenced by ExportMP3::AskResample(), NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), Exporter::CreateUserPane(), ExportCL::Export(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), LangChoiceDialog::LangChoiceDialog(), BenchmarkDialog::MakeBenchmarkDialog(), BatchProcessDialog::OnApplyToFiles(), BatchProcessDialog::OnApplyToProject(), MeterPanel::OnPreferences(), RateMenuTable::OnRateOther(), AudacityProject::OnResample(), EffectUIHost::OnSaveAs(), ExportPlugin::OptionsCreate(), BatchPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), BatchProcessDialog::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EditChainsDialog::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), ExtImportPrefs::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().

967 {
968  if( mShuttleMode != eIsCreating )
969  return;
970  miSizerProp=iProp;
971  mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
972  UpdateSizersCore( false, PositionFlags | wxALL );
973 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:301
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void UpdateSizersCore(bool bPrepend, int Flags)
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:314
wxPanel * ShuttleGuiBase::StartInvisiblePanel ( )

Definition at line 931 of file ShuttleGui.cpp.

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

932 {
933  UseUpId();
934  if( mShuttleMode != eIsCreating )
935  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
936  wxPanel * pPanel;
937  mpWind = pPanel = safenew wxPanelWrapper(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
938  wxNO_BORDER);
939 
940  mpWind->SetBackgroundColour(
941  wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
942  );
943  SetProportions( 1 );
944  miBorder=0;
945  UpdateSizers(); // adds window in to current sizer.
946 
947  // create a sizer within the window...
948  mpParent = pPanel;
949  pPanel->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
950  PushSizer();
951  return pPanel;
952 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * GetParent()
Definition: ShuttleGui.h:259
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
void ShuttleGuiBase::StartMultiColumn ( int  nCols,
int  PositionFlags = wxALIGN_LEFT 
)

Definition at line 998 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(), SoundActivatedRecord::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), EffectPaulstretch::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), EffectRepeat::PopulateOrExchange(), EffectFindClipping::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectEcho::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectTruncSilence::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and FindDialog::PopulateOrExchange().

999 {
1000  if( mShuttleMode != eIsCreating )
1001  return;
1002  mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1003  UpdateSizersCore( false, PositionFlags | wxALL );
1004 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void UpdateSizersCore(bool bPrepend, int Flags)
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:314
wxNotebook * ShuttleGuiBase::StartNotebook ( )

Definition at line 825 of file ShuttleGui.cpp.

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

Referenced by AboutDialog::AboutDialog().

826 {
827  UseUpId();
828  if( mShuttleMode != eIsCreating )
829  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxNotebook);
830  wxNotebook * pNotebook;
831  mpWind = pNotebook = safenew wxNotebook(GetParent(),
832  miId, wxDefaultPosition, wxDefaultSize, Style( 0 ));
833  SetProportions( 1 );
834  UpdateSizers();
835  mpParent = pNotebook;
836  return pNotebook;
837 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
void SetProportions(int Default)
long Style(long Style)
wxNotebookPage * ShuttleGuiBase::StartNotebookPage ( const wxString &  Name)

Definition at line 846 of file ShuttleGui.cpp.

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

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

847 {
848  if( mShuttleMode != eIsCreating )
849  return NULL;
850 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
851  wxNotebook * pNotebook = (wxNotebook*)mpParent;
853  pPage->SetName(Name);
854 
855  pNotebook->AddPage(
856  pPage,
857  Name);
858  PushSizer();
859 
860  SetProportions( 1 );
861  mpParent = pPage;
862  pPage->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
863  mpSizer->SetMinSize(250, 500);
864  // UpdateSizers();
865  return pPage;
866 }
#define safenew
Definition: Audacity.h:223
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * GetParent()
Definition: ShuttleGui.h:259
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void SetProportions(int Default)
wxWindow wxNotebookPage
Definition: ShuttleGui.h:55
void ShuttleGuiBase::StartNotebookPage ( const wxString &  Name,
wxNotebookPage pPage 
)

Definition at line 868 of file ShuttleGui.cpp.

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

869 {
870  if( mShuttleMode != eIsCreating )
871  return;
872 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
873  wxNotebook * pNotebook = (wxNotebook*)mpParent;
874 // wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent());
875  pPage->Create( mpParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("panel"));
876  pPage->SetName(Name);
877 
878  pNotebook->AddPage(
879  pPage,
880  Name);
881  PushSizer();
882 
883  SetProportions( 1 );
884  mpParent = pPage;
885  pPage->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
886  mpSizer->SetMinSize(250, 500);
887  // UpdateSizers();
888 }
#define safenew
Definition: Audacity.h:223
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void SetProportions(int Default)
wxPanel * ShuttleGuiBase::StartPanel ( int  iStyle = 0)

Definition at line 789 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().

790 {
791  UseUpId();
792  if( mShuttleMode != eIsCreating )
793  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
794  wxPanel * pPanel;
795  mpWind = pPanel = safenew wxPanelWrapper( GetParent(), miId, wxDefaultPosition, wxDefaultSize,
796  Style( wxNO_BORDER ));
797 
798  if( iStyle != 0 )
799  {
800  mpWind->SetBackgroundColour(
801  iStyle==1
802  ? wxColour( 190,200,230) :
803  wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
804  );
805  }
806  SetProportions(0);
807  miBorder=2;
808  UpdateSizers(); // adds window in to current sizer.
809 
810  // create a sizer within the window...
811  mpParent = pPanel;
812  pPanel->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
813  PushSizer();
814  return pPanel;
815 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * GetParent()
Definition: ShuttleGui.h:259
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 1371 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().

1372 {
1373  wxASSERT( mRadioValue.eWrappedType != eWrappedNotSet );
1374  mSettingName = SettingName;
1375  mRadioCount = 0;
1376  if( mShuttleMode == eIsCreating )
1377  DoDataShuttle( SettingName, mRadioValue );
1378 }
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:297
teWrappedType eWrappedType
Definition: WrappedType.h:64
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:295
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxString mSettingName
Definition: ShuttleGui.h:294
void ShuttleGuiBase::StartRadioButtonGroup ( const wxString &  SettingName,
const int  iDefaultValue 
)

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

Definition at line 1837 of file ShuttleGui.cpp.

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

1838 {
1839  // Configure the generic type mechanism to use OUR integer.
1840  mRadioValueInt = iDefaultValue;
1842  // Now actually start the radio button group.
1843  StartRadioButtonGroup( SettingName );
1844 }
void SetTo(wxString &InStr)
Definition: WrappedType.h:41
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:297
int mRadioValueInt
Unwrapped string value.
Definition: ShuttleGui.h:299
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 1848 of file ShuttleGui.cpp.

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

1849 {
1850  // Configure the generic type mechanism to use OUR string.
1851  mRadioValueString = DefaultValue;
1853  // Now actually start the radio button group.
1854  StartRadioButtonGroup( SettingName );
1855 }
void SetTo(wxString &InStr)
Definition: WrappedType.h:41
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:297
wxString mRadioValueString
The wrapped value associated with the active radio button.
Definition: ShuttleGui.h:298
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 733 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(), ThemePrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), ProjectsPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), and ExtImportPrefs::PopulateOrExchange().

734 {
735  UseUpId();
736  if( mShuttleMode != eIsCreating )
737  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxScrolledWindow);
738 
739  wxScrolledWindow * pScroller;
740  mpWind = pScroller = safenew wxScrolledWindow(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
741  Style( wxSUNKEN_BORDER ) );
742  pScroller->SetScrollRate( 20,20 );
743 
744  // This fools NVDA into not saying "Panel" when the dialog gets focus
745  pScroller->SetName(wxT("\a"));
746  pScroller->SetLabel(wxT("\a"));
747 
748  SetProportions( 1 );
749  if( iStyle==2 )
750  {
752  }
753  else
754  {
755  mpWind->SetBackgroundColour(
756  iStyle==0
757  ? wxColour( 245,244,240) :
758  wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)
759  );
760  UpdateSizers(); // adds window in to current sizer.
761  }
762 
763  // create a sizer within the window...
764  mpParent = pScroller;
765  pScroller->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
766  PushSizer();
767  return pScroller;
768 }
void UpdateSizersAtStart()
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * GetParent()
Definition: ShuttleGui.h:259
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
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 701 of file ShuttleGui.cpp.

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

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

702 {
703  UseUpId();
704  if( mShuttleMode != eIsCreating )
705  return NULL;
706  wxStaticBox * pBox = safenew wxStaticBox(GetParent(), miId,
707  Str );
708  pBox->SetLabel( Str );
709  pBox->SetName(wxStripMenuCodes(Str));
710  mpSubSizer = std::make_unique<wxStaticBoxSizer>(
711  pBox,
712  wxVERTICAL );
713  miSizerProp = iProp;
714  UpdateSizers();
715  return pBox;
716 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:301
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:314
void ShuttleGuiBase::StartThreeColumn ( )
inline
void ShuttleGuiBase::StartTwoColumn ( )
inline
void ShuttleGuiBase::StartVerticalLay ( int  iProp = 1)

Definition at line 982 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(), EffectDialog::Init(), LangChoiceDialog::LangChoiceDialog(), BenchmarkDialog::MakeBenchmarkDialog(), BatchProcessDialog::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(), BatchProcessDialog::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), EffectNormalize::PopulateOrExchange(), EffectAutoDuck::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), TimerRecordDialog::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().

983 {
984  if( mShuttleMode != eIsCreating )
985  return;
986  miSizerProp=iProp;
987  mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
988  UpdateSizers();
989 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:301
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:314
long ShuttleGuiBase::Style ( long  Style)
protected
wxCheckBox * ShuttleGuiBase::TieCheckBox ( const wxString &  Prompt,
WrappedType WrappedRef 
)

Definition at line 1027 of file ShuttleGui.cpp.

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

Referenced by BatchPrefs::PopulateOrExchange(), DirectoriesPrefs::PopulateOrExchange(), ImportExportPrefs::PopulateOrExchange(), WarningsPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), TracksBehaviorsPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), TieCheckBox(), and TieCheckBoxOnRight().

1028 {
1029  // The Add function does a UseUpId(), so don't do it here in that case.
1030  if( mShuttleMode == eIsCreating )
1031  return AddCheckBox( Prompt, WrappedRef.ReadAsString());
1032 
1033  UseUpId();
1034 
1035  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1036  wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1037 
1038  switch( mShuttleMode )
1039  {
1040  // IF setting internal storage from the controls.
1041  case eIsGettingFromDialog:
1042  {
1043  wxASSERT( pCheckBox );
1044  WrappedRef.WriteToAsBool( pCheckBox->GetValue() );
1045  }
1046  break;
1047  case eIsSettingToDialog:
1048  {
1049  wxASSERT( pCheckBox );
1050  pCheckBox->SetValue( WrappedRef.ReadAsBool() );
1051  }
1052  break;
1053  // IF Saving settings to external storage...
1054  // or IF Getting settings from external storage.
1055  case eIsSavingViaShuttle:
1056  case eIsGettingViaShuttle:
1057  DoDataShuttle( Prompt, WrappedRef );
1058  break;
1059  default:
1060  wxASSERT( false );
1061  break;
1062  }
1063  return pCheckBox;
1064 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
void WriteToAsBool(const bool InBool)
wxString ReadAsString()
wxCheckBox * AddCheckBox(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:267
bool ReadAsBool()
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
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 1395 of file ShuttleGui.cpp.

References TieCheckBox().

1396 {
1397  WrappedType WrappedRef( Var );
1398  return TieCheckBox( Prompt, WrappedRef );
1399 }
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 
)

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

Definition at line 1627 of file ShuttleGui.cpp.

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

1631 {
1632  wxCheckBox * pCheck=NULL;
1633 
1634  bool bValue=bDefault;
1635  WrappedType WrappedRef( bValue );
1636  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1637  if( DoStep(2) ) pCheck = TieCheckBox( Prompt, WrappedRef );
1638  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1639 
1640  return pCheck;
1641 }
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 1066 of file ShuttleGui.cpp.

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

Referenced by TieCheckBoxOnRight().

1067 {
1068  // The Add function does a UseUpId(), so don't do it here in that case.
1069  if( mShuttleMode == eIsCreating )
1070  return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString());
1071 
1072  UseUpId();
1073 
1074  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1075  wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1076 
1077  switch( mShuttleMode )
1078  {
1079  // IF setting internal storage from the controls.
1080  case eIsGettingFromDialog:
1081  {
1082  wxASSERT( pCheckBox );
1083  WrappedRef.WriteToAsBool( pCheckBox->GetValue() );
1084  }
1085  break;
1086  case eIsSettingToDialog:
1087  {
1088  wxASSERT( pCheckBox );
1089  pCheckBox->SetValue( WrappedRef.ReadAsBool() );
1090  }
1091  break;
1092  // IF Saving settings to external storage...
1093  // or IF Getting settings from external storage.
1094  case eIsSavingViaShuttle:
1095  case eIsGettingViaShuttle:
1096  DoDataShuttle( Prompt, WrappedRef );
1097  break;
1098  default:
1099  wxASSERT( false );
1100  break;
1101  }
1102  return pCheckBox;
1103 }
wxCheckBox * AddCheckBoxOnRight(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:285
wxWindow * mpDlg
Definition: ShuttleGui.h:284
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:291
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight ( const wxString &  Prompt,
bool &  Var 
)

Definition at line 1402 of file ShuttleGui.cpp.

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

1403 {
1404  // Only odes anything different if it's creating.
1405  WrappedType WrappedRef( Var );
1406  if( mShuttleMode == eIsCreating )
1407  return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() );
1408  return TieCheckBox( Prompt, WrappedRef );
1409 }
wxCheckBox * AddCheckBoxOnRight(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:285
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
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 
)

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

Definition at line 1645 of file ShuttleGui.cpp.

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

1649 {
1650  wxCheckBox * pCheck=NULL;
1651 
1652  bool bValue=bDefault;
1653  WrappedType WrappedRef( bValue );
1654  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1655  if( DoStep(2) ) pCheck = TieCheckBoxOnRight( Prompt, WrappedRef );
1656  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1657 
1658  return pCheck;
1659 }
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 1269 of file ShuttleGui.cpp.

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

Referenced by TracksBehaviorsPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), GUIPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and TieChoice().

1273 {
1274  // The Add function does a UseUpId(), so don't do it here in that case.
1275  if( mShuttleMode != eIsCreating )
1276  UseUpId();
1277  wxChoice * pChoice=NULL;
1278  switch( mShuttleMode )
1279  {
1280  case eIsCreating:
1281  {
1282  if( WrappedRef.IsString() )
1283  pChoice = AddChoice( Prompt, WrappedRef.ReadAsString(), pChoices );
1284  else
1285  {
1286  wxString Temp;
1287  if( pChoices && ( WrappedRef.ReadAsInt() < (int)pChoices->GetCount() ) )
1288  {
1289  Temp = (*pChoices)[WrappedRef.ReadAsInt()];
1290  }
1291  pChoice = AddChoice( Prompt, Temp, pChoices );
1292  }
1293  }
1294  break;
1295  // IF setting internal storage from the controls.
1296  case eIsGettingFromDialog:
1297  {
1298  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1299  pChoice = wxDynamicCast(pWnd, wxChoice);
1300  wxASSERT( pChoice );
1301  if( WrappedRef.IsString())
1302  WrappedRef.WriteToAsString( pChoice->GetStringSelection());
1303  else
1304  WrappedRef.WriteToAsInt( pChoice->GetSelection() );
1305  }
1306  break;
1307  case eIsSettingToDialog:
1308  {
1309  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1310  pChoice = wxDynamicCast(pWnd, wxChoice);
1311  wxASSERT( pChoice );
1312  if( WrappedRef.IsString() )
1313  pChoice->SetStringSelection( WrappedRef.ReadAsString() );
1314  else
1315  pChoice->SetSelection( WrappedRef.ReadAsInt() );
1316  }
1317  break;
1318  // IF Saving settings to external storage...
1319  // or IF Getting settings from external storage.
1320  case eIsSavingViaShuttle:
1321  case eIsGettingViaShuttle:
1322  DoDataShuttle( Prompt, WrappedRef );
1323  break;
1324  default:
1325  wxASSERT( false );
1326  break;
1327  }
1328  return pChoice;
1329 }
void WriteToAsInt(const int InInt)
wxWindow * mpDlg
Definition: ShuttleGui.h:284
wxString ReadAsString()
void WriteToAsString(const wxString &InStr)
wxChoice * AddChoice(const wxString &Prompt, const wxString &Selected, const wxArrayString *pChoices)
Definition: ShuttleGui.cpp:331
bool IsString()
Definition: WrappedType.cpp:34
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
wxString &  Selected,
const wxArrayString *  pChoices 
)

Definition at line 1486 of file ShuttleGui.cpp.

References TieChoice().

1490 {
1491  WrappedType WrappedRef( Selected );
1492  return TieChoice( Prompt, WrappedRef, pChoices );
1493 }
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 1495 of file ShuttleGui.cpp.

References TieChoice().

1499 {
1500  WrappedType WrappedRef( Selected );
1501  return TieChoice( Prompt, WrappedRef, pChoices );
1502 }
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,
const wxString &  SettingName,
const wxString &  Default,
const wxArrayString &  Choices,
const wxArrayString &  TranslatedChoices 
)

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.
TranslatedChoicesThe corresponding values (as a string array)

Definition at line 1781 of file ShuttleGui.cpp.

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

1787 {
1788  wxChoice * pChoice=(wxChoice*)NULL;
1789 
1790  int TempIndex=0;
1791 // int TempIndex = TranslateToIndex( Default, TranslatedChoices );
1792  wxString TempStr = Default;
1793  WrappedType WrappedRef( TempStr );
1794  // Get from prefs does 1 and 2.
1795  // Put to prefs does 2 and 3.
1796  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); // Get Index from Prefs.
1797  if( DoStep(1) ) TempIndex = TranslateToIndex( TempStr, TranslatedChoices ); // To an index
1798  if( DoStep(2) ) pChoice = TieChoice( Prompt, TempIndex, &Choices ); // Get/Put index from GUI.
1799  if( DoStep(3) ) TempStr = TranslateFromIndex( TempIndex, TranslatedChoices ); // To a string
1800  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); // Put into Prefs.
1801  return pChoice;
1802 }
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 > &  TranslatedChoices 
)

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.
TranslatedChoicesThe correcponding values (as an integer array)

Definition at line 1813 of file ShuttleGui.cpp.

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

1819 {
1820  wxChoice * pChoice=(wxChoice*)NULL;
1821 
1822  int TempIndex=0;
1823  int TranslatedInt = Default;
1824  WrappedType WrappedRef( TranslatedInt );
1825  // Get from prefs does 1 and 2.
1826  // Put to prefs does 2 and 3.
1827  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); // Get Int from Prefs.
1828  if( DoStep(1) ) TempIndex = TranslateToIndex( TranslatedInt, TranslatedChoices ); // Int to an index.
1829  if( DoStep(2) ) pChoice = TieChoice( Prompt, TempIndex, &Choices ); // Get/Put index from GUI.
1830  if( DoStep(3) ) TranslatedInt = TranslateFromIndex( TempIndex, TranslatedChoices ); // Index to int
1831  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); // Put into Prefs.
1832  return pChoice;
1833 }
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
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Prompt,
WrappedType WrappedRef,
const int  nChars 
)

Definition at line 1185 of file ShuttleGui.cpp.

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

Referenced by DirectoriesPrefs::PopulateOrExchange(), PlaybackPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), EffectsPrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), and TieNumericTextBox().

1186 {
1187  // The Add function does a UseUpId(), so don't do it here in that case.
1188  if( mShuttleMode == eIsCreating )
1189  return AddNumericTextBox( Prompt, WrappedRef.ReadAsString(), nChars );
1190 
1191  UseUpId();
1192  wxTextCtrl * pTextBox=NULL;
1193 
1194  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1195  pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1196 
1197  switch( mShuttleMode )
1198  {
1199  // IF setting internal storage from the controls.
1200  case eIsGettingFromDialog:
1201  {
1202  wxASSERT( pTextBox );
1203  WrappedRef.WriteToAsString( pTextBox->GetValue() );
1204  }
1205  break;
1206  case eIsSettingToDialog:
1207  {
1208  wxASSERT( pTextBox );
1209  pTextBox->SetValue( WrappedRef.ReadAsString() );
1210  }
1211  break;
1212  // IF Saving settings to external storage...
1213  // or IF Getting settings from external storage.
1214  case eIsGettingViaShuttle:
1215  case eIsSavingViaShuttle:
1216  DoDataShuttle( Prompt, WrappedRef );
1217  break;
1218  default:
1219  wxASSERT( false );
1220  break;
1221  }
1222  return pTextBox;
1223 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
wxTextCtrl * AddNumericTextBox(const wxString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:520
wxString ReadAsString()
void WriteToAsString(const wxString &InStr)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Caption,
wxString &  Value,
const int  nChars = 0 
)

Definition at line 1435 of file ShuttleGui.cpp.

References TieNumericTextBox().

1436 {
1437  WrappedType WrappedRef(Selected);
1438  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1439 }
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 1441 of file ShuttleGui.cpp.

References TieNumericTextBox().

1442 {
1443  WrappedType WrappedRef( Selected );
1444  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1445 }
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 1447 of file ShuttleGui.cpp.

References TieNumericTextBox().

1448 {
1449  WrappedType WrappedRef( Value );
1450  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1451 }
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 
)

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

Definition at line 1721 of file ShuttleGui.cpp.

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

1726 {
1727  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1728 
1729  wxString Temp = Default;
1730  WrappedType WrappedRef( Temp );
1731  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1732  if( DoStep(2) ) pText = TieNumericTextBox( Prompt, WrappedRef, nChars );
1733  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1734  return pText;
1735 }
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 
)

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...

Definition at line 1758 of file ShuttleGui.cpp.

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

1763 {
1764  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1765 
1766  double Temp = Default;
1767  WrappedType WrappedRef( Temp );
1768  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1769  if( DoStep(2) ) pText = TieNumericTextBox( Prompt, WrappedRef, nChars );
1770  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1771  return pText;
1772 }
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 1331 of file ShuttleGui.cpp.

References eIsCreating, eIsGettingFromDialog, 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().

1332 {
1333  wxASSERT( mRadioCount >= 0); // Did you remember to use StartRadioButtonGroup() ?
1334  mRadioCount++;
1335  UseUpId();
1336  wxRadioButton * pRadioButton = NULL;
1337 
1338  switch( mShuttleMode )
1339  {
1340  case eIsCreating:
1341  {
1342  mpWind = pRadioButton = safenew wxRadioButton(GetParent(), miId, Prompt,
1343  wxDefaultPosition, wxDefaultSize,
1344  (mRadioCount==1)?wxRB_GROUP:0);
1345  pRadioButton->SetValue(WrappedRef.ValuesMatch( mRadioValue ));
1346  pRadioButton->SetName(wxStripMenuCodes(Prompt));
1347  UpdateSizers();
1348  }
1349  break;
1350  case eIsGettingFromDialog:
1351  {
1352  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1353  pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1354  wxASSERT( pRadioButton );
1355  if( pRadioButton->GetValue() )
1356  {
1357  mRadioValue.WriteToAsWrappedType( WrappedRef );
1358  }
1359  }
1360  break;
1361  default:
1362  wxASSERT( false );
1363  break;
1364  }
1365  return pRadioButton;
1366 }
WrappedType mRadioValue
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:297
void WriteToAsWrappedType(const WrappedType &W)
Definition: WrappedType.cpp:78
wxWindow * mpDlg
Definition: ShuttleGui.h:284
#define safenew
Definition: Audacity.h:223
wxWindow * GetParent()
Definition: ShuttleGui.h:259
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:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
int mRadioCount
The setting controlled by a group.
Definition: ShuttleGui.h:295
wxRadioButton * ShuttleGuiBase::TieRadioButton ( const wxString &  Prompt,
const int  iValue 
)

This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair.

Definition at line 1859 of file ShuttleGui.cpp.

References TieRadioButton().

1862 {
1863  int iTemp = iValue;
1864  WrappedType WrappedRef( iTemp );
1865  return TieRadioButton( Prompt, WrappedRef );
1866 }
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 1869 of file ShuttleGui.cpp.

References TieRadioButton().

1872 {
1873  // In what follows, WrappedRef is used in read only mode, but we
1874  // don't have a 'read-only' version, so we copy to deal with the constness.
1875  wxString Temp = Value;
1876  WrappedType WrappedRef( Temp );
1877  return TieRadioButton( Prompt, WrappedRef );
1878 }
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 1225 of file ShuttleGui.cpp.

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

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

1226 {
1227  // The Add function does a UseUpId(), so don't do it here in that case.
1228  if( mShuttleMode != eIsCreating )
1229  UseUpId();
1230  wxSlider * pSlider=NULL;
1231  switch( mShuttleMode )
1232  {
1233  case eIsCreating:
1234  {
1235  pSlider = AddSlider( Prompt, WrappedRef.ReadAsInt(), max, min );
1236  }
1237  break;
1238  // IF setting internal storage from the controls.
1239  case eIsGettingFromDialog:
1240  {
1241  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1242  pSlider = wxDynamicCast(pWnd, wxSlider);
1243  wxASSERT( pSlider );
1244  WrappedRef.WriteToAsInt( pSlider->GetValue() );
1245  }
1246  break;
1247  case eIsSettingToDialog:
1248  {
1249  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1250  pSlider = wxDynamicCast(pWnd, wxSlider);
1251  wxASSERT( pSlider );
1252  pSlider->SetValue( WrappedRef.ReadAsInt() );
1253  }
1254  break;
1255  // IF Saving settings to external storage...
1256  // or IF Getting settings from external storage.
1257  case eIsSavingViaShuttle:
1258  case eIsGettingViaShuttle:
1259  DoDataShuttle( Prompt, WrappedRef );
1260  break;
1261  default:
1262  wxASSERT( false );
1263  break;
1264  }
1265  return pSlider;
1266 }
void WriteToAsInt(const int InInt)
wxWindow * mpDlg
Definition: ShuttleGui.h:284
int min(int a, int b)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxSlider * AddSlider(const wxString &Prompt, int pos, int Max, int Min=0)
Definition: ShuttleGui.cpp:456
wxSlider * ShuttleGuiBase::TieSlider ( const wxString &  Prompt,
int &  pos,
const int  max,
const int  min = 0 
)

Definition at line 1453 of file ShuttleGui.cpp.

References TieSlider().

1454 {
1455  WrappedType WrappedRef( pos );
1456  return TieSlider( Prompt, WrappedRef, max, min );
1457 }
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 1459 of file ShuttleGui.cpp.

References TieSlider().

1460 {
1461  WrappedType WrappedRef( pos );
1462  return TieSlider( Prompt, WrappedRef, max, min );
1463 }
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 1465 of file ShuttleGui.cpp.

References TieSlider().

1466 {
1467  const float RoundFix=0.0000001f;
1468  int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1469  wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1470  pos = iVal*(fMax-fMin)*0.01+fMin;
1471  return pWnd;
1472 }
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 
)

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

Definition at line 1663 of file ShuttleGui.cpp.

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

1669 {
1670  wxSlider * pSlider=NULL;
1671 
1672  int iValue=iDefault;
1673  WrappedType WrappedRef( iValue );
1674  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1675  if( DoStep(2) ) pSlider = TieSlider( Prompt, WrappedRef, max, min );
1676  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1677 
1678  return pSlider;
1679 }
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 1105 of file ShuttleGui.cpp.

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

Referenced by TieSpinCtrl().

1106 {
1107  // The Add function does a UseUpId(), so don't do it here in that case.
1108  if( mShuttleMode == eIsCreating )
1109  return AddSpinCtrl( Prompt, WrappedRef.ReadAsInt(), max, min );
1110 
1111  UseUpId();
1112  wxSpinCtrl * pSpinCtrl=NULL;
1113 
1114  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1115  pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1116 
1117  switch( mShuttleMode )
1118  {
1119  // IF setting internal storage from the controls.
1120  case eIsGettingFromDialog:
1121  {
1122  wxASSERT( pSpinCtrl );
1123  WrappedRef.WriteToAsInt( pSpinCtrl->GetValue() );
1124  }
1125  break;
1126  case eIsSettingToDialog:
1127  {
1128  wxASSERT( pSpinCtrl );
1129  pSpinCtrl->SetValue( WrappedRef.ReadAsInt() );
1130  }
1131  break;
1132  // IF Saving settings to external storage...
1133  // or IF Getting settings from external storage.
1134  case eIsGettingViaShuttle:
1135  case eIsSavingViaShuttle:
1136  DoDataShuttle( Prompt, WrappedRef );
1137  break;
1138  default:
1139  wxASSERT( false );
1140  break;
1141  }
1142  return pSpinCtrl;
1143 }
void WriteToAsInt(const int InInt)
wxSpinCtrl * AddSpinCtrl(const wxString &Prompt, int Value, int Max, int Min)
Definition: ShuttleGui.cpp:474
wxWindow * mpDlg
Definition: ShuttleGui.h:284
int min(int a, int b)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
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 1411 of file ShuttleGui.cpp.

References TieSpinCtrl().

1412 {
1413  WrappedType WrappedRef(Value);
1414  return TieSpinCtrl( Prompt, WrappedRef, max, min );
1415 }
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 
)

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

Definition at line 1683 of file ShuttleGui.cpp.

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

1689 {
1690  wxSpinCtrl * pSpinCtrl=NULL;
1691 
1692  int iValue = Value;
1693  WrappedType WrappedRef( iValue );
1694  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1695  if( DoStep(2) ) pSpinCtrl = TieSpinCtrl( Prompt, WrappedRef, max, min );
1696  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1697 
1698  return pSpinCtrl;
1699 }
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 1145 of file ShuttleGui.cpp.

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

Referenced by DirectoriesPrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), TracksPrefs::PopulateOrExchange(), EffectFindClipping::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), and TieTextBox().

1146 {
1147  // The Add function does a UseUpId(), so don't do it here in that case.
1148  if( mShuttleMode == eIsCreating )
1149  return AddTextBox( Prompt, WrappedRef.ReadAsString(), nChars );
1150 
1151  UseUpId();
1152  wxTextCtrl * pTextBox=NULL;
1153 
1154  wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1155  pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1156 
1157  switch( mShuttleMode )
1158  {
1159  // IF setting internal storage from the controls.
1160  case eIsGettingFromDialog:
1161  {
1162  wxASSERT( pTextBox );
1163  WrappedRef.WriteToAsString( pTextBox->GetValue() );
1164  }
1165  break;
1166  case eIsSettingToDialog:
1167  {
1168  wxASSERT( pTextBox );
1169  pTextBox->SetValue( WrappedRef.ReadAsString() );
1170  }
1171  break;
1172  // IF Saving settings to external storage...
1173  // or IF Getting settings from external storage.
1174  case eIsGettingViaShuttle:
1175  case eIsSavingViaShuttle:
1176  DoDataShuttle( Prompt, WrappedRef );
1177  break;
1178  default:
1179  wxASSERT( false );
1180  break;
1181  }
1182  return pTextBox;
1183 }
wxWindow * mpDlg
Definition: ShuttleGui.h:284
wxString ReadAsString()
wxTextCtrl * AddTextBox(const wxString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:493
void WriteToAsString(const wxString &InStr)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Caption,
wxString &  Value,
const int  nChars = 0 
)

Definition at line 1417 of file ShuttleGui.cpp.

References TieTextBox().

1418 {
1419  WrappedType WrappedRef(Selected);
1420  return TieTextBox( Prompt, WrappedRef, nChars );
1421 }
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 1423 of file ShuttleGui.cpp.

References TieTextBox().

1424 {
1425  WrappedType WrappedRef( Selected );
1426  return TieTextBox( Prompt, WrappedRef, nChars );
1427 }
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 1429 of file ShuttleGui.cpp.

References TieTextBox().

1430 {
1431  WrappedType WrappedRef( Value );
1432  return TieTextBox( Prompt, WrappedRef, nChars );
1433 }
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 
)

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

Definition at line 1703 of file ShuttleGui.cpp.

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

1708 {
1709  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1710 
1711  wxString Temp = Default;
1712  WrappedType WrappedRef( Temp );
1713  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1714  if( DoStep(2) ) pText = TieTextBox( Prompt, WrappedRef, nChars );
1715  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1716  return pText;
1717 }
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 
)

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...

Definition at line 1739 of file ShuttleGui.cpp.

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

1744 {
1745  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1746 
1747  double Temp = Default;
1748  WrappedType WrappedRef( Temp );
1749  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1750  if( DoStep(2) ) pText = TieTextBox( Prompt, WrappedRef, nChars );
1751  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1752  return pText;
1753 }
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 1474 of file ShuttleGui.cpp.

References TieSlider().

1475 {
1476  int iVal=(pos-fMin)*100.0/(fMax-fMin);
1477 // if( mShuttleMode == eIsCreating )
1478 // {
1479 // return AddVSlider( Prompt, iVal, 100 );
1480 // }
1481  wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1482  pos = iVal*(fMax-fMin)*0.01+fMin;
1483  return pWnd;
1484 }
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 1522 of file ShuttleGui.cpp.

References miNoMatchSelector.

Referenced by TieChoice().

1523 {
1524  int n = nIn;
1525  if( n== wxNOT_FOUND )
1527  miNoMatchSelector = 0;
1528  if( n < (int)Choices.GetCount() )
1529  {
1530  return Choices[n];
1531  }
1532  return wxT("");
1533 }
int miNoMatchSelector
Definition: ShuttleGui.h:289
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 1546 of file ShuttleGui.cpp.

References miNoMatchSelector.

1547 {
1548  int n = nIn;
1549  if( n== wxNOT_FOUND )
1551  miNoMatchSelector = 0;
1552  if( n < (int)Choices.size() )
1553  {
1554  return Choices[n];
1555  }
1556  return 0;
1557 }
int miNoMatchSelector
Definition: ShuttleGui.h:289
int ShuttleGuiBase::TranslateToIndex ( const wxString &  Value,
const wxArrayString &  Choices 
)

String-to-Index.

Definition at line 1512 of file ShuttleGui.cpp.

References miNoMatchSelector.

Referenced by TieChoice().

1513 {
1514  int n = Choices.Index( Value );
1515  if( n== wxNOT_FOUND )
1517  miNoMatchSelector = 0;
1518  return n;
1519 }
int miNoMatchSelector
Definition: ShuttleGui.h:289
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 1536 of file ShuttleGui.cpp.

References make_iterator_range(), and miNoMatchSelector.

1537 {
1538  int n = make_iterator_range(Choices).index( Value );
1539  if( n == wxNOT_FOUND )
1541  miNoMatchSelector = 0;
1542  return n;
1543 }
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:1058
int miNoMatchSelector
Definition: ShuttleGui.h:289
void ShuttleGuiBase::UpdateSizers ( )
protected
void ShuttleGuiBase::UpdateSizersAtStart ( )
protected

Definition at line 1961 of file ShuttleGui.cpp.

References UpdateSizersCore().

Referenced by StartScroller().

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

Definition at line 1956 of file ShuttleGui.cpp.

References UpdateSizersCore().

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

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

Definition at line 1913 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(), UpdateSizers(), UpdateSizersAtStart(), and UpdateSizersC().

1914 {
1915  if( mpWind && mpParent )
1916  {
1917  if( mpSizer){
1918  if( bPrepend )
1919  {
1920  mpSizer->Prepend(mpWind, miProp, Flags,miBorder);
1921  }
1922  else
1923  {
1924  mpSizer->Add(mpWind, miProp, Flags,miBorder);
1925  }
1926  }
1927  }
1928 
1929  if( mpSubSizer && mpSizer )
1930  {
1931  // When adding sizers into sizers, don't add a border.
1932  // unless it's a static box sizer.
1933  wxSizer *const pSubSizer = mpSubSizer.get();
1934  if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
1935  {
1936  mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags , miBorder);
1937  }
1938  else
1939  {
1940  mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags ,0);//miBorder);
1941  }
1942  mpSizer = pSubSizer;
1943  PushSizer();
1944  }
1945  mpLastWind = mpWind;
1946  mpWind = NULL;
1947  miProp = 0;
1948  miSizerProp =0;
1949 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:301
wxSizer * mpSizer
Definition: ShuttleGui.h:315
wxWindow * mpParent
Definition: ShuttleGui.h:316
wxWindow * mpWind
Definition: ShuttleGui.h:317
wxWindow * mpLastWind
Definition: ShuttleGui.h:283
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:314
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 1890 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().

1891 {
1892  if( miIdSetByUser > 0)
1893  {
1894  miId = miIdSetByUser;
1895  miIdSetByUser = -1;
1896  return;
1897  }
1898  miId = miIdNext++;
1899 }

Member Data Documentation

int ShuttleGuiBase::miBorder
protected

Definition at line 303 of file ShuttleGui.h.

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

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

Definition at line 309 of file ShuttleGui.h.

Referenced by Init(), and UseUpId().

int ShuttleGuiBase::miIdSetByUser
protected

Definition at line 310 of file ShuttleGui.h.

Referenced by ShuttleGui::Id(), Init(), 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 289 of file ShuttleGui.h.

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

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

Definition at line 312 of file ShuttleGui.h.

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

int ShuttleGuiBase::miSizerProp
protected

Unwrapped integer value.

Definition at line 301 of file ShuttleGui.h.

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

long ShuttleGuiBase::miStyle
protected

Definition at line 304 of file ShuttleGui.h.

Referenced by Init(), and Style().

wxWindow* ShuttleGuiBase::mpDlg
protected
wxWindow* ShuttleGuiBase::mpLastWind
protected

Definition at line 283 of file ShuttleGui.h.

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

wxMenu* ShuttleGuiBase::mpMenu
protected

Definition at line 319 of file ShuttleGui.h.

Referenced by AddMenu().

wxMenuBar* ShuttleGuiBase::mpMenuBar
protected

Definition at line 318 of file ShuttleGui.h.

Referenced by AddMenu(), and AddMenuBar().

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

Definition at line 287 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 295 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 297 of file ShuttleGui.h.

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

int ShuttleGuiBase::mRadioValueInt
protected

Unwrapped string value.

Definition at line 299 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

wxString ShuttleGuiBase::mRadioValueString
protected

The wrapped value associated with the active radio button.

Definition at line 298 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

wxString ShuttleGuiBase::mSettingName
protected

Definition at line 294 of file ShuttleGui.h.

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

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

Definition at line 302 of file ShuttleGui.h.

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

wxSizer* ShuttleGuiBase::pSizerStack[nMaxNestedSizers]
protected

Definition at line 285 of file ShuttleGui.h.

Referenced by PopSizer(), and PushSizer().


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