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

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

#include <ShuttleGui.h>

Inheritance diagram for ShuttleGuiBase:
ShuttleGui ShuttleGuiGetDefinition

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

void SetSizeHints (const wxArrayString &items)
 

Detailed Description

Base class for shuttling data to and from a GUI.

see also ShuttleGui

Use the:

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

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

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

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

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

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

Definition at line 80 of file ShuttleGui.h.

Constructor & Destructor Documentation

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

Definition at line 120 of file ShuttleGui.cpp.

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

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

Definition at line 130 of file ShuttleGui.cpp.

131 {
132 }

Member Function Documentation

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

Definition at line 363 of file ShuttleGui.cpp.

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

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

Definition at line 349 of file ShuttleGui.cpp.

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

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

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

Definition at line 298 of file ShuttleGui.cpp.

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

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

299 {
300  HandleOptionality( Prompt );
301  wxString realPrompt = Prompt;
302  if( mpbOptionalFlag )
303  {
304  AddPrompt( "");
305  //realPrompt = wxT("");
306  }
307 
308  UseUpId();
309  if( mShuttleMode != eIsCreating )
310  return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
311  wxCheckBox * pCheckBox;
312  miProp=0;
313  mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, realPrompt, wxDefaultPosition, wxDefaultSize,
314  Style( 0 ));
315  pCheckBox->SetValue(Selected == wxT("true"));
316  if (realPrompt.IsEmpty()) {
317  // NVDA 2018.3 does not read controls which are buttons, check boxes or radio buttons which have
318  // an accessibility name which is empty. Bug 1980.
319 #if wxUSE_ACCESSIBILITY
320  // so that name can be set on a standard control
321  pCheckBox->SetAccessible(safenew WindowAccessible(pCheckBox));
322 #endif
323  pCheckBox->SetName(wxT("\a")); // non-empty string which screen readers do not read
324  }
325  UpdateSizers();
326  return pCheckBox;
327 }
void HandleOptionality(const wxString &Prompt)
Definition: ShuttleGui.cpp:225
wxWindow * mpDlg
Definition: ShuttleGui.h:325
#define safenew
Definition: Audacity.h:230
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
wxWindow * GetParent()
Definition: ShuttleGui.h:294
bool * mpbOptionalFlag
Definition: ShuttleGui.h:355
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow * mpWind
Definition: ShuttleGui.h:360
long Style(long Style)
wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight ( const wxString &  Prompt,
const wxString &  Selected 
)

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

Definition at line 332 of file ShuttleGui.cpp.

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

Referenced by TieCheckBoxOnRight().

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

Definition at line 379 of file ShuttleGui.cpp.

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

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

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

Definition at line 448 of file ShuttleGui.cpp.

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

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

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

Single line text box of fixed size.

Definition at line 637 of file ShuttleGui.cpp.

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

Referenced by EditCurvesDialog::PopulateOrExchange().

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

Definition at line 405 of file ShuttleGui.cpp.

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

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

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

Definition at line 683 of file ShuttleGui.cpp.

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

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

Definition at line 726 of file ShuttleGui.cpp.

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

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

Definition at line 654 of file ShuttleGui.cpp.

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

Referenced by EffectPresetsDialog::EffectPresetsDialog().

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

Definition at line 669 of file ShuttleGui.cpp.

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

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

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

Definition at line 697 of file ShuttleGui.cpp.

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

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

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

Definition at line 758 of file ShuttleGui.cpp.

References mpMenu, mpMenuBar, and safenew.

759 {
760  mpMenuBar->Append( (mpMenu = safenew wxMenu), Title );
761  return mpMenu;
762 }
#define safenew
Definition: Audacity.h:230
wxMenu * mpMenu
Definition: ShuttleGui.h:362
wxMenuBar * mpMenuBar
Definition: ShuttleGui.h:361
wxMenuBar * ShuttleGuiBase::AddMenuBar ( )

Definition at line 745 of file ShuttleGui.cpp.

References mpMenuBar, and mpParent.

746 {
747  auto menuBar = std::make_unique<wxMenuBar>();
748  mpMenuBar = menuBar.get();
749 
750  wxFrame * pFrame = (wxFrame*)mpParent;
751  pFrame->SetThemeEnabled( true );
752  mpMenuBar->SetThemeEnabled( true );
753  pFrame->SetMenuBar(menuBar.release());
754 
755  return mpMenuBar;
756 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
wxMenuBar * mpMenuBar
Definition: ShuttleGui.h:361
wxTextCtrl * ShuttleGuiBase::AddNumericTextBox ( const wxString &  Caption,
const wxString &  Value,
const int  nChars 
)

Definition at line 580 of file ShuttleGui.cpp.

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

Referenced by TieNumericTextBox().

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

Right aligned text string.

Definition at line 239 of file ShuttleGui.cpp.

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

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

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

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

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

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

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

Definition at line 505 of file ShuttleGui.cpp.

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

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

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

Definition at line 528 of file ShuttleGui.cpp.

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

Referenced by TieSpinCtrl().

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

Definition at line 548 of file ShuttleGui.cpp.

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

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

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

Multiline text box that grows.

Definition at line 616 of file ShuttleGui.cpp.

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

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

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

Centred text string.

Definition at line 274 of file ShuttleGui.cpp.

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

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

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

Definition at line 712 of file ShuttleGui.cpp.

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

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

Left aligned text string.

Definition at line 260 of file ShuttleGui.cpp.

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

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

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

Definition at line 422 of file ShuttleGui.cpp.

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

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

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

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

Definition at line 288 of file ShuttleGui.cpp.

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

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

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

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

Definition at line 1090 of file ShuttleGui.cpp.

References mpShuttle.

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

1091 {
1092  wxASSERT( mpShuttle );
1093  mpShuttle->TransferWrappedType( Name, WrappedRef );
1094 }
std::unique_ptr< Shuttle > mpShuttle
Definition: ShuttleGui.h:328
bool ShuttleGuiBase::DoStep ( int  iStep)

Code-Condenser function.

We have functions which need to do:

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

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

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

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

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

Definition at line 1704 of file ShuttleGui.cpp.

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

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

1705 {
1706  // Get value and create
1707  if( mShuttleMode == eIsCreating )
1708  {
1709  return (iStep==1) || (iStep==2);
1710  }
1711  // Like creating, get the value and set.
1713  {
1714  return (iStep==1) || (iStep==2);
1715  }
1717  {
1718  return (iStep==2) || (iStep==3);
1719  }
1721  return iStep ==2;
1722  wxASSERT( false );
1723  return false;
1724 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EnableCtrl ( bool  bEnable)

Definition at line 186 of file ShuttleGui.cpp.

References eIsCreating, mpLastWind, and mShuttleMode.

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

Definition at line 1041 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

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

1042 {
1043  if( mShuttleMode != eIsCreating )
1044  return;
1045  PopSizer();
1046 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndInvisiblePanel ( )

Definition at line 1020 of file ShuttleGui.cpp.

References EndPanel().

1021 {
1022  EndPanel();
1023 }
void ShuttleGuiBase::EndMultiColumn ( )

Definition at line 1081 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

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

1082 {
1083  if( mShuttleMode != eIsCreating )
1084  return;
1085  PopSizer();
1086 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndNotebook ( )

Definition at line 905 of file ShuttleGui.cpp.

References mpParent.

Referenced by AboutDialog::AboutDialog().

906 {
907  //PopSizer();
908  mpParent = mpParent->GetParent();
909 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
void ShuttleGuiBase::EndNotebookPage ( )

Definition at line 956 of file ShuttleGui.cpp.

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

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

957 {
958  if( mShuttleMode != eIsCreating )
959  return;
960  PopSizer();
961  mpParent = mpParent->GetParent();
962 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndPanel ( )

Definition at line 883 of file ShuttleGui.cpp.

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

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

884 {
885  if( mShuttleMode != eIsCreating )
886  return;
887  PopSizer();
888  mpParent = mpParent->GetParent();
889 }
wxWindow * mpParent
Definition: ShuttleGui.h:359
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndRadioButtonGroup ( )

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

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

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

Definition at line 836 of file ShuttleGui.cpp.

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

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

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

Definition at line 788 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

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

789 {
790  if( mShuttleMode != eIsCreating )
791  return;
792  PopSizer();
793 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
void ShuttleGuiBase::EndThreeColumn ( )
inline
void ShuttleGuiBase::EndTwoColumn ( )
inline
void ShuttleGuiBase::EndVerticalLay ( )

Definition at line 1066 of file ShuttleGui.cpp.

References eIsCreating, mShuttleMode, and PopSizer().

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

1067 {
1068  if( mShuttleMode != eIsCreating )
1069  return;
1070  PopSizer();
1071 }
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
wxWindow* ShuttleGuiBase::GetParent ( )
inline

Definition at line 294 of file ShuttleGui.h.

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

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

Definition at line 304 of file ShuttleGui.h.

Referenced by EffectEqualization::PopulateOrExchange().

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

Definition at line 225 of file ShuttleGui.cpp.

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

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

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

Definition at line 134 of file ShuttleGui.cpp.

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

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

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

Definition at line 2110 of file ShuttleGui.cpp.

References mpSizer, mSizerDepth, and pSizerStack.

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

2111 {
2112  mSizerDepth--;
2113  wxASSERT( mSizerDepth >=0 );
2115 }
wxSizer * pSizerStack[nMaxNestedSizers]
Definition: ShuttleGui.h:326
wxSizer * mpSizer
Definition: ShuttleGui.h:358
ShuttleGuiBase & ShuttleGuiBase::Prop ( int  iProp)

Definition at line 739 of file ShuttleGui.cpp.

References miPropSetByUser.

Referenced by ShuttleGui::Prop().

740 {
741  miPropSetByUser = iProp;
742  return *this;
743 }
void ShuttleGuiBase::PushSizer ( )
protected

Definition at line 2117 of file ShuttleGui.cpp.

References mpSizer, mSizerDepth, nMaxNestedSizers, and pSizerStack.

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

2118 {
2119  mSizerDepth++;
2120  wxASSERT( mSizerDepth < nMaxNestedSizers );
2122 }
wxSizer * pSizerStack[nMaxNestedSizers]
Definition: ShuttleGui.h:326
const int nMaxNestedSizers
Definition: ShuttleGui.h:33
wxSizer * mpSizer
Definition: ShuttleGui.h:358
void ShuttleGuiBase::ResetId ( )

Definition at line 179 of file ShuttleGui.cpp.

References miId, miIdNext, and miIdSetByUser.

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

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

Definition at line 286 of file ShuttleGui.h.

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

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

Definition at line 288 of file ShuttleGui.h.

Referenced by QualityPrefs::PopulateOrExchange().

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

Definition at line 2047 of file ShuttleGui.cpp.

References miProp, and miPropSetByUser.

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

2048 {
2049  if( miPropSetByUser >=0 )
2050  {
2052  miPropSetByUser =-1;
2053  return;
2054  }
2055  miProp = Default;
2056 }
void ShuttleGuiBase::SetSizeHints ( int  minX,
int  minY 
)

Used to modify an already placed Window.

Definition at line 194 of file ShuttleGui.cpp.

References eIsCreating, mpLastWind, and mShuttleMode.

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

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

Definition at line 2413 of file ShuttleGui.cpp.

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

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

Definition at line 2382 of file ShuttleGui.cpp.

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

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

Definition at line 203 of file ShuttleGui.cpp.

References eIsCreating, mpSizer, and mShuttleMode.

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

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

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

Definition at line 213 of file ShuttleGui.cpp.

References eIsCreating, mpSizer, and mShuttleMode.

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

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

Starts a Horizontal Layout.

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

Definition at line 1032 of file ShuttleGui.cpp.

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

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

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

Definition at line 997 of file ShuttleGui.cpp.

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

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

Definition at line 1073 of file ShuttleGui.cpp.

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

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

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

Definition at line 891 of file ShuttleGui.cpp.

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

Referenced by AboutDialog::AboutDialog().

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

Definition at line 912 of file ShuttleGui.cpp.

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

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

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

Definition at line 934 of file ShuttleGui.cpp.

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

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

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

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

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

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

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

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

Definition at line 1983 of file ShuttleGui.cpp.

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

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

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

Definition at line 1994 of file ShuttleGui.cpp.

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

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

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

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

Parameters
istyledeprecated parameter, but has been used for hacking.

Definition at line 803 of file ShuttleGui.cpp.

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

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

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

Starts a static box around a number of controls.

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

Definition at line 771 of file ShuttleGui.cpp.

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

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

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

Definition at line 1048 of file ShuttleGui.cpp.

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

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

1049 {
1050  if( mShuttleMode != eIsCreating )
1051  return;
1052  miSizerProp=iProp;
1053  mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1054  UpdateSizers();
1055 }
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:342
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:332
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:357
void ShuttleGuiBase::StartVerticalLay ( int  PositionFlags,
int  iProp 
)

Definition at line 1057 of file ShuttleGui.cpp.

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

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

Definition at line 1102 of file ShuttleGui.cpp.

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

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

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

Definition at line 1495 of file ShuttleGui.cpp.

References TieCheckBox().

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1729 of file ShuttleGui.cpp.

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

1733 {
1734  wxCheckBox * pCheck=NULL;
1735 
1736  bool bValue=bDefault;
1737  WrappedType WrappedRef( bValue );
1738  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1739  if( DoStep(2) ) pCheck = TieCheckBox( Prompt, WrappedRef );
1740  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1741 
1742  return pCheck;
1743 }
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 1144 of file ShuttleGui.cpp.

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

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

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

Definition at line 1502 of file ShuttleGui.cpp.

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

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1747 of file ShuttleGui.cpp.

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

1751 {
1752  wxCheckBox * pCheck=NULL;
1753 
1754  bool bValue=bDefault;
1755  WrappedType WrappedRef( bValue );
1756  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1757  if( DoStep(2) ) pCheck = TieCheckBoxOnRight( Prompt, WrappedRef );
1758  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1759 
1760  return pCheck;
1761 }
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 1361 of file ShuttleGui.cpp.

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

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

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

Definition at line 1586 of file ShuttleGui.cpp.

References TieChoice().

1590 {
1591  WrappedType WrappedRef( Selected );
1592  return TieChoice( Prompt, WrappedRef, pChoices );
1593 }
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 1595 of file ShuttleGui.cpp.

References TieChoice().

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

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

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

Definition at line 1882 of file ShuttleGui.cpp.

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

1885 {
1886  // Do this to force any needed migrations first
1887  enumSetting.Read();
1888 
1889  wxArrayString visibleChoices, internalChoices;
1890  for (const auto &ident : enumSetting) {
1891  visibleChoices.push_back( ident.Translation() );
1892  internalChoices.push_back( ident.Internal() );
1893  }
1894  return TieChoice(
1895  Prompt, enumSetting.Key(), enumSetting.Default().Internal(),
1896  visibleChoices, internalChoices );
1897 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
static CommandHandlerObject & ident(AudacityProject &project)
Definition: Menus.cpp:298
wxString Read() const
Definition: Prefs.cpp:379
wxChoice * ShuttleGuiBase::TieChoice ( const wxString &  Prompt,
const wxString &  SettingName,
const wxString &  Default,
const wxArrayString &  Choices,
const wxArrayString &  InternalChoices 
)
virtual

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1906 of file ShuttleGui.cpp.

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

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

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1938 of file ShuttleGui.cpp.

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

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

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1970 of file ShuttleGui.cpp.

References TieChoice().

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

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

Definition at line 1271 of file ShuttleGui.cpp.

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

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

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

Definition at line 1535 of file ShuttleGui.cpp.

References TieNumericTextBox().

1536 {
1537  WrappedType WrappedRef(Selected);
1538  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1539 }
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 1541 of file ShuttleGui.cpp.

References TieNumericTextBox().

1542 {
1543  WrappedType WrappedRef( Selected );
1544  return TieNumericTextBox( Prompt, WrappedRef, nChars );
1545 }
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 1547 of file ShuttleGui.cpp.

References TieNumericTextBox().

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1823 of file ShuttleGui.cpp.

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

1828 {
1829  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1830 
1831  wxString Temp = Default;
1832  WrappedType WrappedRef( Temp );
1833  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1834  if( DoStep(2) ) pText = TieNumericTextBox( Prompt, WrappedRef, nChars );
1835  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1836  return pText;
1837 }
bool DoStep(int iStep)
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const wxString &  Prompt,
const wxString &  SettingName,
const double &  Default,
const int  nChars 
)
virtual

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1860 of file ShuttleGui.cpp.

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

1865 {
1866  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1867 
1868  double Temp = Default;
1869  WrappedType WrappedRef( Temp );
1870  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1871  if( DoStep(2) ) pText = TieNumericTextBox( Prompt, WrappedRef, nChars );
1872  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1873  return pText;
1874 }
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 1429 of file ShuttleGui.cpp.

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

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

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

This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair.

Definition at line 2005 of file ShuttleGui.cpp.

References TieRadioButton().

2008 {
2009  int iTemp = iValue;
2010  WrappedType WrappedRef( iTemp );
2011  return TieRadioButton( Prompt, WrappedRef );
2012 }
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 2015 of file ShuttleGui.cpp.

References TieRadioButton().

2018 {
2019  // In what follows, WrappedRef is used in read only mode, but we
2020  // don't have a 'read-only' version, so we copy to deal with the constness.
2021  wxString Temp = Value;
2022  WrappedType WrappedRef( Temp );
2023  return TieRadioButton( Prompt, WrappedRef );
2024 }
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 1314 of file ShuttleGui.cpp.

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

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

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

Definition at line 1553 of file ShuttleGui.cpp.

References TieSlider().

1554 {
1555  WrappedType WrappedRef( pos );
1556  return TieSlider( Prompt, WrappedRef, max, min );
1557 }
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 1559 of file ShuttleGui.cpp.

References TieSlider().

1560 {
1561  WrappedType WrappedRef( pos );
1562  return TieSlider( Prompt, WrappedRef, max, min );
1563 }
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 1565 of file ShuttleGui.cpp.

References TieSlider().

1566 {
1567  const float RoundFix=0.0000001f;
1568  int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1569  wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1570  pos = iVal*(fMax-fMin)*0.01+fMin;
1571  return pWnd;
1572 }
wxSlider * TieSlider(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
wxSlider * ShuttleGuiBase::TieSlider ( const wxString &  Prompt,
const wxString &  SettingName,
const int  iDefault,
const int  max,
const int  min = 0 
)
virtual

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1765 of file ShuttleGui.cpp.

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

1771 {
1772  wxSlider * pSlider=NULL;
1773 
1774  int iValue=iDefault;
1775  WrappedType WrappedRef( iValue );
1776  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1777  if( DoStep(2) ) pSlider = TieSlider( Prompt, WrappedRef, max, min );
1778  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1779 
1780  return pSlider;
1781 }
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 1185 of file ShuttleGui.cpp.

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

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

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

Definition at line 1511 of file ShuttleGui.cpp.

References TieSpinCtrl().

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1785 of file ShuttleGui.cpp.

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

1791 {
1792  wxSpinCtrl * pSpinCtrl=NULL;
1793 
1794  int iValue = Value;
1795  WrappedType WrappedRef( iValue );
1796  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1797  if( DoStep(2) ) pSpinCtrl = TieSpinCtrl( Prompt, WrappedRef, max, min );
1798  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1799 
1800  return pSpinCtrl;
1801 }
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 1228 of file ShuttleGui.cpp.

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

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

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

Definition at line 1517 of file ShuttleGui.cpp.

References TieTextBox().

1518 {
1519  WrappedType WrappedRef(Selected);
1520  return TieTextBox( Prompt, WrappedRef, nChars );
1521 }
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 1523 of file ShuttleGui.cpp.

References TieTextBox().

1524 {
1525  WrappedType WrappedRef( Selected );
1526  return TieTextBox( Prompt, WrappedRef, nChars );
1527 }
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 1529 of file ShuttleGui.cpp.

References TieTextBox().

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

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1805 of file ShuttleGui.cpp.

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

1810 {
1811  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1812 
1813  wxString Temp = Default;
1814  WrappedType WrappedRef( Temp );
1815  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1816  if( DoStep(2) ) pText = TieTextBox( Prompt, WrappedRef, nChars );
1817  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1818  return pText;
1819 }
bool DoStep(int iStep)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
wxTextCtrl * TieTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:31
wxTextCtrl * ShuttleGuiBase::TieTextBox ( const wxString &  Prompt,
const wxString &  SettingName,
const double &  Default,
const int  nChars 
)
virtual

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

Reimplemented in ShuttleGuiGetDefinition.

Definition at line 1841 of file ShuttleGui.cpp.

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

1846 {
1847  wxTextCtrl * pText=(wxTextCtrl*)NULL;
1848 
1849  double Temp = Default;
1850  WrappedType WrappedRef( Temp );
1851  if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef );
1852  if( DoStep(2) ) pText = TieTextBox( Prompt, WrappedRef, nChars );
1853  if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef );
1854  return pText;
1855 }
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 1574 of file ShuttleGui.cpp.

References TieSlider().

1575 {
1576  int iVal=(pos-fMin)*100.0/(fMax-fMin);
1577 // if( mShuttleMode == eIsCreating )
1578 // {
1579 // return AddVSlider( Prompt, iVal, 100 );
1580 // }
1581  wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1582  pos = iVal*(fMax-fMin)*0.01+fMin;
1583  return pWnd;
1584 }
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 1622 of file ShuttleGui.cpp.

References miNoMatchSelector.

Referenced by TieChoice().

1623 {
1624  int n = nIn;
1625  if( n== wxNOT_FOUND )
1627  miNoMatchSelector = 0;
1628  if( n < (int)Choices.GetCount() )
1629  {
1630  return Choices[n];
1631  }
1632  return wxT("");
1633 }
int miNoMatchSelector
Definition: ShuttleGui.h:330
int ShuttleGuiBase::TranslateFromIndex ( const int  nIn,
const std::vector< int > &  Choices 
)

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

Definition at line 1646 of file ShuttleGui.cpp.

References miNoMatchSelector.

1647 {
1648  int n = nIn;
1649  if( n== wxNOT_FOUND )
1651  miNoMatchSelector = 0;
1652  if( n < (int)Choices.size() )
1653  {
1654  return Choices[n];
1655  }
1656  return 0;
1657 }
int miNoMatchSelector
Definition: ShuttleGui.h:330
int ShuttleGuiBase::TranslateToIndex ( const wxString &  Value,
const wxArrayString &  Choices 
)

String-to-Index.

Definition at line 1612 of file ShuttleGui.cpp.

References miNoMatchSelector.

Referenced by TieChoice().

1613 {
1614  int n = Choices.Index( Value );
1615  if( n== wxNOT_FOUND )
1617  miNoMatchSelector = 0;
1618  return n;
1619 }
int miNoMatchSelector
Definition: ShuttleGui.h:330
int ShuttleGuiBase::TranslateToIndex ( const int  Value,
const std::vector< int > &  Choices 
)

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

Definition at line 1636 of file ShuttleGui.cpp.

References make_iterator_range(), and miNoMatchSelector.

1637 {
1638  int n = make_iterator_range(Choices).index( Value );
1639  if( n == wxNOT_FOUND )
1641  miNoMatchSelector = 0;
1642  return n;
1643 }
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:596
int miNoMatchSelector
Definition: ShuttleGui.h:330
void ShuttleGuiBase::UpdateSizers ( )
protected
void ShuttleGuiBase::UpdateSizersAtStart ( )
protected

Definition at line 2107 of file ShuttleGui.cpp.

References UpdateSizersCore().

Referenced by StartScroller().

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

Definition at line 2102 of file ShuttleGui.cpp.

References UpdateSizersCore().

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

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

Definition at line 2059 of file ShuttleGui.cpp.

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

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

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

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

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

2037 {
2038  if( miIdSetByUser > 0)
2039  {
2040  miId = miIdSetByUser;
2041  miIdSetByUser = -1;
2042  return;
2043  }
2044  miId = miIdNext++;
2045 }

Member Data Documentation

int ShuttleGuiBase::miBorder
protected

Definition at line 344 of file ShuttleGui.h.

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

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

Definition at line 350 of file ShuttleGui.h.

Referenced by ResetId(), and UseUpId().

int ShuttleGuiBase::miIdSetByUser
protected

Definition at line 351 of file ShuttleGui.h.

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

int ShuttleGuiBase::miNoMatchSelector
protected

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

Definition at line 330 of file ShuttleGui.h.

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

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

Definition at line 353 of file ShuttleGui.h.

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

int ShuttleGuiBase::miSizerProp
protected

Unwrapped integer value.

Definition at line 342 of file ShuttleGui.h.

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

long ShuttleGuiBase::miStyle
protected

Definition at line 345 of file ShuttleGui.h.

Referenced by Init(), and Style().

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

Definition at line 324 of file ShuttleGui.h.

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

wxMenu* ShuttleGuiBase::mpMenu
protected

Definition at line 362 of file ShuttleGui.h.

Referenced by AddMenu().

wxMenuBar* ShuttleGuiBase::mpMenuBar
protected

Definition at line 361 of file ShuttleGui.h.

Referenced by AddMenu(), and AddMenuBar().

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

Definition at line 328 of file ShuttleGui.h.

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

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

The setting controlled by a group.

Definition at line 336 of file ShuttleGui.h.

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

WrappedType ShuttleGuiBase::mRadioValue
protected

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

Definition at line 338 of file ShuttleGui.h.

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

int ShuttleGuiBase::mRadioValueInt
protected

Unwrapped string value.

Definition at line 340 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

wxString ShuttleGuiBase::mRadioValueString
protected

The wrapped value associated with the active radio button.

Definition at line 339 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

wxString ShuttleGuiBase::mSettingName
protected

Definition at line 335 of file ShuttleGui.h.

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

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

Definition at line 343 of file ShuttleGui.h.

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

wxSizer* ShuttleGuiBase::pSizerStack[nMaxNestedSizers]
protected

Definition at line 326 of file ShuttleGui.h.

Referenced by PopSizer(), and PushSizer().


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