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 ()
 
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< ShuttlempShuttle
 
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 241 of file ShuttleGui.h.

Constructor & Destructor Documentation

◆ ShuttleGuiBase()

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

Definition at line 129 of file ShuttleGui.cpp.

131 : mpDlg{ pParent }
132{
133 wxASSERT( (pParent != NULL ) || ( ShuttleMode != eIsCreating));
134 mpbOptionalFlag = nullptr;
135 mpParent = pParent;
136 mShuttleMode = ShuttleMode;
137 Init( vertical, minSize );
138}
@ eIsCreating
Definition: ShuttleGui.h:39
wxWindow *const mpDlg
Definition: ShuttleGui.h:527
void Init(bool vertical, wxSize minSize)
Definition: ShuttleGui.cpp:144
bool * mpbOptionalFlag
Definition: ShuttleGui.h:548
wxWindow * mpParent
Definition: ShuttleGui.h:552
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:534

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

Here is the call graph for this function:

◆ ~ShuttleGuiBase()

ShuttleGuiBase::~ShuttleGuiBase ( )
virtual

Definition at line 140 of file ShuttleGui.cpp.

141{
142}

Member Function Documentation

◆ AddBitmapButton()

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

Definition at line 380 of file ShuttleGui.cpp.

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

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

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

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

Here is the call graph for this function:

◆ AddCheckBox() [1/3]

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

Definition at line 310 of file ShuttleGui.cpp.

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

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

345{
346 HandleOptionality( Prompt );
347 AddPrompt( Prompt );
348 UseUpId();
350 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox);
351 wxCheckBox * pCheckBox;
352 miProp=0;
353 mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, wxT(""), wxDefaultPosition, wxDefaultSize,
354 GetStyle( 0 ));
355 pCheckBox->SetValue(Selected);
356 pCheckBox->SetName(Prompt.Stripped().Translation());
357 UpdateSizers();
358 return pCheckBox;
359}
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(), and UseUpId().

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

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

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

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

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

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

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

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

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

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

Here is the call graph for this function:

◆ AddGrid()

wxGrid * ShuttleGuiBase::AddGrid ( )

Definition at line 769 of file ShuttleGui.cpp.

770{
771 UseUpId();
773 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxGrid);
774 wxGrid * pGrid;
775 SetProportions( 1 );
776 mpWind = pGrid = safenew wxGrid(GetParent(), miId, wxDefaultPosition,
777 wxDefaultSize, GetStyle( wxWANTS_CHARS ));
778 pGrid->SetMinSize( wxSize( 120, 150 ));
779 UpdateSizers();
780 return pGrid;
781}
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 869 of file ShuttleGui.cpp.

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

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

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

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

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

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

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

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

677{
678 const auto translated = Caption.Translation();
679 HandleOptionality( Caption );
680 AddPrompt( Caption );
681 UseUpId();
683 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
684 wxTextCtrl * pTextCtrl;
685 wxSize Size(wxDefaultSize);
686 if( nChars > 0 )
687 {
688 Size.SetWidth( nChars *5 );
689 }
690 miProp=0;
691
692#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
693 long flags = wxTE_RIGHT;
694#else
695 long flags = wxTE_LEFT;
696#endif
697
698 wxTextValidator Validator(wxFILTER_NUMERIC);
699 mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value,
700 wxDefaultPosition, Size, GetStyle( flags ),
701 Validator // It's OK to pass this. It will be cloned.
702 );
703#if wxUSE_ACCESSIBILITY
704 // so that name can be set on a standard control
705 mpWind->SetAccessible(safenew WindowAccessible(mpWind));
706#endif
707 mpWind->SetName(wxStripMenuCodes(translated));
708 UpdateSizers();
709 return pTextCtrl;
710}
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 239 of file ShuttleGui.cpp.

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

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

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

577{
578 return DoAddRadioButton( Prompt, 0, selector, initValue );
579}

References DoAddRadioButton().

Here is the call graph for this function:

◆ AddReadOnlyText()

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

Definition at line 497 of file ShuttleGui.cpp.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Referenced by ErrorReportDialog::ErrorReportDialog().

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

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

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

Here is the call graph for this function:

◆ ApplyItem()

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

Definition at line 2085 of file ShuttleGui.cpp.

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

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

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

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

1249{
1250 wxASSERT( mpShuttle );
1251 mpShuttle->TransferWrappedType( Name, WrappedRef );
1252}
std::unique_ptr< Shuttle > mpShuttle
Definition: ShuttleGui.h:530

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

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

1819{
1820 // Get value and create
1821 if( mShuttleMode == eIsCreating )
1822 {
1823 return (iStep==1) || (iStep==2);
1824 }
1825 // Like creating, get the value and set.
1827 {
1828 return (iStep==1) || (iStep==2);
1829 }
1831 {
1832 return (iStep==2) || (iStep==3);
1833 }
1835 return iStep ==2;
1836 wxASSERT( false );
1837 return false;
1838}
@ eIsSettingToDialog
Definition: ShuttleGui.h:41
@ eIsGettingFromDialog
Definition: ShuttleGui.h:40
@ eIsGettingMetadata
Definition: ShuttleGui.h:42

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1179{
1180 if( mShuttleMode != eIsCreating )
1181 return;
1182 PopSizer();
1183}

References eIsCreating, mShuttleMode, and PopSizer().

Here is the call graph for this function:

◆ EndInvisiblePanel()

void ShuttleGuiBase::EndInvisiblePanel ( )

Definition at line 1156 of file ShuttleGui.cpp.

1157{
1158 EndPanel();
1159}

References EndPanel().

Here is the call graph for this function:

◆ EndMultiColumn()

void ShuttleGuiBase::EndMultiColumn ( )

Definition at line 1239 of file ShuttleGui.cpp.

1240{
1241 if( mShuttleMode != eIsCreating )
1242 return;
1243 PopSizer();
1244}

References eIsCreating, mShuttleMode, and PopSizer().

Here is the call graph for this function:

◆ EndNotebook()

void ShuttleGuiBase::EndNotebook ( )

Definition at line 1041 of file ShuttleGui.cpp.

1042{
1043 //PopSizer();
1044 mpParent = mpParent->GetParent();
1045}

References mpParent.

◆ EndNotebookPage()

void ShuttleGuiBase::EndNotebookPage ( )

Definition at line 1092 of file ShuttleGui.cpp.

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

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

Here is the call graph for this function:

◆ EndPanel()

void ShuttleGuiBase::EndPanel ( )

Definition at line 1019 of file ShuttleGui.cpp.

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

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

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

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

Here is the call graph for this function:

◆ EndScroller()

void ShuttleGuiBase::EndScroller ( )

Definition at line 972 of file ShuttleGui.cpp.

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

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

Here is the call graph for this function:

◆ EndSimplebook()

void ShuttleGuiBase::EndSimplebook ( )

Definition at line 1062 of file ShuttleGui.cpp.

1063{
1064 //PopSizer();
1065 mpParent = mpParent->GetParent();
1066}

References mpParent.

◆ EndStatic()

void ShuttleGuiBase::EndStatic ( )

Definition at line 923 of file ShuttleGui.cpp.

924{
926 return;
927 PopSizer();
928 mpParent = mpParent->GetParent();
929}

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

Here is the call graph for this function:

◆ EndThreeColumn()

void ShuttleGuiBase::EndThreeColumn ( )
inline

Definition at line 369 of file ShuttleGui.h.

369{EndMultiColumn();};
void EndMultiColumn()

◆ EndTwoColumn()

void ShuttleGuiBase::EndTwoColumn ( )
inline

Definition at line 367 of file ShuttleGui.h.

367{EndMultiColumn();};

◆ EndVerticalLay()

void ShuttleGuiBase::EndVerticalLay ( )

Definition at line 1204 of file ShuttleGui.cpp.

1205{
1206 if( mShuttleMode != eIsCreating )
1207 return;
1208 PopSizer();
1209}

References eIsCreating, mShuttleMode, and PopSizer().

Referenced by ShuttleGui::AddStandardButtons(), and ErrorReportDialog::ErrorReportDialog().

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

◆ EndWrapLay()

void ShuttleGuiBase::EndWrapLay ( )

Definition at line 1222 of file ShuttleGui.cpp.

1223{
1225 return;
1226
1227 PopSizer();
1228}

References eIsCreating, mShuttleMode, and PopSizer().

Here is the call graph for this function:

◆ GetBorder()

int ShuttleGuiBase::GetBorder ( ) const
noexcept

Definition at line 197 of file ShuttleGui.cpp.

198{
199 return miBorder;
200}

References miBorder.

◆ GetParent()

wxWindow * ShuttleGuiBase::GetParent ( )
inline

Definition at line 493 of file ShuttleGui.h.

494 {
495 // This assertion justifies the use of safenew in many places where GetParent()
496 // is used to construct a window
497 wxASSERT(mpParent != NULL);
498 return mpParent;
499 }

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(), StartInvisiblePanel(), StartNotebook(), StartNotebookPage(), StartPanel(), StartScroller(), StartSimplebook(), StartStatic(), and TieRadioButton().

Here is the caller graph for this function:

◆ GetSizer()

wxSizer * ShuttleGuiBase::GetSizer ( )
inline

Definition at line 503 of file ShuttleGui.h.

503{return mpSizer;}

◆ GetStyle()

long ShuttleGuiBase::GetStyle ( long  Style)
protected

Definition at line 2211 of file ShuttleGui.cpp.

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

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

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

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

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

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

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

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

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

884{
885 miPropSetByUser = iProp;
886 return *this;
887}

References miPropSetByUser.

Referenced by ShuttleGui::Prop().

Here is the caller graph for this function:

◆ PushSizer()

void ShuttleGuiBase::PushSizer ( )
protected

Definition at line 2204 of file ShuttleGui.cpp.

2205{
2206 mSizerDepth++;
2207 wxASSERT( mSizerDepth < nMaxNestedSizers );
2209}
const int nMaxNestedSizers
Definition: ShuttleGui.h:35

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

190{
191 miIdSetByUser = -1;
192 miId = -1;
193 miIdNext = 3000;
194}

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

486{miBorder = Border;};

◆ SetProportions()

void ShuttleGuiBase::SetProportions ( int  Default)
protected

Definition at line 2073 of file ShuttleGui.cpp.

2074{
2075 if( miPropSetByUser >=0 )
2076 {
2078 miPropSetByUser =-1;
2079 return;
2080 }
2081 miProp = Default;
2082}
@ Default
Like Ok, except maybe minor difference of dialog position.

References miProp, and miPropSetByUser.

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

Here is the caller graph for this function:

◆ SetSizerProportion()

void ShuttleGuiBase::SetSizerProportion ( int  iProp)
inline

Definition at line 488 of file ShuttleGui.h.

488{miSizerProp = iProp;};

◆ SetStretchyCol()

void ShuttleGuiBase::SetStretchyCol ( int  i)

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

Definition at line 203 of file ShuttleGui.cpp.

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

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

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

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

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

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

Here is the call graph for this function:

◆ StartInvisiblePanel()

wxPanel * ShuttleGuiBase::StartInvisiblePanel ( )

Definition at line 1133 of file ShuttleGui.cpp.

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

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

Here is the call graph for this function:

◆ StartMultiColumn()

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

Definition at line 1230 of file ShuttleGui.cpp.

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

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

Here is the call graph for this function:

◆ StartNotebook()

wxNotebook * ShuttleGuiBase::StartNotebook ( )

Definition at line 1027 of file ShuttleGui.cpp.

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

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

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

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

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

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

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

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

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

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

Here is the call graph for this function:

◆ StartSimplebook()

wxSimplebook * ShuttleGuiBase::StartSimplebook ( )

Definition at line 1048 of file ShuttleGui.cpp.

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

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

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

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

Here is the call graph for this function:

◆ StartThreeColumn()

void ShuttleGuiBase::StartThreeColumn ( )
inline

Definition at line 368 of file ShuttleGui.h.

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

◆ StartTwoColumn()

void ShuttleGuiBase::StartTwoColumn ( )
inline

Definition at line 366 of file ShuttleGui.h.

366{StartMultiColumn(2);};

◆ StartVerticalLay() [1/2]

void ShuttleGuiBase::StartVerticalLay ( int  iProp = 1)

Definition at line 1185 of file ShuttleGui.cpp.

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

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

Referenced by ShuttleGui::AddStandardButtons(), and ErrorReportDialog::ErrorReportDialog().

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

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

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

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

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

Here is the call graph for this function:

◆ TieCheckBox() [1/2]

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

Definition at line 1630 of file ShuttleGui.cpp.

1631{
1632 WrappedType WrappedRef( Var );
1633 return DoTieCheckBox( Prompt, WrappedRef );
1634}
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:31

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

1846{
1847 wxCheckBox * pCheck=NULL;
1848
1849 auto Value = Setting.GetDefault();
1850 WrappedType WrappedRef( Value );
1851 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1852 if( DoStep(2) ) pCheck = DoTieCheckBox( Prompt, WrappedRef );
1853 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1854
1855 return pCheck;
1856}
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 1637 of file ShuttleGui.cpp.

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

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

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

1863{
1864 wxCheckBox * pCheck=NULL;
1865
1866 auto Value = Setting.GetDefault();
1867 WrappedType WrappedRef( Value );
1868 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1869 if( DoStep(2) ) pCheck = DoTieCheckBoxOnRight( Prompt, WrappedRef );
1870 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1871
1872 return pCheck;
1873}
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 1972 of file ShuttleGui.cpp.

1974{
1975 // Do this to force any needed migrations first
1976 choiceSetting.Read();
1977
1978 const auto &symbols = choiceSetting.GetSymbols();
1979 const auto &SettingName = choiceSetting.Key();
1980 const auto &Default = choiceSetting.Default().Internal();
1981 const auto &Choices = symbols.GetMsgids();
1982 const auto &InternalChoices = symbols.GetInternals();
1983
1984 wxChoice * pChoice=(wxChoice*)NULL;
1985
1986 int TempIndex=0;
1987// int TempIndex = TranslateToIndex( Default, InternalChoices );
1988 wxString TempStr = Default;
1989 WrappedType WrappedRef( TempStr );
1990 // Get from prefs does 1 and 2.
1991 // Put to prefs does 2 and 3.
1992 if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); // Get Index from Prefs.
1993 if( DoStep(1) ) TempIndex = TranslateToIndex( TempStr, InternalChoices ); // To an index
1994 if( DoStep(2) ) pChoice = TieChoice( Prompt, TempIndex, Choices );
1995 if( DoStep(3) ) TempStr = TranslateFromIndex( TempIndex, InternalChoices ); // To a string
1996 if( DoStep(3) ) choiceSetting.Write(TempStr); // Put into Prefs.
1997 return pChoice;
1998}
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(), 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 1490 of file ShuttleGui.cpp.

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

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

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

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

Definition at line 1933 of file ShuttleGui.cpp.

1937{
1938 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1939
1940 auto Value = Setting.GetDefault();
1941 WrappedType WrappedRef( Value );
1942 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1943 if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars );
1944 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1945 return pText;
1946}
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 2011 of file ShuttleGui.cpp.

2016{
2017 auto fn = [](int arg){ return wxString::Format( "%d", arg ); };
2018
2019 wxArrayStringEx InternalChoices;
2020 if ( pInternalChoices )
2021 InternalChoices =
2022 transform_container<wxArrayStringEx>(*pInternalChoices, fn);
2023 else
2024 for ( int ii = 0; ii < (int)Choices.size(); ++ii )
2025 InternalChoices.push_back( fn( ii ) );
2026
2027 const auto Default = Setting.GetDefault();
2028
2029 miNoMatchSelector = iNoMatchSelector;
2030
2031 long defaultIndex;
2032 if ( pInternalChoices )
2033 defaultIndex = make_iterator_range( *pInternalChoices ).index( Default );
2034 else
2035 defaultIndex = Default;
2036 if ( defaultIndex < 0 || defaultIndex >= (int)Choices.size() )
2037 defaultIndex = -1;
2038
2039 ChoiceSetting choiceSetting{
2040 Setting,
2041 {
2042 ByColumns,
2043 Choices,
2044 InternalChoices,
2045 },
2046 defaultIndex
2047 };
2048
2049 return ShuttleGuiBase::TieChoice(Prompt, choiceSetting);
2050}
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, 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 1951 of file ShuttleGui.cpp.

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

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

1683{
1684 WrappedType WrappedRef( Value );
1685 return DoTieNumericTextBox( Prompt, WrappedRef, nChars );
1686}

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

1676{
1677 WrappedType WrappedRef( Value );
1678 return DoTieNumericTextBox( Prompt, WrappedRef, nChars );
1679}

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

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

1882{
1883 wxSlider * pSlider=NULL;
1884
1885 auto Value = Setting.GetDefault();
1886 WrappedType WrappedRef( Value );
1887 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1888 if( DoStep(2) ) pSlider = DoTieSlider( Prompt, WrappedRef, max, min );
1889 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1890
1891 return pSlider;
1892}
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 1695 of file ShuttleGui.cpp.

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

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

1706{
1707 const float RoundFix=0.0000001f;
1708 int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1709 wxSlider * pWnd = TieSlider( Prompt, iVal, 100 );
1710 pos = iVal*(fMax-fMin)*0.01+fMin;
1711 return pWnd;
1712}
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 1688 of file ShuttleGui.cpp.

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

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

1901{
1902 wxSpinCtrl * pSpinCtrl=NULL;
1903
1904 auto Value = Setting.GetDefault();
1905 WrappedType WrappedRef( Value );
1906 if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1907 if( DoStep(2) ) pSpinCtrl = DoTieSpinCtrl( Prompt, WrappedRef, max, min );
1908 if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef );
1909
1910 return pSpinCtrl;
1911}
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 1646 of file ShuttleGui.cpp.

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

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

1655{
1656 WrappedType WrappedRef(Selected);
1657 return DoTieTextBox( Prompt, WrappedRef, nChars );
1658}
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 1915 of file ShuttleGui.cpp.

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

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

1669{
1670 WrappedType WrappedRef( Value );
1671 return DoTieTextBox( Prompt, WrappedRef, nChars );
1672}

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

1662{
1663 WrappedType WrappedRef( Selected );
1664 return DoTieTextBox( Prompt, WrappedRef, nChars );
1665}

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

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

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

1761{
1762 int n = nIn;
1763 if( n== wxNOT_FOUND )
1766 if( n < (int)Choices.size() )
1767 {
1768 return Choices[n];
1769 }
1770 return wxT("");
1771}

References miNoMatchSelector.

Referenced by TieChoice().

Here is the caller graph for this function:

◆ TranslateToIndex()

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

String-to-Index.

Definition at line 1750 of file ShuttleGui.cpp.

1751{
1752 int n = make_iterator_range( Choices ).index( Value );
1753 if( n == wxNOT_FOUND )
1756 return n;
1757}

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

2186{ 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 2194 of file ShuttleGui.cpp.

2195{ 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 2189 of file ShuttleGui.cpp.

2190{ 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 2131 of file ShuttleGui.cpp.

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

2063{
2064 if( miIdSetByUser > 0)
2065 {
2067 miIdSetByUser = -1;
2068 return;
2069 }
2070 miId = miIdNext++;
2071}

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

Referenced by ResetId(), and UseUpId().

◆ miIdSetByUser

int ShuttleGuiBase::miIdSetByUser
protected

Definition at line 544 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 532 of file ShuttleGui.h.

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

◆ miProp

int ShuttleGuiBase::miProp
protected

◆ miPropSetByUser

int ShuttleGuiBase::miPropSetByUser
protected

Definition at line 546 of file ShuttleGui.h.

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

◆ miSizerProp

int ShuttleGuiBase::miSizerProp
protected

◆ mItem

DialogDefinition::Item ShuttleGuiBase::mItem
protected

Definition at line 579 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<Shuttle> ShuttleGuiBase::mpShuttle
protected

Definition at line 530 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 573 of file ShuttleGui.h.

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

◆ mRadioSettingName

wxString ShuttleGuiBase::mRadioSettingName
private

Definition at line 571 of file ShuttleGui.h.

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

◆ mRadioSymbols

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

Definition at line 570 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 572 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 574 of file ShuttleGui.h.

Referenced by StartRadioButtonGroup().

◆ mShuttleMode

teShuttleMode ShuttleGuiBase::mShuttleMode
protected

◆ mSizerDepth

int ShuttleGuiBase::mSizerDepth
protected

Definition at line 537 of file ShuttleGui.h.

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

◆ pSizerStack

wxSizer* ShuttleGuiBase::pSizerStack[nMaxNestedSizers]
protected

Definition at line 528 of file ShuttleGui.h.

Referenced by PopSizer(), and PushSizer().


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