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

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

#include <ShuttleGui.h>

Inheritance diagram for ShuttleGuiBase:
[legend]
Collaboration diagram for ShuttleGuiBase:
[legend]

Classes

struct  ListControlColumn
 

Public Member Functions

 ShuttleGuiBase (wxWindow *pParent, teShuttleMode ShuttleMode, bool vertical, wxSize minSize)
 
virtual ~ShuttleGuiBase ()
 
void Init (bool vertical, wxSize minSize)
 
void ResetId ()
 
void HandleOptionality (const TranslatableString &Prompt)
 
void AddPrompt (const TranslatableString &Prompt, int wrapWidth=0)
 Right aligned text string. More...
 
void AddUnits (const TranslatableString &Prompt, int wrapWidth=0)
 Left aligned text string. More...
 
void AddTitle (const TranslatableString &Prompt, int wrapWidth=0)
 Centred text string. More...
 
wxWindow * AddWindow (wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE)
 
wxSlider * AddSlider (const TranslatableString &Prompt, int pos, int Max, int Min=0)
 
wxSlider * AddVSlider (const TranslatableString &Prompt, int pos, int Max)
 
wxSpinCtrl * AddSpinCtrl (const TranslatableString &Prompt, int Value, int Max, int Min)
 
wxTreeCtrl * AddTree ()
 
wxRadioButton * AddRadioButton (const TranslatableString &Prompt, int selector=0, int initValue=0)
 
wxRadioButton * AddRadioButtonToGroup (const TranslatableString &Prompt, int selector=1, int initValue=0)
 
wxButton * AddButton (const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
 
wxBitmapButton * AddBitmapButton (const wxBitmap &Bitmap, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
 
wxStaticText * AddVariableText (const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
 
ReadOnlyTextAddReadOnlyText (const TranslatableString &Caption, const wxString &Value)
 
wxTextCtrl * AddTextBox (const TranslatableString &Caption, const wxString &Value, const int nChars)
 
wxTextCtrl * AddNumericTextBox (const TranslatableString &Caption, const wxString &Value, const int nChars)
 
wxTextCtrl * AddTextWindow (const wxString &Value)
 Multiline text box that grows. More...
 
wxListBox * AddListBox (const wxArrayStringEx &choices)
 
wxListCtrl * AddListControl (std::initializer_list< const ListControlColumn > columns={}, long listControlStyles=0)
 
wxListCtrl * AddListControlReportMode (std::initializer_list< const ListControlColumn > columns={}, long listControlStyles=0)
 
wxGrid * AddGrid ()
 
wxCheckBox * AddCheckBox (const TranslatableString &Prompt, bool Selected)
 
wxCheckBox * AddCheckBoxOnRight (const TranslatableString &Prompt, bool Selected)
 
wxCheckBox * AddCheckBox (const TranslatableString &Prompt, const wxChar *)=delete
 
wxCheckBox * AddCheckBox (const TranslatableString &Prompt, const char *)=delete
 
wxCheckBox * AddCheckBoxOnRight (const TranslatableString &Prompt, const wxChar *)=delete
 
wxCheckBox * AddCheckBoxOnRight (const TranslatableString &Prompt, const char *)=delete
 
wxComboBox * AddCombo (const TranslatableString &Prompt, const wxString &Selected, const wxArrayStringEx &choices)
 
wxChoice * AddChoice (const TranslatableString &Prompt, const TranslatableStrings &choices, int Selected=-1)
 
wxChoice * AddChoice (const TranslatableString &Prompt, const TranslatableStrings &choices, const TranslatableString &selected)
 
void AddIcon (wxBitmap *pBmp)
 
void AddFixedText (const TranslatableString &Str, bool bCenter=false, int wrapWidth=0)
 
void AddConstTextBox (const TranslatableString &Caption, const TranslatableString &Value)
 Single line text box of fixed size. More...
 
void StartHorizontalLay (int PositionFlags=wxALIGN_CENTRE, int iProp=1)
 
void EndHorizontalLay ()
 
void StartVerticalLay (int iProp=1)
 
void StartVerticalLay (int PositionFlags, int iProp)
 
void EndVerticalLay ()
 
void StartWrapLay (int PositionFlags=wxEXPAND, int iProp=0)
 
void EndWrapLay ()
 
wxScrolledWindow * StartScroller (int iStyle=0)
 
void EndScroller ()
 
wxPanel * StartPanel (int iStyle=0)
 
void EndPanel ()
 
void StartMultiColumn (int nCols, int PositionFlags=wxALIGN_LEFT)
 
void EndMultiColumn ()
 
void StartTwoColumn ()
 
void EndTwoColumn ()
 
void StartThreeColumn ()
 
void EndThreeColumn ()
 
wxStaticBox * StartStatic (const TranslatableString &Str, int iProp=0)
 
void EndStatic ()
 
wxNotebook * StartNotebook ()
 
void EndNotebook ()
 
wxSimplebook * StartSimplebook ()
 
void EndSimplebook ()
 
wxNotebookPageStartNotebookPage (const TranslatableString &Name)
 
void EndNotebookPage ()
 
wxPanel * StartInvisiblePanel (int border=0)
 
void EndInvisiblePanel ()
 
void StartRadioButtonGroup (ChoiceSetting &Setting)
 Call this before any TieRadioButton calls. More...
 
void EndRadioButtonGroup ()
 
bool DoStep (int iStep)
 
int TranslateToIndex (const wxString &Value, const wxArrayStringEx &Choices)
 String-to-Index. More...
 
wxString TranslateFromIndex (const int nIn, const wxArrayStringEx &Choices)
 Index-to-String. More...
 
wxTextCtrl * TieTextBox (const TranslatableString &Caption, wxString &Value, const int nChars=0)
 
wxTextCtrl * TieTextBox (const TranslatableString &Prompt, int &Selected, const int nChars=0)
 
wxTextCtrl * TieTextBox (const TranslatableString &Prompt, double &Value, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const TranslatableString &Prompt, int &Value, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const TranslatableString &Prompt, double &Value, const int nChars=0)
 
wxCheckBox * TieCheckBox (const TranslatableString &Prompt, bool &Var)
 
wxCheckBox * TieCheckBoxOnRight (const TranslatableString &Prompt, bool &Var)
 
wxChoice * TieChoice (const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
 
wxChoice * TieChoice (const TranslatableString &Prompt, int &Selected, const TranslatableStrings &choices)
 
wxSlider * TieSlider (const TranslatableString &Prompt, int &pos, const int max, const int min=0)
 
wxSlider * TieSlider (const TranslatableString &Prompt, double &pos, const double max, const double min=0.0)
 
wxSlider * TieSlider (const TranslatableString &Prompt, float &pos, const float fMin, const float fMax)
 
wxSlider * TieVSlider (const TranslatableString &Prompt, float &pos, const float fMin, const float fMax)
 
wxRadioButton * TieRadioButton ()
 This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair. More...
 
wxSpinCtrl * TieSpinCtrl (const TranslatableString &Prompt, int &Value, const int max, const int min=0)
 
virtual wxCheckBox * TieCheckBox (const TranslatableString &Prompt, const BoolSetting &Setting)
 
virtual wxCheckBox * TieCheckBoxOnRight (const TranslatableString &Prompt, const BoolSetting &Setting)
 
virtual wxChoice * TieChoice (const TranslatableString &Prompt, ChoiceSetting &choiceSetting)
 
virtual wxChoice * TieNumberAsChoice (const TranslatableString &Prompt, IntSetting &Setting, const TranslatableStrings &Choices, const std::vector< int > *pInternalChoices=nullptr, int iNoMatchSelector=0)
 
virtual wxTextCtrl * TieTextBox (const TranslatableString &Prompt, const StringSetting &Setting, const int nChars)
 
virtual wxTextCtrl * TieIntegerTextBox (const TranslatableString &Prompt, const IntSetting &Setting, const int nChars)
 
virtual wxTextCtrl * TieNumericTextBox (const TranslatableString &Prompt, const DoubleSetting &Setting, const int nChars)
 
virtual wxSlider * TieSlider (const TranslatableString &Prompt, const IntSetting &Setting, const int max, const int min=0)
 
virtual wxSpinCtrl * TieSpinCtrl (const TranslatableString &Prompt, const IntSetting &Setting, const int max, const int min)
 
void SetBorder (int Border)
 
int GetBorder () const noexcept
 
void SetSizerProportion (int iProp)
 
void SetStretchyCol (int i)
 Used to modify an already placed FlexGridSizer to make a column stretchy. More...
 
void SetStretchyRow (int i)
 Used to modify an already placed FlexGridSizer to make a row stretchy. More...
 
wxWindow * GetParent ()
 
ShuttleGuiBaseProp (int iProp)
 
void UseUpId ()
 
wxSizer * GetSizer ()
 

Static Public Member Functions

static void ApplyItem (int step, const DialogDefinition::Item &item, wxWindow *pWind, wxWindow *pDlg)
 

Protected Member Functions

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

Protected Attributes

wxWindow *const mpDlg
 
wxSizer * pSizerStack [nMaxNestedSizers]
 
std::unique_ptr< ShuttlePrefsmpShuttle
 
int miNoMatchSelector
 
teShuttleMode mShuttleMode
 Used in choices to determine which item to use on no match. More...
 
int miSizerProp
 
int mSizerDepth
 
int miBorder
 
int miProp
 
int miId
 
int miIdNext
 
int miIdSetByUser
 
int miPropSetByUser
 
bool * mpbOptionalFlag
 
std::unique_ptr< wxSizer > mpSubSizer
 
wxSizer * mpSizer
 
wxWindow * mpParent
 
wxWindow * mpWind
 
DialogDefinition::Item mItem
 

Private Member Functions

void DoInsertListColumns (wxListCtrl *pListCtrl, long listControlStyles, std::initializer_list< const ListControlColumn > columns)
 
void DoDataShuttle (const wxString &Name, WrappedType &WrappedRef)
 
wxCheckBox * DoTieCheckBoxOnRight (const TranslatableString &Prompt, WrappedType &WrappedRef)
 
wxTextCtrl * DoTieTextBox (const TranslatableString &Prompt, WrappedType &WrappedRef, const int nChars)
 
wxTextCtrl * DoTieNumericTextBox (const TranslatableString &Prompt, WrappedType &WrappedRef, const int nChars)
 
wxCheckBox * DoTieCheckBox (const TranslatableString &Prompt, WrappedType &WrappedRef)
 
wxSlider * DoTieSlider (const TranslatableString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
 
wxSpinCtrl * DoTieSpinCtrl (const TranslatableString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
 
wxRadioButton * DoAddRadioButton (const TranslatableString &Prompt, int style, int selector, int initValue)
 Unwrapped string value. More...
 

Private Attributes

std::vector< EnumValueSymbolmRadioSymbols
 
wxString mRadioSettingName
 
std::optional< WrappedTypemRadioValue
 The setting controlled by a group. More...
 
int mRadioCount
 The wrapped value associated with the active radio button. More...
 
wxString mRadioValueString
 The index of this radio item. -1 for none. More...
 

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

Constructor & Destructor Documentation

◆ ShuttleGuiBase()

ShuttleGuiBase::ShuttleGuiBase ( wxWindow *  pParent,
teShuttleMode  ShuttleMode,
bool  vertical,
wxSize  minSize 
)

Definition at line 127 of file ShuttleGui.cpp.

129 : mpDlg{ pParent }
130{
131 wxASSERT( (pParent != NULL ) || ( ShuttleMode != eIsCreating));
132 mpbOptionalFlag = nullptr;
133 mpParent = pParent;
134 mShuttleMode = ShuttleMode;
135 Init( vertical, minSize );
136}
@ eIsCreating
Definition: ShuttleGui.h:37
wxWindow *const mpDlg
Definition: ShuttleGui.h:525
void Init(bool vertical, wxSize minSize)
Definition: ShuttleGui.cpp:142
bool * mpbOptionalFlag
Definition: ShuttleGui.h:546
wxWindow * mpParent
Definition: ShuttleGui.h:550
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:532

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

Here is the call graph for this function:

◆ ~ShuttleGuiBase()

ShuttleGuiBase::~ShuttleGuiBase ( )
virtual

Definition at line 138 of file ShuttleGui.cpp.

139{
140}

Member Function Documentation

◆ AddBitmapButton()

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

Definition at line 378 of file ShuttleGui.cpp.

380{
381 UseUpId();
383 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxBitmapButton);
384 wxBitmapButton * pBtn;
385 mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, Bitmap,
386 wxDefaultPosition, wxDefaultSize, GetStyle( wxBU_AUTODRAW ) );
387 pBtn->SetBackgroundColour(
388 wxColour( 246,246,243));
389// wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
390 miProp=0;
391 UpdateSizersCore(false, PositionFlags | wxALL);
392 if (setDefault)
393 pBtn->SetDefault();
394 return pBtn;
395}
#define safenew
Definition: MemoryX.h:10
long GetStyle(long Style)
wxWindow * GetParent()
Definition: ShuttleGui.h:491
void UpdateSizersCore(bool bPrepend, int Flags, bool prompt=false)
wxWindow * mpWind
Definition: ShuttleGui.h:551

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

Here is the call graph for this function:

◆ AddButton()

wxButton * ShuttleGuiBase::AddButton ( const TranslatableString Text,
int  PositionFlags = wxALIGN_CENTRE,
bool  setDefault = false 
)

Definition at line 359 of file ShuttleGui.cpp.

361{
362 UseUpId();
364 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxButton);
365 wxButton * pBtn;
366 const auto translated = Text.Translation();
367 mpWind = pBtn = safenew wxButton(GetParent(), miId,
368 translated, wxDefaultPosition, wxDefaultSize,
369 GetStyle( 0 ) );
370 mpWind->SetName(wxStripMenuCodes(translated));
371 miProp=0;
372 UpdateSizersCore(false, PositionFlags | wxALL);
373 if (setDefault)
374 pBtn->SetDefault();
375 return pBtn;
376}
wxString Translation() const

References eIsCreating, GetParent(), GetStyle(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizersCore(), and UseUpId().

Referenced by cloud::audiocom::ShareAudioDialog::Populate(), and cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddCheckBox() [1/3]

wxCheckBox * ShuttleGuiBase::AddCheckBox ( const TranslatableString Prompt,
bool  Selected 
)

Definition at line 308 of file ShuttleGui.cpp.

309{
310 HandleOptionality( Prompt );
311 auto realPrompt = Prompt.Translation();
312 if( mpbOptionalFlag )
313 {
314 AddPrompt( {} );
315 //realPrompt = wxT("");
316 }
317
318 UseUpId();
320 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
321 wxCheckBox * pCheckBox;
322 miProp=0;
323 mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, realPrompt, wxDefaultPosition, wxDefaultSize,
324 GetStyle( 0 ));
325 pCheckBox->SetValue(Selected);
326 if (realPrompt.empty()) {
327 // NVDA 2018.3 does not read controls which are buttons, check boxes or radio buttons which have
328 // an accessibility name which is empty. Bug 1980.
329#if wxUSE_ACCESSIBILITY
330 // so that name can be set on a standard control
331 pCheckBox->SetAccessible(safenew WindowAccessible(pCheckBox));
332#endif
333 pCheckBox->SetName(wxT("\a")); // non-empty string which screen readers do not read
334 }
335 UpdateSizers();
336 return pCheckBox;
337}
wxT("CloseDown"))
void HandleOptionality(const TranslatableString &Prompt)
Definition: ShuttleGui.cpp:223
void AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
Definition: ShuttleGui.cpp:237
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpbOptionalFlag, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), UseUpId(), and wxT().

Referenced by DoTieCheckBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddCheckBox() [2/3]

wxCheckBox * ShuttleGuiBase::AddCheckBox ( const TranslatableString Prompt,
const char *   
)
delete

◆ AddCheckBox() [3/3]

wxCheckBox * ShuttleGuiBase::AddCheckBox ( const TranslatableString Prompt,
const wxChar *   
)
delete

◆ AddCheckBoxOnRight() [1/3]

wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight ( const TranslatableString Prompt,
bool  Selected 
)

For a consistent 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 342 of file ShuttleGui.cpp.

343{
344 HandleOptionality( Prompt );
345 AddPrompt( Prompt );
346 UseUpId();
348 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
349 wxCheckBox * pCheckBox;
350 miProp=0;
351 mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, wxT(""), wxDefaultPosition, wxDefaultSize,
352 GetStyle( 0 ));
353 pCheckBox->SetValue(Selected);
354 pCheckBox->SetName(Prompt.Stripped().Translation());
355 UpdateSizers();
356 return pCheckBox;
357}
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Stripped(), TranslatableString::Translation(), UpdateSizers(), UseUpId(), and wxT().

Referenced by DoTieCheckBoxOnRight(), and TieCheckBoxOnRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddCheckBoxOnRight() [2/3]

wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight ( const TranslatableString Prompt,
const char *   
)
delete

◆ AddCheckBoxOnRight() [3/3]

wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight ( const TranslatableString Prompt,
const wxChar *   
)
delete

◆ AddChoice() [1/2]

wxChoice * ShuttleGuiBase::AddChoice ( const TranslatableString Prompt,
const TranslatableStrings choices,
const TranslatableString selected 
)

Definition at line 432 of file ShuttleGui.cpp.

434{
435 return AddChoice(
436 Prompt, choices, make_iterator_range( choices ).index( Selected ) );
437}
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:448
wxChoice * AddChoice(const TranslatableString &Prompt, const TranslatableStrings &choices, int Selected=-1)
Definition: ShuttleGui.cpp:397

References AddChoice(), and make_iterator_range().

Here is the call graph for this function:

◆ AddChoice() [2/2]

wxChoice * ShuttleGuiBase::AddChoice ( const TranslatableString Prompt,
const TranslatableStrings choices,
int  Selected = -1 
)

Definition at line 397 of file ShuttleGui.cpp.

399{
400 HandleOptionality( Prompt );
401 AddPrompt( Prompt );
402 UseUpId();
404 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxChoice);
405 wxChoice * pChoice;
406 miProp=0;
407
408 mpWind = pChoice = safenew wxChoice(
409 GetParent(),
410 miId,
411 wxDefaultPosition,
412 wxDefaultSize,
413 transform_container<wxArrayString>(
414 choices, std::mem_fn( &TranslatableString::StrippedTranslation ) ),
415 GetStyle( 0 ) );
416
417 pChoice->SetMinSize( { 180, -1 } );// Use -1 for 'default size' - Platform specific.
418#ifdef __WXMAC__
419#if wxUSE_ACCESSIBILITY
420 // so that name can be set on a standard control
421 mpWind->SetAccessible(safenew WindowAccessible(mpWind));
422#endif
423#endif
424 pChoice->SetName(Prompt.Stripped().Translation());
425 if ( Selected >= 0 && Selected < (int)choices.size() )
426 pChoice->SetSelection( Selected );
427
428 UpdateSizers();
429 return pChoice;
430}
wxString StrippedTranslation() const

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Stripped(), TranslatableString::StrippedTranslation(), TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Referenced by AddChoice(), and TieChoice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddCombo()

wxComboBox * ShuttleGuiBase::AddCombo ( const TranslatableString Prompt,
const wxString &  Selected,
const wxArrayStringEx choices 
)

Definition at line 516 of file ShuttleGui.cpp.

519{
520 const auto translated = Prompt.Translation();
521 HandleOptionality( Prompt );
522 AddPrompt( Prompt );
523 UseUpId();
525 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxComboBox);
526 wxComboBox * pCombo;
527 miProp=0;
528
529 int n = choices.size();
530 if( n>50 ) n=50;
531 int i;
532 wxString Choices[50];
533 for(i=0;i<n;i++)
534 {
535 Choices[i] = choices[i];
536 }
537
538 mpWind = pCombo = safenew wxComboBox(GetParent(), miId, Selected, wxDefaultPosition, wxDefaultSize,
539 n, Choices, GetStyle( 0 ));
540 mpWind->SetName(wxStripMenuCodes(translated));
541
542 UpdateSizers();
543 return pCombo;
544}

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Here is the call graph for this function:

◆ AddConstTextBox()

void ShuttleGuiBase::AddConstTextBox ( const TranslatableString Caption,
const TranslatableString Value 
)

Single line text box of fixed size.

Definition at line 732 of file ShuttleGui.cpp.

734{
735 HandleOptionality( Prompt );
736 AddPrompt( Prompt );
737 UseUpId();
739 return;
740// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
741 miProp=0;
742 UpdateSizers();
743 miProp=0;
744 const auto translatedValue = Value.Translation();
745 mpWind = safenew wxStaticText(GetParent(), miId,
746 translatedValue, wxDefaultPosition, wxDefaultSize,
747 GetStyle( 0 ));
748 mpWind->SetName(translatedValue); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
749 UpdateSizers();
750}

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Here is the call graph for this function:

◆ AddFixedText()

void ShuttleGuiBase::AddFixedText ( const TranslatableString Str,
bool  bCenter = false,
int  wrapWidth = 0 
)

Definition at line 439 of file ShuttleGui.cpp.

441{
442 const auto translated = Str.Translation();
443 UseUpId();
445 return;
446 auto text = safenew wxStaticText(GetParent(),
447 miId, translated, wxDefaultPosition, wxDefaultSize,
448 GetStyle( wxALIGN_LEFT ));
449 mpWind = text;
450 if ( wrapWidth > 0 )
451 text->Wrap( wrapWidth );
452 mpWind->SetName(wxStripMenuCodes(translated)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
453 if( bCenter )
454 {
455 miProp=1;
457 }
458 else
459 UpdateSizers();
460}
void UpdateSizersC()

References eIsCreating, GetParent(), GetStyle(), miId, miProp, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), UpdateSizersC(), and UseUpId().

Referenced by cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddGrid()

wxGrid * ShuttleGuiBase::AddGrid ( )

Definition at line 767 of file ShuttleGui.cpp.

768{
769 UseUpId();
771 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxGrid);
772 wxGrid * pGrid;
773 SetProportions( 1 );
774 mpWind = pGrid = safenew wxGrid(GetParent(), miId, wxDefaultPosition,
775 wxDefaultSize, GetStyle( wxWANTS_CHARS ));
776 pGrid->SetMinSize( wxSize( 120, 150 ));
777 UpdateSizers();
778 return pGrid;
779}
void SetProportions(int Default)

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

Here is the call graph for this function:

◆ AddIcon()

void ShuttleGuiBase::AddIcon ( wxBitmap *  pBmp)

Definition at line 867 of file ShuttleGui.cpp.

868{
869 UseUpId();
871// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
872 return;
873 wxBitmapButton * pBtn;
874 mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, *pBmp,
875 wxDefaultPosition, wxDefaultSize, GetStyle( wxBU_AUTODRAW ) );
876 pBtn->SetWindowStyle( wxBORDER_NONE );
877 pBtn->SetCanFocus(false);
879}

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

Here is the call graph for this function:

◆ AddListBox()

wxListBox * ShuttleGuiBase::AddListBox ( const wxArrayStringEx choices)

Definition at line 752 of file ShuttleGui.cpp.

753{
754 UseUpId();
756 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListBox);
757 wxListBox * pListBox;
758 SetProportions( 1 );
759 mpWind = pListBox = safenew wxListBox(GetParent(), miId,
760 wxDefaultPosition, wxDefaultSize, choices, GetStyle(0));
761 pListBox->SetMinSize( wxSize( 120,150 ));
762 UpdateSizers();
763 return pListBox;
764}

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

Here is the call graph for this function:

◆ AddListControl()

wxListCtrl * ShuttleGuiBase::AddListControl ( std::initializer_list< const ListControlColumn columns = {},
long  listControlStyles = 0 
)

Definition at line 781 of file ShuttleGui.cpp.

785{
786 UseUpId();
788 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListCtrl);
789 wxListCtrl * pListCtrl;
790 SetProportions( 1 );
791 mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId,
792 wxDefaultPosition, wxDefaultSize, GetStyle( wxLC_ICON ));
793 pListCtrl->SetMinSize( wxSize( 120,150 ));
794 UpdateSizers();
795
796 DoInsertListColumns( pListCtrl, listControlStyles, columns );
797
798 return pListCtrl;
799}
void DoInsertListColumns(wxListCtrl *pListCtrl, long listControlStyles, std::initializer_list< const ListControlColumn > columns)
Definition: ShuttleGui.cpp:822

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

Here is the call graph for this function:

◆ AddListControlReportMode()

wxListCtrl * ShuttleGuiBase::AddListControlReportMode ( std::initializer_list< const ListControlColumn columns = {},
long  listControlStyles = 0 
)

Definition at line 801 of file ShuttleGui.cpp.

805{
806 UseUpId();
808 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxListCtrl);
809 wxListCtrl * pListCtrl;
810 SetProportions( 1 );
811 mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId,
812 wxDefaultPosition, wxSize(230,120),//wxDefaultSize,
813 GetStyle( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER ));
814// pListCtrl->SetMinSize( wxSize( 120,150 ));
815 UpdateSizers();
816
817 DoInsertListColumns( pListCtrl, listControlStyles, columns );
818
819 return pListCtrl;
820}

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

Here is the call graph for this function:

◆ AddNumericTextBox()

wxTextCtrl * ShuttleGuiBase::AddNumericTextBox ( const TranslatableString Caption,
const wxString &  Value,
const int  nChars 
)

Definition at line 673 of file ShuttleGui.cpp.

675{
676 const auto translated = Caption.Translation();
677 HandleOptionality( Caption );
678 AddPrompt( Caption );
679 UseUpId();
681 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
682 wxTextCtrl * pTextCtrl;
683 wxSize Size(wxDefaultSize);
684 if( nChars > 0 )
685 {
686 Size.SetWidth( nChars *5 );
687 }
688 miProp=0;
689
690#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
691 long flags = wxTE_RIGHT;
692#else
693 long flags = wxTE_LEFT;
694#endif
695
696 wxTextValidator Validator(wxFILTER_NUMERIC);
697 mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
698 wxDefaultPosition, Size, GetStyle( flags ),
699 Validator // It's OK to pass this. It will be cloned.
700 );
701#if wxUSE_ACCESSIBILITY
702 // so that name can be set on a standard control
703 mpWind->SetAccessible(safenew WindowAccessible(mpWind));
704#endif
705 mpWind->SetName(wxStripMenuCodes(translated));
706 UpdateSizers();
707 return pTextCtrl;
708}
A Validator is an object which checks whether a wxVariant satisfies a certain criterion....
Definition: Validators.h:53

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Referenced by DoTieNumericTextBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddPrompt()

void ShuttleGuiBase::AddPrompt ( const TranslatableString Prompt,
int  wrapWidth = 0 
)

Right aligned text string.

Definition at line 237 of file ShuttleGui.cpp.

238{
240 return;
241 //wxLogDebug( "Prompt: [%s] Id:%i (%i)", Prompt.c_str(), miId, miIdSetByUser ) ;
242 if( mpbOptionalFlag ){
243 bool * pVar = mpbOptionalFlag;
244 mpbOptionalFlag = nullptr;
245 TieCheckBox( {}, *pVar);
246 //return;
247 }
248 if( Prompt.empty() )
249 return;
250 miProp=1;
251 const auto translated = Prompt.Translation();
252 auto text = safenew wxStaticText(GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
253 GetStyle( wxALIGN_RIGHT ));
254 mpWind = text;
255 if (wrapWidth > 0)
256 text->Wrap(wrapWidth);
257 mpWind->SetName(wxStripMenuCodes(translated)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
258 UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL, true );
259}
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)

References eIsCreating, TranslatableString::empty(), GetParent(), GetStyle(), miProp, mpbOptionalFlag, mpWind, mShuttleMode, safenew, TieCheckBox(), TranslatableString::Translation(), and UpdateSizersCore().

Referenced by AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddNumericTextBox(), AddReadOnlyText(), AddSlider(), AddSpinCtrl(), and AddTextBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddRadioButton()

wxRadioButton * ShuttleGuiBase::AddRadioButton ( const TranslatableString Prompt,
int  selector = 0,
int  initValue = 0 
)

Definition at line 567 of file ShuttleGui.cpp.

569{
570 return DoAddRadioButton( Prompt, wxRB_GROUP, selector, initValue );
571}
wxRadioButton * DoAddRadioButton(const TranslatableString &Prompt, int style, int selector, int initValue)
Unwrapped string value.
Definition: ShuttleGui.cpp:547

References DoAddRadioButton().

Here is the call graph for this function:

◆ AddRadioButtonToGroup()

wxRadioButton * ShuttleGuiBase::AddRadioButtonToGroup ( const TranslatableString Prompt,
int  selector = 1,
int  initValue = 0 
)

Definition at line 573 of file ShuttleGui.cpp.

575{
576 return DoAddRadioButton( Prompt, 0, selector, initValue );
577}

References DoAddRadioButton().

Here is the call graph for this function:

◆ AddReadOnlyText()

ReadOnlyText * ShuttleGuiBase::AddReadOnlyText ( const TranslatableString Caption,
const wxString &  Value 
)

Definition at line 495 of file ShuttleGui.cpp.

497{
498 const auto translated = Caption.Translation();
499 auto style = GetStyle( wxBORDER_NONE );
500 HandleOptionality( Caption );
501 mItem.miStyle = wxALIGN_CENTER_VERTICAL;
502 AddPrompt( Caption );
503 UseUpId();
505 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), ReadOnlyText);
506 ReadOnlyText * pReadOnlyText;
507 miProp=0;
508
509 mpWind = pReadOnlyText = safenew ReadOnlyText(GetParent(), miId, Value,
510 wxDefaultPosition, wxDefaultSize, GetStyle( style ));
511 mpWind->SetName(wxStripMenuCodes(translated));
512 UpdateSizers();
513 return pReadOnlyText;
514}
DialogDefinition::Item mItem
Definition: ShuttleGui.h:577

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, DialogDefinition::Item::miStyle, mItem, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Here is the call graph for this function:

◆ AddSlider()

wxSlider * ShuttleGuiBase::AddSlider ( const TranslatableString Prompt,
int  pos,
int  Max,
int  Min = 0 
)

Definition at line 588 of file ShuttleGui.cpp.

590{
591 HandleOptionality( Prompt );
592 AddPrompt( Prompt );
593 UseUpId();
595 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSlider);
596 wxSlider * pSlider;
598 pos, Min, Max,
599 wxDefaultPosition,
600 // Bug2289: On Linux at least, sliders like to be constructed with the
601 // proper size, not reassigned size later
602 ( ( mItem.mWindowSize == wxSize{} ) ? wxDefaultSize : mItem.mWindowSize ),
603 GetStyle( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS )
604 );
605#if wxUSE_ACCESSIBILITY
606 // so that name can be set on a standard control
607 mpWind->SetAccessible(safenew WindowAccessible(mpWind));
608#endif
609 mpWind->SetName(wxStripMenuCodes(Prompt.Translation()));
610 miProp=1;
611 UpdateSizers();
612 return pSlider;
613}

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mItem, mpDlg, mpWind, mShuttleMode, DialogDefinition::Item::mWindowSize, safenew, TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Referenced by DoTieSlider().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddSpinCtrl()

wxSpinCtrl * ShuttleGuiBase::AddSpinCtrl ( const TranslatableString Prompt,
int  Value,
int  Max,
int  Min 
)

Definition at line 615 of file ShuttleGui.cpp.

617{
618 const auto translated = Prompt.Translation();
619 HandleOptionality( Prompt );
620 AddPrompt( Prompt );
621 UseUpId();
623 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSpinCtrl);
624 wxSpinCtrl * pSpinCtrl;
625 mpWind = pSpinCtrl = safenew wxSpinCtrl(GetParent(), miId,
626 wxEmptyString,
627 wxDefaultPosition, wxDefaultSize,
628 GetStyle( wxSP_VERTICAL | wxSP_ARROW_KEYS ),
629 Min, Max, Value
630 );
631 mpWind->SetName(wxStripMenuCodes(translated));
632 miProp=1;
633 UpdateSizers();
634 return pSpinCtrl;
635}

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Referenced by DoTieSpinCtrl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddTextBox()

wxTextCtrl * ShuttleGuiBase::AddTextBox ( const TranslatableString Caption,
const wxString &  Value,
const int  nChars 
)

Definition at line 637 of file ShuttleGui.cpp.

639{
640 const auto translated = Caption.Translation();
641 HandleOptionality( Caption );
642 AddPrompt( Caption );
643 UseUpId();
645 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
646 wxTextCtrl * pTextCtrl;
647 wxSize Size(wxDefaultSize);
648 if( nChars > 0 )
649 {
650 int width;
651 mpDlg->GetTextExtent( wxT("9"), &width, nullptr );
652 Size.SetWidth( nChars * width );
653 }
654 miProp=0;
655
656#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
657 long flags = wxTE_RIGHT;
658#else
659 long flags = wxTE_LEFT;
660#endif
661
662 mpWind = pTextCtrl = safenew wxTextCtrlWrapper(GetParent(), miId, Value,
663 wxDefaultPosition, Size, GetStyle( flags ));
664#if wxUSE_ACCESSIBILITY
665 // so that name can be set on a standard control
666 mpWind->SetAccessible(safenew WindowAccessible(mpWind));
667#endif
668 mpWind->SetName(wxStripMenuCodes(translated));
669 UpdateSizers();
670 return pTextCtrl;
671}

References AddPrompt(), eIsCreating, GetParent(), GetStyle(), HandleOptionality(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), UseUpId(), and wxT().

Referenced by DoTieTextBox(), and ErrorReportDialog::ErrorReportDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddTextWindow()

wxTextCtrl * ShuttleGuiBase::AddTextWindow ( const wxString &  Value)

Multiline text box that grows.

Definition at line 711 of file ShuttleGui.cpp.

712{
713 UseUpId();
715 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
716 wxTextCtrl * pTextCtrl;
717 SetProportions( 1 );
718 mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
719 wxDefaultPosition, wxDefaultSize, GetStyle( wxTE_MULTILINE ));
720#if wxUSE_ACCESSIBILITY
721 // so that name can be set on a standard control
722 mpWind->SetAccessible(safenew WindowAccessible(mpWind));
723#endif
724 UpdateSizers();
725 // Start off at start of window...
726 pTextCtrl->SetInsertionPoint( 0 );
727 pTextCtrl->ShowPosition( 0 );
728 return pTextCtrl;
729}

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

Referenced by ErrorDialog::ErrorDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddTitle()

void ShuttleGuiBase::AddTitle ( const TranslatableString Prompt,
int  wrapWidth = 0 
)

Centred text string.

Definition at line 280 of file ShuttleGui.cpp.

281{
282 if( Prompt.empty() )
283 return;
285 return;
286 const auto translated = Prompt.Translation();
287 auto text = safenew wxStaticText(GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
288 GetStyle( wxALIGN_CENTRE ));
289 mpWind = text;
290 if (wrapWidth > 0)
291 text->Wrap(wrapWidth);
292 mpWind->SetName(translated); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
293 UpdateSizers();
294}

References eIsCreating, TranslatableString::empty(), GetParent(), GetStyle(), mpWind, mShuttleMode, safenew, TranslatableString::Translation(), and UpdateSizers().

Here is the call graph for this function:

◆ AddTree()

wxTreeCtrl * ShuttleGuiBase::AddTree ( )

Definition at line 853 of file ShuttleGui.cpp.

854{
855 UseUpId();
857 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTreeCtrl);
858 wxTreeCtrl * pTreeCtrl;
859 SetProportions( 1 );
860 mpWind = pTreeCtrl = safenew wxTreeCtrl(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
861 GetStyle( wxTR_HAS_BUTTONS ));
862 pTreeCtrl->SetMinSize( wxSize( 120,650 ));
863 UpdateSizers();
864 return pTreeCtrl;
865}

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

Here is the call graph for this function:

◆ AddUnits()

void ShuttleGuiBase::AddUnits ( const TranslatableString Prompt,
int  wrapWidth = 0 
)

Left aligned text string.

Definition at line 262 of file ShuttleGui.cpp.

263{
264 if( Prompt.empty() )
265 return;
267 return;
268 miProp = 1;
269 const auto translated = Prompt.Translation();
270 auto text = safenew wxStaticText(GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
271 GetStyle( wxALIGN_LEFT ));
272 mpWind = text;
273 if (wrapWidth > 0)
274 text->Wrap(wrapWidth);
275 mpWind->SetName(translated); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
276 UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL );
277}

References eIsCreating, TranslatableString::empty(), GetParent(), GetStyle(), miProp, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), and UpdateSizersCore().

Here is the call graph for this function:

◆ AddVariableText()

wxStaticText * ShuttleGuiBase::AddVariableText ( const TranslatableString Str,
bool  bCenter = false,
int  PositionFlags = 0,
int  wrapWidth = 0 
)

Definition at line 462 of file ShuttleGui.cpp.

465{
466 const auto translated = Str.Translation();
467 UseUpId();
469 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxStaticText);
470
471 wxStaticText *pStatic;
472 auto text = pStatic = safenew wxStaticText(GetParent(), miId, translated,
473 wxDefaultPosition, wxDefaultSize,
474 GetStyle( wxALIGN_LEFT ));
475 mpWind = text;
476 if ( wrapWidth > 0 )
477 text->Wrap( wrapWidth );
478 mpWind->SetName(wxStripMenuCodes(translated)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
479 if( bCenter )
480 {
481 miProp=1;
482 if( PositionFlags )
483 UpdateSizersCore( false, PositionFlags );
484 else
486 }
487 else
488 if( PositionFlags )
489 UpdateSizersCore( false, PositionFlags );
490 else
491 UpdateSizers();
492 return pStatic;
493}

References eIsCreating, GetParent(), GetStyle(), miId, miProp, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), UpdateSizersC(), UpdateSizersCore(), and UseUpId().

Referenced by ErrorReportDialog::ErrorReportDialog(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddVSlider()

wxSlider * ShuttleGuiBase::AddVSlider ( const TranslatableString Prompt,
int  pos,
int  Max 
)

◆ AddWindow()

wxWindow * ShuttleGuiBase::AddWindow ( wxWindow *  pWindow,
int  PositionFlags = wxALIGN_CENTRE 
)

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

Definition at line 298 of file ShuttleGui.cpp.

299{
301 return pWindow;
302 mpWind = pWindow;
303 SetProportions( 0 );
304 UpdateSizersCore(false, PositionFlags | wxALL);
305 return pWindow;
306}

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

Referenced by cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ApplyItem()

void ShuttleGuiBase::ApplyItem ( int  step,
const DialogDefinition::Item item,
wxWindow *  pWind,
wxWindow *  pDlg 
)
static

Definition at line 2083 of file ShuttleGui.cpp.

2085{
2086 if ( step == 0 ) {
2087 // Do these steps before adding the window to the sizer
2088 if( item.mUseBestSize )
2089 pWind->SetMinSize( pWind->GetBestSize() );
2090 else if( item.mHasMinSize )
2091 pWind->SetMinSize( item.mMinSize );
2092
2093 if ( item.mWindowSize != wxSize{} )
2094 pWind->SetSize( item.mWindowSize );
2095 }
2096 else if ( step == 1) {
2097 // Apply certain other optional window attributes here
2098
2099 if ( item.mValidatorSetter )
2100 item.mValidatorSetter( pWind );
2101
2102 if ( !item.mToolTip.empty() )
2103 pWind->SetToolTip( item.mToolTip.Translation() );
2104
2105 if ( !item.mName.empty() ) {
2106 pWind->SetName( item.mName.Stripped().Translation() );
2107#ifndef __WXMAC__
2108 if (auto pButton = dynamic_cast< wxBitmapButton* >( pWind ))
2109 pButton->SetLabel( item.mName.Translation() );
2110#endif
2111 }
2112
2113 if ( !item.mNameSuffix.empty() )
2114 pWind->SetName(
2115 pWind->GetName() + " " + item.mNameSuffix.Translation() );
2116
2117 if (item.mFocused)
2118 pWind->SetFocus();
2119
2120 if (item.mDisabled)
2121 pWind->Enable( false );
2122
2123 for (auto &pair : item.mRootConnections)
2124 pWind->Connect( pair.first, pair.second, nullptr, pDlg );
2125 }
2126}
std::function< void(wxWindow *) > mValidatorSetter
Definition: ShuttleGui.h:214
std::vector< std::pair< wxEventType, wxObjectEventFunction > > mRootConnections
Definition: ShuttleGui.h:219
TranslatableString mToolTip
Definition: ShuttleGui.h:215
TranslatableString mName
Definition: ShuttleGui.h:216
TranslatableString mNameSuffix
Definition: ShuttleGui.h:217

References TranslatableString::empty(), DialogDefinition::Item::mDisabled, DialogDefinition::Item::mFocused, DialogDefinition::Item::mHasMinSize, DialogDefinition::Item::mMinSize, DialogDefinition::Item::mName, DialogDefinition::Item::mNameSuffix, DialogDefinition::Item::mRootConnections, DialogDefinition::Item::mToolTip, DialogDefinition::Item::mUseBestSize, DialogDefinition::Item::mValidatorSetter, DialogDefinition::Item::mWindowSize, TranslatableString::Stripped(), and TranslatableString::Translation().

Referenced by UpdateSizersCore().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoAddRadioButton()

wxRadioButton * ShuttleGuiBase::DoAddRadioButton ( const TranslatableString Prompt,
int  style,
int  selector,
int  initValue 
)
private

Unwrapped string value.

Todo:
This function and the next two, suitably adapted, could be used by TieRadioButton.

Definition at line 547 of file ShuttleGui.cpp.

549{
550 const auto translated = Prompt.Translation();
553 UseUpId();
555 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton);
556 wxRadioButton * pRad;
557 mpWind = pRad = safenew wxRadioButton(GetParent(), miId, translated,
558 wxDefaultPosition, wxDefaultSize, GetStyle( style ) );
559 mpWind->SetName(wxStripMenuCodes(translated));
560 if ( style )
561 pRad->SetValue( true );
562 UpdateSizers();
563 pRad->SetValue( selector == initValue );
564 return pRad;
565}

References eIsCreating, GetParent(), GetStyle(), miId, mpDlg, mpWind, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), and UseUpId().

Referenced by AddRadioButton(), and AddRadioButtonToGroup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoDataShuttle()

void ShuttleGuiBase::DoDataShuttle ( const wxString &  Name,
WrappedType WrappedRef 
)
private

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

Definition at line 1246 of file ShuttleGui.cpp.

1247{
1248 wxASSERT( mpShuttle );
1249 mpShuttle->TransferWrappedType( Name, WrappedRef );
1250}
std::unique_ptr< ShuttlePrefs > mpShuttle
Definition: ShuttleGui.h:528

References mpShuttle.

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

Here is the caller graph for this function:

◆ DoInsertListColumns()

void ShuttleGuiBase::DoInsertListColumns ( wxListCtrl *  pListCtrl,
long  listControlStyles,
std::initializer_list< const ListControlColumn columns 
)
private

Definition at line 822 of file ShuttleGui.cpp.

826{
827 // Old comment from HistoryWindow.cpp follows
828 // -- is it still correct for wxWidgets 3?
829
830 // Do this BEFORE inserting the columns. On the Mac at least, the
831 // columns are deleted and later InsertItem()s will cause Audacity to crash.
832 for ( auto style = 1l; style <= listControlStyles; style <<= 1 )
833 if ( (style & listControlStyles) )
834 pListCtrl->SetSingleStyle(style, true);
835
836 long iCol = 0;
837 bool dummyColumn =
838 columns.size() > 0 && begin(columns)->format == wxLIST_FORMAT_RIGHT;
839
840 //A dummy first column, which is then deleted, is a workaround -
841 // under Windows the first column can't be right aligned.
842 if (dummyColumn)
843 pListCtrl->InsertColumn( iCol++, wxString{} );
844
845 for (auto &column : columns)
846 pListCtrl->InsertColumn(
847 iCol++, column.heading.Translation(), column.format, column.width );
848
849 if (dummyColumn)
850 pListCtrl->DeleteColumn( 0 );
851}
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:150

References PackedArray::begin().

Referenced by AddListControl(), and AddListControlReportMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoStep()

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 );
void DoDataShuttle(const wxString &Name, WrappedType &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();
bool DoStep(int iStep)

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 will need to renumber the steps.

Definition at line 1816 of file ShuttleGui.cpp.

1817{
1818 // Get value and create
1819 if( mShuttleMode == eIsCreating )
1820 {
1821 return (iStep==1) || (iStep==2);
1822 }
1823 // Like creating, get the value and set.
1825 {
1826 return (iStep==1) || (iStep==2);
1827 }
1829 {
1830 return (iStep==2) || (iStep==3);
1831 }
1833 return iStep ==2;
1834 wxASSERT( false );
1835 return false;
1836}
@ eIsSettingToDialog
Definition: ShuttleGui.h:39
@ eIsGettingFromDialog
Definition: ShuttleGui.h:38
@ eIsGettingMetadata
Definition: ShuttleGui.h:40

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

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

Here is the caller graph for this function:

◆ DoTieCheckBox()

wxCheckBox * ShuttleGuiBase::DoTieCheckBox ( const TranslatableString Prompt,
WrappedType WrappedRef 
)
private

Definition at line 1258 of file ShuttleGui.cpp.

1259{
1260 HandleOptionality( Prompt );
1261 // The Add function does a UseUpId(), so don't do it here in that case.
1262 if( mShuttleMode == eIsCreating )
1263 return AddCheckBox( Prompt, WrappedRef.ReadAsString() == wxT("true"));
1264
1265 UseUpId();
1266
1267 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1268 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1269
1270 switch( mShuttleMode )
1271 {
1272 // IF setting internal storage from the controls.
1273 case eIsGettingMetadata:
1274 break;
1276 {
1277 wxASSERT( pCheckBox );
1278 WrappedRef.WriteToAsBool( pCheckBox->GetValue() );
1279 }
1280 break;
1281 case eIsSettingToDialog:
1282 {
1283 wxASSERT( pCheckBox );
1284 pCheckBox->SetValue( WrappedRef.ReadAsBool() );
1285 }
1286 break;
1287 default:
1288 wxASSERT( false );
1289 break;
1290 }
1291 return pCheckBox;
1292}
wxCheckBox * AddCheckBox(const TranslatableString &Prompt, bool Selected)
Definition: ShuttleGui.cpp:308
bool ReadAsBool()
void WriteToAsBool(const bool InBool)
wxString ReadAsString()
Definition: WrappedType.cpp:41

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

Referenced by TieCheckBox(), and TieCheckBoxOnRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTieCheckBoxOnRight()

wxCheckBox * ShuttleGuiBase::DoTieCheckBoxOnRight ( const TranslatableString Prompt,
WrappedType WrappedRef 
)
private

Definition at line 1294 of file ShuttleGui.cpp.

1295{
1296 HandleOptionality( Prompt );
1297 // The Add function does a UseUpId(), so don't do it here in that case.
1298 if( mShuttleMode == eIsCreating )
1299 return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() == wxT("true"));
1300
1301 UseUpId();
1302
1303 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1304 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1305
1306 switch( mShuttleMode )
1307 {
1308 // IF setting internal storage from the controls.
1309 case eIsGettingMetadata:
1310 break;
1312 {
1313 wxASSERT( pCheckBox );
1314 WrappedRef.WriteToAsBool( pCheckBox->GetValue() );
1315 }
1316 break;
1317 case eIsSettingToDialog:
1318 {
1319 wxASSERT( pCheckBox );
1320 pCheckBox->SetValue( WrappedRef.ReadAsBool() );
1321 }
1322 break;
1323 default:
1324 wxASSERT( false );
1325 break;
1326 }
1327 return pCheckBox;
1328}
wxCheckBox * AddCheckBoxOnRight(const TranslatableString &Prompt, bool Selected)
Definition: ShuttleGui.cpp:342

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

Referenced by TieCheckBoxOnRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTieNumericTextBox()

wxTextCtrl * ShuttleGuiBase::DoTieNumericTextBox ( const TranslatableString Prompt,
WrappedType WrappedRef,
const int  nChars 
)
private

Definition at line 1407 of file ShuttleGui.cpp.

1409{
1410 HandleOptionality( Prompt );
1411 // The Add function does a UseUpId(), so don't do it here in that case.
1412 if( mShuttleMode == eIsCreating )
1413 return AddNumericTextBox( Prompt, WrappedRef.ReadAsString(), nChars );
1414
1415 UseUpId();
1416 wxTextCtrl * pTextBox=NULL;
1417
1418 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1419 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1420
1421 switch( mShuttleMode )
1422 {
1423 // IF setting internal storage from the controls.
1424 case eIsGettingMetadata:
1425 break;
1427 {
1428 wxASSERT( pTextBox );
1429 WrappedRef.WriteToAsString( pTextBox->GetValue() );
1430 }
1431 break;
1432 case eIsSettingToDialog:
1433 {
1434 wxASSERT( pTextBox );
1435 pTextBox->SetValue( WrappedRef.ReadAsString() );
1436 }
1437 break;
1438 default:
1439 wxASSERT( false );
1440 break;
1441 }
1442 return pTextBox;
1443}
wxTextCtrl * AddNumericTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:673
void WriteToAsString(const wxString &InStr)

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

Referenced by TieIntegerTextBox(), and TieNumericTextBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTieSlider()

wxSlider * ShuttleGuiBase::DoTieSlider ( const TranslatableString Prompt,
WrappedType WrappedRef,
const int  max,
const int  min = 0 
)
private

Definition at line 1445 of file ShuttleGui.cpp.

1448{
1449 HandleOptionality( Prompt );
1450 // The Add function does a UseUpId(), so don't do it here in that case.
1451 if( mShuttleMode != eIsCreating )
1452 UseUpId();
1453 wxSlider * pSlider=NULL;
1454 switch( mShuttleMode )
1455 {
1456 case eIsCreating:
1457 {
1458 pSlider = AddSlider( Prompt, WrappedRef.ReadAsInt(), max, min );
1459 }
1460 break;
1461 // IF setting internal storage from the controls.
1462 case eIsGettingMetadata:
1463 break;
1465 {
1466 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1467 pSlider = wxDynamicCast(pWnd, wxSlider);
1468 wxASSERT( pSlider );
1469 WrappedRef.WriteToAsInt( pSlider->GetValue() );
1470 }
1471 break;
1472 case eIsSettingToDialog:
1473 {
1474 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1475 pSlider = wxDynamicCast(pWnd, wxSlider);
1476 wxASSERT( pSlider );
1477 pSlider->SetValue( WrappedRef.ReadAsInt() );
1478 }
1479 break;
1480 default:
1481 wxASSERT( false );
1482 break;
1483 }
1484 return pSlider;
1485}
int min(int a, int b)
wxSlider * AddSlider(const TranslatableString &Prompt, int pos, int Max, int Min=0)
Definition: ShuttleGui.cpp:588
void WriteToAsInt(const int InInt)
int ReadAsInt()
Definition: WrappedType.cpp:67

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

Referenced by TieSlider().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTieSpinCtrl()

wxSpinCtrl * ShuttleGuiBase::DoTieSpinCtrl ( const TranslatableString Prompt,
WrappedType WrappedRef,
const int  max,
const int  min = 0 
)
private

Definition at line 1330 of file ShuttleGui.cpp.

1333{
1334 HandleOptionality( Prompt );
1335 // The Add function does a UseUpId(), so don't do it here in that case.
1336 if( mShuttleMode == eIsCreating )
1337 return AddSpinCtrl( Prompt, WrappedRef.ReadAsInt(), max, min );
1338
1339 UseUpId();
1340 wxSpinCtrl * pSpinCtrl=NULL;
1341
1342 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1343 pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1344
1345 switch( mShuttleMode )
1346 {
1347 // IF setting internal storage from the controls.
1348 case eIsGettingMetadata:
1349 break;
1351 {
1352 wxASSERT( pSpinCtrl );
1353 WrappedRef.WriteToAsInt( pSpinCtrl->GetValue() );
1354 }
1355 break;
1356 case eIsSettingToDialog:
1357 {
1358 wxASSERT( pSpinCtrl );
1359 pSpinCtrl->SetValue( WrappedRef.ReadAsInt() );
1360 }
1361 break;
1362 default:
1363 wxASSERT( false );
1364 break;
1365 }
1366 return pSpinCtrl;
1367}
wxSpinCtrl * AddSpinCtrl(const TranslatableString &Prompt, int Value, int Max, int Min)
Definition: ShuttleGui.cpp:615

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

Referenced by TieSpinCtrl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTieTextBox()

wxTextCtrl * ShuttleGuiBase::DoTieTextBox ( const TranslatableString Prompt,
WrappedType WrappedRef,
const int  nChars 
)
private

Definition at line 1369 of file ShuttleGui.cpp.

1371{
1372 HandleOptionality( Prompt );
1373 // The Add function does a UseUpId(), so don't do it here in that case.
1374 if( mShuttleMode == eIsCreating )
1375 return AddTextBox( Prompt, WrappedRef.ReadAsString(), nChars );
1376
1377 UseUpId();
1378 wxTextCtrl * pTextBox=NULL;
1379
1380 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1381 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1382
1383 switch( mShuttleMode )
1384 {
1385 // IF setting internal storage from the controls.
1386 case eIsGettingMetadata:
1387 break;
1389 {
1390 wxASSERT( pTextBox );
1391 WrappedRef.WriteToAsString( pTextBox->GetValue() );
1392 }
1393 break;
1394 case eIsSettingToDialog:
1395 {
1396 wxASSERT( pTextBox );
1397 pTextBox->SetValue( WrappedRef.ReadAsString() );
1398 }
1399 break;
1400 default:
1401 wxASSERT( false );
1402 break;
1403 }
1404 return pTextBox;
1405}
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:637

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

Referenced by TieTextBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndHorizontalLay()

void ShuttleGuiBase::EndHorizontalLay ( )

Definition at line 1176 of file ShuttleGui.cpp.

1177{
1178 if( mShuttleMode != eIsCreating )
1179 return;
1180 PopSizer();
1181}

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by cloud::audiocom::ShareAudioDialog::Populate(), and cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndInvisiblePanel()

void ShuttleGuiBase::EndInvisiblePanel ( )

Definition at line 1154 of file ShuttleGui.cpp.

1155{
1156 EndPanel();
1157}

References EndPanel().

Referenced by cloud::audiocom::ShareAudioDialog::Populate(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndMultiColumn()

void ShuttleGuiBase::EndMultiColumn ( )

Definition at line 1237 of file ShuttleGui.cpp.

1238{
1239 if( mShuttleMode != eIsCreating )
1240 return;
1241 PopSizer();
1242}

References eIsCreating, mShuttleMode, and PopSizer().

Here is the call graph for this function:

◆ EndNotebook()

void ShuttleGuiBase::EndNotebook ( )

Definition at line 1039 of file ShuttleGui.cpp.

1040{
1041 //PopSizer();
1042 mpParent = mpParent->GetParent();
1043}

References mpParent.

◆ EndNotebookPage()

void ShuttleGuiBase::EndNotebookPage ( )

Definition at line 1090 of file ShuttleGui.cpp.

1091{
1092 if( mShuttleMode != eIsCreating )
1093 return;
1094 PopSizer();
1095 mpParent = mpParent->GetParent();
1096}

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

Here is the call graph for this function:

◆ EndPanel()

void ShuttleGuiBase::EndPanel ( )

Definition at line 1017 of file ShuttleGui.cpp.

1018{
1019 if( mShuttleMode != eIsCreating )
1020 return;
1021 PopSizer();
1022 mpParent = mpParent->GetParent();
1023}

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

Referenced by EndInvisiblePanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndRadioButtonGroup()

void ShuttleGuiBase::EndRadioButtonGroup ( )

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

Definition at line 1611 of file ShuttleGui.cpp.

1612{
1613 // too few buttons?
1614 wxASSERT( mRadioCount == mRadioSymbols.size() );
1615
1618 mRadioValue.reset();// Clear it out...
1619 mRadioSettingName = wxT("");
1620 mRadioCount = -1; // So we detect a problem.
1621 mRadioSymbols = {};
1622}
std::vector< EnumValueSymbol > mRadioSymbols
Definition: ShuttleGui.h:568
std::optional< WrappedType > mRadioValue
The setting controlled by a group.
Definition: ShuttleGui.h:570
wxString mRadioSettingName
Definition: ShuttleGui.h:569
int mRadioCount
The wrapped value associated with the active radio button.
Definition: ShuttleGui.h:571

References DoDataShuttle(), eIsGettingFromDialog, mRadioCount, mRadioSettingName, mRadioSymbols, mRadioValue, mShuttleMode, and wxT().

Here is the call graph for this function:

◆ EndScroller()

void ShuttleGuiBase::EndScroller ( )

Definition at line 970 of file ShuttleGui.cpp.

971{
973 return;
974 wxSize ScrollSize = mpSizer->GetMinSize();
975 int yMin = ScrollSize.y+4;
976 int xMin = ScrollSize.x+4;
977 if( yMin > 400)
978 {
979 yMin = 400;
980 xMin+=50;// extra space for vertical scrollbar.
981 }
982
983 mpParent->SetMinSize( wxSize(xMin, yMin) );
984
985 PopSizer();
986 mpParent = mpParent->GetParent();
987}
wxSizer * mpSizer
Definition: ShuttleGui.h:549

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

Here is the call graph for this function:

◆ EndSimplebook()

void ShuttleGuiBase::EndSimplebook ( )

Definition at line 1060 of file ShuttleGui.cpp.

1061{
1062 //PopSizer();
1063 mpParent = mpParent->GetParent();
1064}

References mpParent.

◆ EndStatic()

void ShuttleGuiBase::EndStatic ( )

Definition at line 921 of file ShuttleGui.cpp.

922{
924 return;
925 PopSizer();
926 mpParent = mpParent->GetParent();
927}

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

Here is the call graph for this function:

◆ EndThreeColumn()

void ShuttleGuiBase::EndThreeColumn ( )
inline

Definition at line 367 of file ShuttleGui.h.

367{EndMultiColumn();};
void EndMultiColumn()

◆ EndTwoColumn()

void ShuttleGuiBase::EndTwoColumn ( )
inline

Definition at line 365 of file ShuttleGui.h.

365{EndMultiColumn();};

◆ EndVerticalLay()

void ShuttleGuiBase::EndVerticalLay ( )

Definition at line 1202 of file ShuttleGui.cpp.

1203{
1204 if( mShuttleMode != eIsCreating )
1205 return;
1206 PopSizer();
1207}

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by ShuttleGui::AddStandardButtons(), ErrorReportDialog::ErrorReportDialog(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndWrapLay()

void ShuttleGuiBase::EndWrapLay ( )

Definition at line 1220 of file ShuttleGui.cpp.

1221{
1223 return;
1224
1225 PopSizer();
1226}

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBorder()

int ShuttleGuiBase::GetBorder ( ) const
noexcept

Definition at line 195 of file ShuttleGui.cpp.

196{
197 return miBorder;
198}

References miBorder.

◆ GetParent()

wxWindow * ShuttleGuiBase::GetParent ( )
inline

◆ GetSizer()

wxSizer * ShuttleGuiBase::GetSizer ( )
inline

Definition at line 501 of file ShuttleGui.h.

501{return mpSizer;}

◆ GetStyle()

long ShuttleGuiBase::GetStyle ( long  Style)
protected

Definition at line 2209 of file ShuttleGui.cpp.

2210{
2211 if( mItem.miStyle )
2212 style = mItem.miStyle;
2213 mItem.miStyle = 0;
2214 return style;
2215}

References DialogDefinition::Item::miStyle, and mItem.

Referenced by AddBitmapButton(), AddButton(), AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddFixedText(), AddGrid(), AddIcon(), AddListBox(), AddListControl(), AddListControlReportMode(), AddNumericTextBox(), AddPrompt(), AddReadOnlyText(), AddSlider(), AddSpinCtrl(), AddTextBox(), AddTextWindow(), AddTitle(), AddTree(), AddUnits(), AddVariableText(), DoAddRadioButton(), StartNotebook(), StartPanel(), StartScroller(), and StartSimplebook().

Here is the caller graph for this function:

◆ HandleOptionality()

void ShuttleGuiBase::HandleOptionality ( const TranslatableString Prompt)

Definition at line 223 of file ShuttleGui.cpp.

224{
225 // If creating, will be handled by an AddPrompt.
227 return;
228 //wxLogDebug( "Optionality: [%s] Id:%i (%i)", Prompt.c_str(), miId, miIdSetByUser ) ;
229 if( mpbOptionalFlag ){
230 bool * pVar = mpbOptionalFlag;
231 mpbOptionalFlag = nullptr;
232 TieCheckBox( Prompt, *pVar);
233 }
234}

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

Referenced by AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddNumericTextBox(), AddReadOnlyText(), AddSlider(), AddSpinCtrl(), AddTextBox(), DoTieCheckBox(), DoTieCheckBoxOnRight(), DoTieNumericTextBox(), DoTieSlider(), DoTieSpinCtrl(), DoTieTextBox(), and TieChoice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

void ShuttleGuiBase::Init ( bool  vertical,
wxSize  minSize 
)

Definition at line 142 of file ShuttleGui.cpp.

143{
144 mpShuttle = NULL;
145 mpSizer = NULL;
146 mpWind = NULL;
147 mpSubSizer = NULL;
148
150 mRadioCount = -1;
151
152 miBorder = 5;
153 miProp=0;
155 miSizerProp=0;
156 mSizerDepth=-1;
157
158 ResetId();
159
161
163 return;
164
165 mpSizer = mpParent->GetSizer();
166
167#if 0
168 if( mpSizer == NULL )
169 {
170 wxWindow * pGrandParent = mpParent->GetParent();
171 if( pGrandParent )
172 {
173 mpSizer = pGrandParent->GetSizer();
174 }
175 }
176#endif
177
178 if( !mpSizer )
179 {
180 mpParent->SetSizer(
181 mpSizer = safenew wxBoxSizer(vertical ? wxVERTICAL : wxHORIZONTAL));
182 }
183 PushSizer();
184 mpSizer->SetMinSize(minSize);
185}
int miNoMatchSelector
Definition: ShuttleGui.h:530
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:548

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopSizer()

void ShuttleGuiBase::PopSizer ( )
protected

Definition at line 2195 of file ShuttleGui.cpp.

2196{
2197 mSizerDepth--;
2198 wxASSERT( mSizerDepth >=0 );
2200}
wxSizer * pSizerStack[nMaxNestedSizers]
Definition: ShuttleGui.h:526

References mpSizer, mSizerDepth, and pSizerStack.

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

Here is the caller graph for this function:

◆ Prop()

ShuttleGuiBase & ShuttleGuiBase::Prop ( int  iProp)

Definition at line 881 of file ShuttleGui.cpp.

882{
883 miPropSetByUser = iProp;
884 return *this;
885}

References miPropSetByUser.

Referenced by ShuttleGui::Prop().

Here is the caller graph for this function:

◆ PushSizer()

void ShuttleGuiBase::PushSizer ( )
protected

Definition at line 2202 of file ShuttleGui.cpp.

2203{
2204 mSizerDepth++;
2205 wxASSERT( mSizerDepth < nMaxNestedSizers );
2207}
const int nMaxNestedSizers
Definition: ShuttleGui.h:33

References mpSizer, mSizerDepth, nMaxNestedSizers, and pSizerStack.

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

Here is the caller graph for this function:

◆ ResetId()

void ShuttleGuiBase::ResetId ( )

Definition at line 187 of file ShuttleGui.cpp.

188{
189 miIdSetByUser = -1;
190 miId = -1;
191 miIdNext = 3000;
192}

References miId, miIdNext, and miIdSetByUser.

Referenced by Init().

Here is the caller graph for this function:

◆ SetBorder()

void ShuttleGuiBase::SetBorder ( int  Border)
inline

Definition at line 484 of file ShuttleGui.h.

484{miBorder = Border;};

Referenced by cloud::audiocom::ShareAudioDialog::Populate(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the caller graph for this function:

◆ SetProportions()

void ShuttleGuiBase::SetProportions ( int  Default)
protected

Definition at line 2071 of file ShuttleGui.cpp.

2072{
2073 if( miPropSetByUser >=0 )
2074 {
2076 miPropSetByUser =-1;
2077 return;
2078 }
2079 miProp = Default;
2080}
NumericFormatSymbol Default(const NumericConverterType &type)
Returns the default format for the type or empty symbol, if no default symbol is registered.

References NumericConverterFormats::Default(), miProp, and miPropSetByUser.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSizerProportion()

void ShuttleGuiBase::SetSizerProportion ( int  iProp)
inline

Definition at line 486 of file ShuttleGui.h.

486{miSizerProp = iProp;};

◆ SetStretchyCol()

void ShuttleGuiBase::SetStretchyCol ( int  i)

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

Definition at line 201 of file ShuttleGui.cpp.

202{
204 return;
205 wxFlexGridSizer *pSizer = wxDynamicCast(mpSizer, wxFlexGridSizer);
206 wxASSERT( pSizer );
207 pSizer->AddGrowableCol( i, 1 );
208}

References eIsCreating, mpSizer, and mShuttleMode.

◆ SetStretchyRow()

void ShuttleGuiBase::SetStretchyRow ( int  i)

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

Definition at line 211 of file ShuttleGui.cpp.

212{
214 return;
215 wxFlexGridSizer *pSizer = wxDynamicCast(mpSizer, wxFlexGridSizer);
216 wxASSERT( pSizer );
217 pSizer->AddGrowableRow( i, 1 );
218}

References eIsCreating, mpSizer, and mShuttleMode.

◆ StartHorizontalLay()

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 1166 of file ShuttleGui.cpp.

1167{
1168 if( mShuttleMode != eIsCreating )
1169 return;
1170 miSizerProp=iProp;
1171 mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
1172 // PRL: wxALL has no effect because UpdateSizersCore ignores border
1173 UpdateSizersCore( false, PositionFlags | wxALL );
1174}

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

Referenced by cloud::audiocom::ShareAudioDialog::Populate(), and cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartInvisiblePanel()

wxPanel * ShuttleGuiBase::StartInvisiblePanel ( int  border = 0)

Definition at line 1131 of file ShuttleGui.cpp.

1132{
1133 UseUpId();
1134 if( mShuttleMode != eIsCreating )
1135 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
1136 wxPanel * pPanel;
1137 mpWind = pPanel = safenew wxPanelWrapper(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
1138 wxNO_BORDER);
1139
1140 mpWind->SetBackgroundColour(
1141 wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
1142 );
1143 SetProportions( 1 );
1144 miBorder = border;
1145 UpdateSizers(); // adds window in to current sizer.
1146
1147 // create a sizer within the window...
1148 mpParent = pPanel;
1149 pPanel->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
1150 PushSizer();
1151 return pPanel;
1152}

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

Referenced by cloud::audiocom::ShareAudioDialog::Populate(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartMultiColumn()

void ShuttleGuiBase::StartMultiColumn ( int  nCols,
int  PositionFlags = wxALIGN_LEFT 
)

Definition at line 1228 of file ShuttleGui.cpp.

1229{
1230 if( mShuttleMode != eIsCreating )
1231 return;
1232 mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1233 // PRL: wxALL has no effect because UpdateSizersCore ignores border
1234 UpdateSizersCore( false, PositionFlags | wxALL );
1235}

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

Here is the call graph for this function:

◆ StartNotebook()

wxNotebook * ShuttleGuiBase::StartNotebook ( )

Definition at line 1025 of file ShuttleGui.cpp.

1026{
1027 UseUpId();
1028 if( mShuttleMode != eIsCreating )
1029 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxNotebook);
1030 wxNotebook * pNotebook;
1031 mpWind = pNotebook = safenew wxNotebook(GetParent(),
1032 miId, wxDefaultPosition, wxDefaultSize, GetStyle( 0 ));
1033 SetProportions( 1 );
1034 UpdateSizers();
1035 mpParent = pNotebook;
1036 return pNotebook;
1037}

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

Here is the call graph for this function:

◆ StartNotebookPage()

wxNotebookPage * ShuttleGuiBase::StartNotebookPage ( const TranslatableString Name)

Definition at line 1067 of file ShuttleGui.cpp.

1069{
1070 if( mShuttleMode != eIsCreating )
1071 return NULL;
1072// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
1073 auto pNotebook = static_cast< wxBookCtrlBase* >( mpParent );
1075 const auto translated = Name.Translation();
1076 pPage->SetName(translated);
1077
1078 pNotebook->AddPage(
1079 pPage,
1080 translated);
1081
1082 SetProportions( 1 );
1083 mpParent = pPage;
1084 pPage->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
1085 PushSizer();
1086 // UpdateSizers();
1087 return pPage;
1088}
wxWindow wxNotebookPage
Definition: ShuttleGui.h:60

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

Here is the call graph for this function:

◆ StartPanel()

wxPanel * ShuttleGuiBase::StartPanel ( int  iStyle = 0)

Definition at line 989 of file ShuttleGui.cpp.

990{
991 UseUpId();
993 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
994 wxPanel * pPanel;
995 mpWind = pPanel = safenew wxPanelWrapper( GetParent(), miId, wxDefaultPosition, wxDefaultSize,
996 GetStyle( wxNO_BORDER ));
997
998 if( iStyle != 0 )
999 {
1000 mpWind->SetBackgroundColour(
1001 iStyle==1
1002 ? wxColour( 190,200,230) :
1003 wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
1004 );
1005 }
1006 SetProportions(0);
1007 miBorder=2;
1008 UpdateSizers(); // adds window in to current sizer.
1009
1010 // create a sizer within the window...
1011 mpParent = pPanel;
1012 pPanel->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
1013 PushSizer();
1014 return pPanel;
1015}

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

Here is the call graph for this function:

◆ StartRadioButtonGroup()

void ShuttleGuiBase::StartRadioButtonGroup ( ChoiceSetting Setting)

Call this before any TieRadioButton calls.

Definition at line 1594 of file ShuttleGui.cpp.

1595{
1596 mRadioSymbols = Setting.GetSymbols();
1597
1598 // Configure the generic type mechanism to use OUR string.
1599 mRadioValueString = Setting.Default().Internal();
1600 mRadioValue.emplace( mRadioValueString );
1601
1602 // Now actually start the radio button group.
1603 mRadioSettingName = Setting.Key();
1604 mRadioCount = 0;
1605 if( mShuttleMode == eIsCreating )
1607}
Definition: Prefs.h:173
wxString mRadioValueString
The index of this radio item. -1 for none.
Definition: ShuttleGui.h:572

References DoDataShuttle(), eIsCreating, mRadioCount, mRadioSettingName, mRadioSymbols, mRadioValue, mRadioValueString, and mShuttleMode.

Here is the call graph for this function:

◆ StartScroller()

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 937 of file ShuttleGui.cpp.

938{
939 UseUpId();
941 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxScrolledWindow);
942
943 wxScrolledWindow * pScroller;
944 mpWind = pScroller = safenew wxScrolledWindow(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
945 GetStyle( wxSUNKEN_BORDER ) );
946 pScroller->SetScrollRate( 20,20 );
947
948 // This fools NVDA into not saying "Panel" when the dialog gets focus
949 pScroller->SetName(wxT("\a"));
950 pScroller->SetLabel(wxT("\a"));
951
952 SetProportions( 1 );
953 if( iStyle==2 )
954 {
956 }
957 else
958 {
959 // mpWind->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
960 UpdateSizers(); // adds window in to current sizer.
961 }
962
963 // create a sizer within the window...
964 mpParent = pScroller;
965 pScroller->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
966 PushSizer();
967 return pScroller;
968}
void UpdateSizersAtStart()

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

Here is the call graph for this function:

◆ StartSimplebook()

wxSimplebook * ShuttleGuiBase::StartSimplebook ( )

Definition at line 1046 of file ShuttleGui.cpp.

1047{
1048 UseUpId();
1049 if( mShuttleMode != eIsCreating )
1050 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSimplebook);
1051 wxSimplebook * pNotebook;
1052 mpWind = pNotebook = safenew wxSimplebook(GetParent(),
1053 miId, wxDefaultPosition, wxDefaultSize, GetStyle( 0 ));
1054 SetProportions( 1 );
1055 UpdateSizers();
1056 mpParent = pNotebook;
1057 return pNotebook;
1058}

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

Here is the call graph for this function:

◆ StartStatic()

wxStaticBox * ShuttleGuiBase::StartStatic ( const TranslatableString 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 892 of file ShuttleGui.cpp.

893{
894 UseUpId();
896 return NULL;
897 auto translated = Str.Translation();
898 wxStaticBox * pBox = safenew wxStaticBoxWrapper(
899 GetParent(), miId, translated );
900 pBox->SetLabel( translated );
901 if (Str.empty()) {
902 // NVDA 2018.3 or later does not read the controls in a group box which has
903 // an accessibility name which is empty. Bug 2169.
904#if wxUSE_ACCESSIBILITY
905 // so that name can be set on a standard control
906 pBox->SetAccessible(safenew WindowAccessible(pBox));
907#endif
908 pBox->SetName(wxT("\a")); // non-empty string which screen readers do not read
909 }
910 else
911 pBox->SetName( wxStripMenuCodes( translated ) );
912 mpSubSizer = std::make_unique<wxStaticBoxSizer>(
913 pBox,
914 wxVERTICAL );
915 miSizerProp = iProp;
916 UpdateSizers();
917 mpParent = pBox;
918 return pBox;
919}

References eIsCreating, TranslatableString::empty(), GetParent(), miId, miSizerProp, mpParent, mpSubSizer, mShuttleMode, safenew, TranslatableString::Translation(), UpdateSizers(), UseUpId(), and wxT().

Here is the call graph for this function:

◆ StartThreeColumn()

void ShuttleGuiBase::StartThreeColumn ( )
inline

Definition at line 366 of file ShuttleGui.h.

366{StartMultiColumn(3);};
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)

◆ StartTwoColumn()

void ShuttleGuiBase::StartTwoColumn ( )
inline

Definition at line 364 of file ShuttleGui.h.

364{StartMultiColumn(2);};

◆ StartVerticalLay() [1/2]

void ShuttleGuiBase::StartVerticalLay ( int  iProp = 1)

Definition at line 1183 of file ShuttleGui.cpp.

1184{
1185 if( mShuttleMode != eIsCreating )
1186 return;
1187 miSizerProp=iProp;
1188 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1189 UpdateSizers();
1190}

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

Referenced by ShuttleGui::AddStandardButtons(), ErrorReportDialog::ErrorReportDialog(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), and cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartVerticalLay() [2/2]

void ShuttleGuiBase::StartVerticalLay ( int  PositionFlags,
int  iProp 
)

Definition at line 1192 of file ShuttleGui.cpp.

1193{
1194 if( mShuttleMode != eIsCreating )
1195 return;
1196 miSizerProp=iProp;
1197 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1198 // PRL: wxALL has no effect because UpdateSizersCore ignores border
1199 UpdateSizersCore( false, PositionFlags | wxALL );
1200}

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

Here is the call graph for this function:

◆ StartWrapLay()

void ShuttleGuiBase::StartWrapLay ( int  PositionFlags = wxEXPAND,
int  iProp = 0 
)

Definition at line 1209 of file ShuttleGui.cpp.

1210{
1212 return;
1213
1214 miSizerProp = iProp;
1215 mpSubSizer = std::make_unique<wxWrapSizer>(wxHORIZONTAL, 0);
1216
1217 UpdateSizersCore(false, PositionFlags | wxALL);
1218}

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

Referenced by cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieCheckBox() [1/2]

wxCheckBox * ShuttleGuiBase::TieCheckBox ( const TranslatableString Prompt,
bool &  Var 
)

Definition at line 1628 of file ShuttleGui.cpp.

1629{
1630 WrappedType WrappedRef( Var );
1631 return DoTieCheckBox( Prompt, WrappedRef );
1632}
wxCheckBox * DoTieCheckBox(const TranslatableString &Prompt, WrappedType &WrappedRef)
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:28

References DoTieCheckBox().

Referenced by AddPrompt(), HandleOptionality(), and anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieCheckBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieCheckBox() [2/2]

wxCheckBox * ShuttleGuiBase::TieCheckBox ( const TranslatableString Prompt,
const BoolSetting Setting 
)
virtual

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

Reimplemented in anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1841 of file ShuttleGui.cpp.

1844{
1845 wxCheckBox * pCheck=NULL;
1846
1847 auto Value = Setting.GetDefault();
1848 WrappedType WrappedRef( Value );
1849 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1850 if( DoStep(2) ) pCheck = DoTieCheckBox( Prompt, WrappedRef );
1851 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1852
1853 return pCheck;
1854}
const SettingPath & GetPath() const
Definition: Prefs.h:83
const T & GetDefault() const
Definition: Prefs.h:192

References DoDataShuttle(), DoStep(), DoTieCheckBox(), Setting< T >::GetDefault(), and SettingBase::GetPath().

Here is the call graph for this function:

◆ TieCheckBoxOnRight() [1/2]

wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight ( const TranslatableString Prompt,
bool &  Var 
)

Definition at line 1635 of file ShuttleGui.cpp.

1636{
1637 // Only does anything different if it's creating.
1638 WrappedType WrappedRef( Var );
1639 if( mShuttleMode == eIsCreating )
1640 return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() == wxT("true") );
1641 return DoTieCheckBox( Prompt, WrappedRef );
1642}

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

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieCheckBoxOnRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieCheckBoxOnRight() [2/2]

wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight ( const TranslatableString Prompt,
const BoolSetting Setting 
)
virtual

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

Reimplemented in anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1858 of file ShuttleGui.cpp.

1861{
1862 wxCheckBox * pCheck=NULL;
1863
1864 auto Value = Setting.GetDefault();
1865 WrappedType WrappedRef( Value );
1866 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1867 if( DoStep(2) ) pCheck = DoTieCheckBoxOnRight( Prompt, WrappedRef );
1868 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1869
1870 return pCheck;
1871}
wxCheckBox * DoTieCheckBoxOnRight(const TranslatableString &Prompt, WrappedType &WrappedRef)

References DoDataShuttle(), DoStep(), DoTieCheckBoxOnRight(), Setting< T >::GetDefault(), and SettingBase::GetPath().

Here is the call graph for this function:

◆ TieChoice() [1/3]

wxChoice * ShuttleGuiBase::TieChoice ( const TranslatableString Prompt,
ChoiceSetting choiceSetting 
)
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.

Reimplemented in anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1970 of file ShuttleGui.cpp.

1972{
1973 // Do this to force any needed migrations first
1974 choiceSetting.Read();
1975
1976 const auto &symbols = choiceSetting.GetSymbols();
1977 const auto &SettingName = choiceSetting.Key();
1978 const auto &Default = choiceSetting.Default().Internal();
1979 const auto &Choices = symbols.GetMsgids();
1980 const auto &InternalChoices = symbols.GetInternals();
1981
1982 wxChoice * pChoice=(wxChoice*)NULL;
1983
1984 int TempIndex=0;
1985// int TempIndex = TranslateToIndex( Default, InternalChoices );
1986 wxString TempStr = Default;
1987 WrappedType WrappedRef( TempStr );
1988 // Get from prefs does 1 and 2.
1989 // Put to prefs does 2 and 3.
1990 if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); // Get Index from Prefs.
1991 if( DoStep(1) ) TempIndex = TranslateToIndex( TempStr, InternalChoices ); // To an index
1992 if( DoStep(2) ) pChoice = TieChoice( Prompt, TempIndex, Choices );
1993 if( DoStep(3) ) TempStr = TranslateFromIndex( TempIndex, InternalChoices ); // To a string
1994 if( DoStep(3) ) choiceSetting.Write(TempStr); // Put into Prefs.
1995 return pChoice;
1996}
bool Write(const wxString &value)
Definition: Prefs.cpp:390
const wxString & Key() const
Definition: Prefs.h:432
wxString Read() const
Definition: Prefs.cpp:354
const EnumValueSymbols & GetSymbols() const
Definition: Prefs.h:434
const EnumValueSymbol & Default() const
Definition: Prefs.cpp:346
const wxString & Internal() const
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
int TranslateToIndex(const wxString &Value, const wxArrayStringEx &Choices)
String-to-Index.
wxString TranslateFromIndex(const int nIn, const wxArrayStringEx &Choices)
Index-to-String.

References ChoiceSetting::Default(), NumericConverterFormats::Default(), DoDataShuttle(), DoStep(), ChoiceSetting::GetSymbols(), ComponentInterfaceSymbol::Internal(), ChoiceSetting::Key(), ChoiceSetting::Read(), TieChoice(), TranslateFromIndex(), TranslateToIndex(), and ChoiceSetting::Write().

Here is the call graph for this function:

◆ TieChoice() [2/3]

wxChoice * ShuttleGuiBase::TieChoice ( const TranslatableString Prompt,
int &  Selected,
const TranslatableStrings choices 
)

Definition at line 1488 of file ShuttleGui.cpp.

1492{
1493 HandleOptionality( Prompt );
1494
1495 // The Add function does a UseUpId(), so don't do it here in that case.
1496 if( mShuttleMode != eIsCreating )
1497 UseUpId();
1498
1499 wxChoice * pChoice=NULL;
1500 switch( mShuttleMode )
1501 {
1502 case eIsCreating:
1503 {
1504 pChoice = AddChoice( Prompt, choices, Selected );
1505 ShuttleGui::SetMinSize(pChoice, choices);
1506 }
1507 break;
1508 // IF setting internal storage from the controls.
1509 case eIsGettingMetadata:
1510 break;
1512 {
1513 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1514 pChoice = wxDynamicCast(pWnd, wxChoice);
1515 wxASSERT( pChoice );
1516 Selected = pChoice->GetSelection();
1517 }
1518 break;
1519 case eIsSettingToDialog:
1520 {
1521 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1522 pChoice = wxDynamicCast(pWnd, wxChoice);
1523 wxASSERT( pChoice );
1524 pChoice->SetSelection( Selected );
1525 }
1526 break;
1527 default:
1528 wxASSERT( false );
1529 break;
1530 }
1531 return pChoice;
1532}
static void SetMinSize(wxWindow *window, const TranslatableStrings &items)

References AddChoice(), eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, eIsSettingToDialog, HandleOptionality(), miId, mpDlg, mShuttleMode, ShuttleGui::SetMinSize(), and UseUpId().

Here is the call graph for this function:

◆ TieChoice() [3/3]

wxChoice * ShuttleGuiBase::TieChoice ( const TranslatableString Prompt,
TranslatableString Selected,
const TranslatableStrings choices 
)

Definition at line 1726 of file ShuttleGui.cpp.

1730{
1731 int Index = make_iterator_range( choices ).index( Selected );
1732 auto result = TieChoice( Prompt, Index, choices );
1733 if ( Index >= 0 && Index < choices.size() )
1734 Selected = choices[ Index ];
1735 else
1736 Selected = {};
1737 return result;
1738}

References make_iterator_range(), and TieChoice().

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieChoice(), TieChoice(), and TieNumberAsChoice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieIntegerTextBox()

wxTextCtrl * ShuttleGuiBase::TieIntegerTextBox ( const TranslatableString Prompt,
const IntSetting Setting,
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 integer values...

Reimplemented in anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1931 of file ShuttleGui.cpp.

1935{
1936 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1937
1938 auto Value = Setting.GetDefault();
1939 WrappedType WrappedRef( Value );
1940 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1941 if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars );
1942 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1943 return pText;
1944}
wxTextCtrl * DoTieNumericTextBox(const TranslatableString &Prompt, WrappedType &WrappedRef, const int nChars)

References DoDataShuttle(), DoStep(), DoTieNumericTextBox(), Setting< T >::GetDefault(), and SettingBase::GetPath().

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieIntegerTextBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieNumberAsChoice()

wxChoice * ShuttleGuiBase::TieNumberAsChoice ( const TranslatableString Prompt,
IntSetting Setting,
const TranslatableStrings Choices,
const std::vector< int > *  pInternalChoices = nullptr,
int  iNoMatchSelector = 0 
)
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 arbitrary entry.

Parameters
PromptThe prompt shown beside the control.
SettingNameThe setting name as stored in gPrefs
DefaultThe default integer value for this control
ChoicesAn array of choices that appear on screen.
pInternalChoicesThe corresponding values (as an integer array) if null, then use 0, 1, 2, ...

Reimplemented in anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 2009 of file ShuttleGui.cpp.

2014{
2015 auto fn = [](int arg){ return wxString::Format( "%d", arg ); };
2016
2017 wxArrayStringEx InternalChoices;
2018 if ( pInternalChoices )
2019 InternalChoices =
2020 transform_container<wxArrayStringEx>(*pInternalChoices, fn);
2021 else
2022 for ( int ii = 0; ii < (int)Choices.size(); ++ii )
2023 InternalChoices.push_back( fn( ii ) );
2024
2025 const auto Default = Setting.GetDefault();
2026
2027 miNoMatchSelector = iNoMatchSelector;
2028
2029 long defaultIndex;
2030 if ( pInternalChoices )
2031 defaultIndex = make_iterator_range( *pInternalChoices ).index( Default );
2032 else
2033 defaultIndex = Default;
2034 if ( defaultIndex < 0 || defaultIndex >= (int)Choices.size() )
2035 defaultIndex = -1;
2036
2037 ChoiceSetting choiceSetting{
2038 Setting,
2039 {
2040 ByColumns,
2041 Choices,
2042 InternalChoices,
2043 },
2044 defaultIndex
2045 };
2046
2047 return ShuttleGuiBase::TieChoice(Prompt, choiceSetting);
2048}
ByColumns_t ByColumns
Definition: Prefs.cpp:474
static const auto fn
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.

References ByColumns, NumericConverterFormats::Default(), fn, Setting< T >::GetDefault(), make_iterator_range(), miNoMatchSelector, and TieChoice().

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieNumberAsChoice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieNumericTextBox() [1/3]

wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const TranslatableString Prompt,
const DoubleSetting Setting,
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 anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1949 of file ShuttleGui.cpp.

1953{
1954 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1955
1956 auto Value = Setting.GetDefault();
1957 WrappedType WrappedRef( Value );
1958 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1959 if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars );
1960 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1961 return pText;
1962}

References DoDataShuttle(), DoStep(), DoTieNumericTextBox(), Setting< T >::GetDefault(), and SettingBase::GetPath().

Here is the call graph for this function:

◆ TieNumericTextBox() [2/3]

wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const TranslatableString Prompt,
double &  Value,
const int  nChars = 0 
)

Definition at line 1679 of file ShuttleGui.cpp.

1681{
1682 WrappedType WrappedRef( Value );
1683 return DoTieNumericTextBox( Prompt, WrappedRef, nChars );
1684}

References DoTieNumericTextBox().

Here is the call graph for this function:

◆ TieNumericTextBox() [3/3]

wxTextCtrl * ShuttleGuiBase::TieNumericTextBox ( const TranslatableString Prompt,
int &  Value,
const int  nChars = 0 
)

Definition at line 1672 of file ShuttleGui.cpp.

1674{
1675 WrappedType WrappedRef( Value );
1676 return DoTieNumericTextBox( Prompt, WrappedRef, nChars );
1677}

References DoTieNumericTextBox().

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieNumericTextBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieRadioButton()

wxRadioButton * ShuttleGuiBase::TieRadioButton ( )

This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair.

Definition at line 1535 of file ShuttleGui.cpp.

1536{
1537 wxASSERT( mRadioCount >= 0); // Did you remember to use StartRadioButtonGroup() ?
1538
1539 EnumValueSymbol symbol;
1540 if (mRadioCount >= 0 && mRadioCount < (int)mRadioSymbols.size() )
1541 symbol = mRadioSymbols[ mRadioCount ];
1542
1543 // In what follows, WrappedRef is used in read only mode, but we
1544 // don't have a 'read-only' version, so we copy to deal with the constness.
1545 auto Temp = symbol.Internal();
1546 wxASSERT( !Temp.empty() ); // More buttons than values?
1547
1548 WrappedType WrappedRef( Temp );
1549
1550 mRadioCount++;
1551
1552 UseUpId();
1553 wxRadioButton * pRadioButton = NULL;
1554
1555 switch( mShuttleMode )
1556 {
1557 case eIsCreating:
1558 {
1559 const auto &Prompt = symbol.Translation();
1560
1561 mpWind = pRadioButton = safenew wxRadioButton(GetParent(), miId, Prompt,
1562 wxDefaultPosition, wxDefaultSize,
1563 (mRadioCount==1)?wxRB_GROUP:0);
1564
1565 wxASSERT( WrappedRef.IsString() );
1566 wxASSERT( mRadioValue->IsString() );
1567 const bool value =
1568 (WrappedRef.ReadAsString() == mRadioValue->ReadAsString() );
1569 pRadioButton->SetValue( value );
1570
1571 pRadioButton->SetName(wxStripMenuCodes(Prompt));
1572 UpdateSizers();
1573 }
1574 break;
1575 case eIsGettingMetadata:
1576 break;
1578 {
1579 wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
1580 pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1581 wxASSERT( pRadioButton );
1582 if( pRadioButton->GetValue() )
1583 mRadioValue->WriteToAsString( WrappedRef.ReadAsString() );
1584 }
1585 break;
1586 default:
1587 wxASSERT( false );
1588 break;
1589 }
1590 return pRadioButton;
1591}
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
const wxString Translation() const

References eIsCreating, eIsGettingFromDialog, eIsGettingMetadata, GetParent(), ComponentInterfaceSymbol::Internal(), WrappedType::IsString(), miId, mpDlg, mpWind, mRadioCount, mRadioSymbols, mRadioValue, mShuttleMode, WrappedType::ReadAsString(), safenew, ComponentInterfaceSymbol::Translation(), UpdateSizers(), and UseUpId().

Here is the call graph for this function:

◆ TieSlider() [1/4]

wxSlider * ShuttleGuiBase::TieSlider ( const TranslatableString Prompt,
const IntSetting Setting,
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 anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1875 of file ShuttleGui.cpp.

1880{
1881 wxSlider * pSlider=NULL;
1882
1883 auto Value = Setting.GetDefault();
1884 WrappedType WrappedRef( Value );
1885 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1886 if( DoStep(2) ) pSlider = DoTieSlider( Prompt, WrappedRef, max, min );
1887 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1888
1889 return pSlider;
1890}
wxSlider * DoTieSlider(const TranslatableString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)

References DoDataShuttle(), DoStep(), DoTieSlider(), Setting< T >::GetDefault(), SettingBase::GetPath(), and min().

Here is the call graph for this function:

◆ TieSlider() [2/4]

wxSlider * ShuttleGuiBase::TieSlider ( const TranslatableString Prompt,
double &  pos,
const double  max,
const double  min = 0.0 
)

Definition at line 1693 of file ShuttleGui.cpp.

1696{
1697 WrappedType WrappedRef( pos );
1698 return DoTieSlider( Prompt, WrappedRef, max, min );
1699}

References DoTieSlider(), and min().

Here is the call graph for this function:

◆ TieSlider() [3/4]

wxSlider * ShuttleGuiBase::TieSlider ( const TranslatableString Prompt,
float &  pos,
const float  fMin,
const float  fMax 
)

Definition at line 1701 of file ShuttleGui.cpp.

1704{
1705 const float RoundFix=0.0000001f;
1706 int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1707 wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1708 pos = iVal*(fMax-fMin)*0.01+fMin;
1709 return pWnd;
1710}
wxSlider * TieSlider(const TranslatableString &Prompt, int &pos, const int max, const int min=0)

References TieSlider().

Here is the call graph for this function:

◆ TieSlider() [4/4]

wxSlider * ShuttleGuiBase::TieSlider ( const TranslatableString Prompt,
int &  pos,
const int  max,
const int  min = 0 
)

Definition at line 1686 of file ShuttleGui.cpp.

1688{
1689 WrappedType WrappedRef( pos );
1690 return DoTieSlider( Prompt, WrappedRef, max, min );
1691}

References DoTieSlider(), and min().

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieSlider(), TieSlider(), and TieVSlider().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieSpinCtrl() [1/2]

wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl ( const TranslatableString Prompt,
const IntSetting Setting,
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 anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1894 of file ShuttleGui.cpp.

1899{
1900 wxSpinCtrl * pSpinCtrl=NULL;
1901
1902 auto Value = Setting.GetDefault();
1903 WrappedType WrappedRef( Value );
1904 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1905 if( DoStep(2) ) pSpinCtrl = DoTieSpinCtrl( Prompt, WrappedRef, max, min );
1906 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1907
1908 return pSpinCtrl;
1909}
wxSpinCtrl * DoTieSpinCtrl(const TranslatableString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)

References DoDataShuttle(), DoStep(), DoTieSpinCtrl(), Setting< T >::GetDefault(), SettingBase::GetPath(), and min().

Here is the call graph for this function:

◆ TieSpinCtrl() [2/2]

wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl ( const TranslatableString Prompt,
int &  Value,
const int  max,
const int  min = 0 
)

Definition at line 1644 of file ShuttleGui.cpp.

1646{
1647 WrappedType WrappedRef(Value);
1648 return DoTieSpinCtrl( Prompt, WrappedRef, max, min );
1649}

References DoTieSpinCtrl(), and min().

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieSpinCtrl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieTextBox() [1/4]

wxTextCtrl * ShuttleGuiBase::TieTextBox ( const TranslatableString Caption,
wxString &  Value,
const int  nChars = 0 
)

Definition at line 1651 of file ShuttleGui.cpp.

1653{
1654 WrappedType WrappedRef(Selected);
1655 return DoTieTextBox( Prompt, WrappedRef, nChars );
1656}
wxTextCtrl * DoTieTextBox(const TranslatableString &Prompt, WrappedType &WrappedRef, const int nChars)

References DoTieTextBox().

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieTextBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TieTextBox() [2/4]

wxTextCtrl * ShuttleGuiBase::TieTextBox ( const TranslatableString Prompt,
const StringSetting Setting,
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 anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition.

Definition at line 1913 of file ShuttleGui.cpp.

1917{
1918 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1919
1920 auto Value = Setting.GetDefault();
1921 WrappedType WrappedRef( Value );
1922 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1923 if( DoStep(2) ) pText = DoTieTextBox( Prompt, WrappedRef, nChars );
1924 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1925 return pText;
1926}

References DoDataShuttle(), DoStep(), DoTieTextBox(), Setting< T >::GetDefault(), and SettingBase::GetPath().

Here is the call graph for this function:

◆ TieTextBox() [3/4]

wxTextCtrl * ShuttleGuiBase::TieTextBox ( const TranslatableString Prompt,
double &  Value,
const int  nChars = 0 
)

Definition at line 1665 of file ShuttleGui.cpp.

1667{
1668 WrappedType WrappedRef( Value );
1669 return DoTieTextBox( Prompt, WrappedRef, nChars );
1670}

References DoTieTextBox().

Here is the call graph for this function:

◆ TieTextBox() [4/4]

wxTextCtrl * ShuttleGuiBase::TieTextBox ( const TranslatableString Prompt,
int &  Selected,
const int  nChars = 0 
)

Definition at line 1658 of file ShuttleGui.cpp.

1660{
1661 WrappedType WrappedRef( Selected );
1662 return DoTieTextBox( Prompt, WrappedRef, nChars );
1663}

References DoTieTextBox().

Here is the call graph for this function:

◆ TieVSlider()

wxSlider * ShuttleGuiBase::TieVSlider ( const TranslatableString Prompt,
float &  pos,
const float  fMin,
const float  fMax 
)

Definition at line 1712 of file ShuttleGui.cpp.

1715{
1716 int iVal=(pos-fMin)*100.0/(fMax-fMin);
1717// if( mShuttleMode == eIsCreating )
1718// {
1719// return AddVSlider( Prompt, iVal, 100 );
1720// }
1721 wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1722 pos = iVal*(fMax-fMin)*0.01+fMin;
1723 return pWnd;
1724}

References TieSlider().

Here is the call graph for this function:

◆ TranslateFromIndex()

wxString ShuttleGuiBase::TranslateFromIndex ( const int  nIn,
const wxArrayStringEx Choices 
)

Index-to-String.

Definition at line 1758 of file ShuttleGui.cpp.

1759{
1760 int n = nIn;
1761 if( n== wxNOT_FOUND )
1764 if( n < (int)Choices.size() )
1765 {
1766 return Choices[n];
1767 }
1768 return wxT("");
1769}

References miNoMatchSelector, and wxT().

Referenced by TieChoice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TranslateToIndex()

int ShuttleGuiBase::TranslateToIndex ( const wxString &  Value,
const wxArrayStringEx Choices 
)

String-to-Index.

Definition at line 1748 of file ShuttleGui.cpp.

1749{
1750 int n = make_iterator_range( Choices ).index( Value );
1751 if( n == wxNOT_FOUND )
1754 return n;
1755}

References make_iterator_range(), and miNoMatchSelector.

Referenced by TieChoice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSizers()

void ShuttleGuiBase::UpdateSizers ( )
protected

Definition at line 2183 of file ShuttleGui.cpp.

2184{ UpdateSizersCore( false, wxEXPAND | wxALL );}

References UpdateSizersCore().

Referenced by AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddFixedText(), AddGrid(), AddListBox(), AddListControl(), AddListControlReportMode(), AddNumericTextBox(), AddReadOnlyText(), AddSlider(), AddSpinCtrl(), ShuttleGui::AddStandardButtons(), AddTextBox(), AddTextWindow(), AddTitle(), AddTree(), AddVariableText(), DoAddRadioButton(), StartInvisiblePanel(), StartNotebook(), StartPanel(), StartScroller(), StartSimplebook(), StartStatic(), StartVerticalLay(), and TieRadioButton().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSizersAtStart()

void ShuttleGuiBase::UpdateSizersAtStart ( )
protected

Definition at line 2192 of file ShuttleGui.cpp.

2193{ UpdateSizersCore( true, wxEXPAND | wxALL );}

References UpdateSizersCore().

Referenced by StartScroller().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSizersC()

void ShuttleGuiBase::UpdateSizersC ( )
protected

Definition at line 2187 of file ShuttleGui.cpp.

2188{ UpdateSizersCore( false, wxALIGN_CENTRE | wxALL );}

References UpdateSizersCore().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSizersCore()

void ShuttleGuiBase::UpdateSizersCore ( bool  bPrepend,
int  Flags,
bool  prompt = false 
)
protected

Definition at line 2129 of file ShuttleGui.cpp.

2130{
2131 if( mpWind && mpParent )
2132 {
2133 int useFlags = Flags;
2134
2135 if ( !prompt && mItem.mWindowPositionFlags )
2136 // override the given Flags
2137 useFlags = mItem.mWindowPositionFlags;
2138
2139 if (!prompt)
2140 ApplyItem( 0, mItem, mpWind, mpDlg );
2141
2142 if( mpSizer){
2143 if( bPrepend )
2144 {
2145 mpSizer->Prepend(mpWind, miProp, useFlags, miBorder);
2146 }
2147 else
2148 {
2149 mpSizer->Add(mpWind, miProp, useFlags, miBorder);
2150 }
2151 }
2152
2153 if (!prompt) {
2154 ApplyItem( 1, mItem, mpWind, mpDlg );
2155 // Reset to defaults
2156 mItem = {};
2157 }
2158 }
2159
2160 if( mpSubSizer && mpSizer )
2161 {
2162 // When adding sizers into sizers, don't add a border.
2163 // unless it's a static box sizer.
2164 wxSizer *const pSubSizer = mpSubSizer.get();
2165 if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
2166 {
2167 mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags , miBorder);
2168 }
2169 else
2170 {
2171 mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags ,0);//miBorder);
2172 }
2173 mpSizer = pSubSizer;
2174 PushSizer();
2175 }
2176
2177 mpWind = NULL;
2178 miProp = 0;
2179 miSizerProp =0;
2180}
static void ApplyItem(int step, const DialogDefinition::Item &item, wxWindow *pWind, wxWindow *pDlg)

References ApplyItem(), miBorder, miProp, miSizerProp, mItem, mpDlg, mpParent, mpSizer, mpSubSizer, mpWind, DialogDefinition::Item::mWindowPositionFlags, and PushSizer().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UseUpId()

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 2060 of file ShuttleGui.cpp.

2061{
2062 if( miIdSetByUser > 0)
2063 {
2065 miIdSetByUser = -1;
2066 return;
2067 }
2068 miId = miIdNext++;
2069}

References miId, miIdNext, and miIdSetByUser.

Referenced by AddBitmapButton(), AddButton(), AddCheckBox(), AddCheckBoxOnRight(), AddChoice(), AddCombo(), AddConstTextBox(), AddFixedText(), AddGrid(), AddIcon(), AddListBox(), AddListControl(), AddListControlReportMode(), AddNumericTextBox(), AddReadOnlyText(), AddSlider(), AddSpinCtrl(), AddTextBox(), AddTextWindow(), AddTree(), AddVariableText(), DoAddRadioButton(), DoTieCheckBox(), DoTieCheckBoxOnRight(), DoTieNumericTextBox(), DoTieSlider(), DoTieSpinCtrl(), DoTieTextBox(), StartInvisiblePanel(), StartNotebook(), StartPanel(), StartScroller(), StartSimplebook(), StartStatic(), TieChoice(), and TieRadioButton().

Here is the caller graph for this function:

Member Data Documentation

◆ miBorder

int ShuttleGuiBase::miBorder
protected

Definition at line 536 of file ShuttleGui.h.

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

◆ miId

int ShuttleGuiBase::miId
protected

◆ miIdNext

int ShuttleGuiBase::miIdNext
protected

Definition at line 541 of file ShuttleGui.h.

Referenced by ResetId(), and UseUpId().

◆ miIdSetByUser

int ShuttleGuiBase::miIdSetByUser
protected

Definition at line 542 of file ShuttleGui.h.

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

◆ miNoMatchSelector

int ShuttleGuiBase::miNoMatchSelector
protected

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

Definition at line 530 of file ShuttleGui.h.

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

◆ miProp

int ShuttleGuiBase::miProp
protected

◆ miPropSetByUser

int ShuttleGuiBase::miPropSetByUser
protected

Definition at line 544 of file ShuttleGui.h.

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

◆ miSizerProp

int ShuttleGuiBase::miSizerProp
protected

◆ mItem

DialogDefinition::Item ShuttleGuiBase::mItem
protected

Definition at line 577 of file ShuttleGui.h.

Referenced by AddReadOnlyText(), AddSlider(), GetStyle(), and UpdateSizersCore().

◆ mpbOptionalFlag

bool* ShuttleGuiBase::mpbOptionalFlag
protected

◆ mpDlg

wxWindow* const ShuttleGuiBase::mpDlg
protected

◆ mpParent

wxWindow* ShuttleGuiBase::mpParent
protected

◆ mpShuttle

std::unique_ptr<ShuttlePrefs> ShuttleGuiBase::mpShuttle
protected

Definition at line 528 of file ShuttleGui.h.

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

◆ mpSizer

wxSizer* ShuttleGuiBase::mpSizer
protected

◆ mpSubSizer

std::unique_ptr<wxSizer> ShuttleGuiBase::mpSubSizer
protected

◆ mpWind

wxWindow* ShuttleGuiBase::mpWind
protected

◆ mRadioCount

int ShuttleGuiBase::mRadioCount
private

The wrapped value associated with the active radio button.

Definition at line 571 of file ShuttleGui.h.

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

◆ mRadioSettingName

wxString ShuttleGuiBase::mRadioSettingName
private

Definition at line 569 of file ShuttleGui.h.

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

◆ mRadioSymbols

std::vector<EnumValueSymbol> ShuttleGuiBase::mRadioSymbols
private

Definition at line 568 of file ShuttleGui.h.

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

◆ mRadioValue

std::optional<WrappedType> ShuttleGuiBase::mRadioValue
private

The setting controlled by a group.

Definition at line 570 of file ShuttleGui.h.

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

◆ mRadioValueString

wxString ShuttleGuiBase::mRadioValueString
private

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

Definition at line 572 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

◆ mShuttleMode

teShuttleMode ShuttleGuiBase::mShuttleMode
protected

◆ mSizerDepth

int ShuttleGuiBase::mSizerDepth
protected

Definition at line 535 of file ShuttleGui.h.

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

◆ pSizerStack

wxSizer* ShuttleGuiBase::pSizerStack[nMaxNestedSizers]
protected

Definition at line 526 of file ShuttleGui.h.

Referenced by PopSizer(), and PushSizer().


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