108#include <wx/wxprec.h>
110#include <wx/listctrl.h>
111#include <wx/notebook.h>
112#include <wx/simplebook.h>
113#include <wx/treectrl.h>
114#include <wx/spinctrl.h>
115#include <wx/stattext.h>
116#include <wx/bmpbuttn.h>
117#include <wx/wrapsizer.h>
125#if wxUSE_ACCESSIBILITY
130 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize )
133 wxASSERT( (pParent != NULL ) || ( ShuttleMode !=
eIsCreating));
137 Init( vertical, minSize );
172 wxWindow * pGrandParent =
mpParent->GetParent();
175 mpSizer = pGrandParent->GetSizer();
183 mpSizer =
safenew wxBoxSizer(vertical ? wxVERTICAL : wxHORIZONTAL));
207 wxFlexGridSizer *pSizer = wxDynamicCast(
mpSizer, wxFlexGridSizer);
209 pSizer->AddGrowableCol( i, 1 );
217 wxFlexGridSizer *pSizer = wxDynamicCast(
mpSizer, wxFlexGridSizer);
219 pSizer->AddGrowableRow( i, 1 );
254 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
258 text->Wrap(wrapWidth);
259 mpWind->SetName(wxStripMenuCodes(translated));
272 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
276 text->Wrap(wrapWidth);
277 mpWind->SetName(translated);
289 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
293 text->Wrap(wrapWidth);
294 mpWind->SetName(translated);
322 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxCheckBox);
323 wxCheckBox * pCheckBox;
327 pCheckBox->SetValue(Selected);
328 if (realPrompt.empty()) {
331#if wxUSE_ACCESSIBILITY
335 pCheckBox->SetName(wxT(
"\a"));
350 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxCheckBox);
351 wxCheckBox * pCheckBox;
355 pCheckBox->SetValue(Selected);
366 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxButton);
370 translated, wxDefaultPosition, wxDefaultSize,
372 mpWind->SetName(wxStripMenuCodes(translated));
381 const wxBitmap &Bitmap,
int PositionFlags,
bool setDefault)
385 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxBitmapButton);
386 wxBitmapButton * pBtn;
388 wxDefaultPosition, wxDefaultSize,
GetStyle( wxBU_AUTODRAW ) );
389 pBtn->SetBackgroundColour(
390 wxColour( 246,246,243));
406 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxChoice);
415 transform_container<wxArrayString>(
419 pChoice->SetMinSize( { 180, -1 } );
421#if wxUSE_ACCESSIBILITY
427 if ( Selected >= 0 && Selected < (
int)choices.size() )
428 pChoice->SetSelection( Selected );
449 miId, translated, wxDefaultPosition, wxDefaultSize,
453 text->Wrap( wrapWidth );
454 mpWind->SetName(wxStripMenuCodes(translated));
466 bool bCenter,
int PositionFlags,
int wrapWidth )
471 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxStaticText);
473 wxStaticText *pStatic;
475 wxDefaultPosition, wxDefaultSize,
479 text->Wrap( wrapWidth );
480 mpWind->SetName(wxStripMenuCodes(translated));
501 auto style =
GetStyle( wxBORDER_NONE );
512 wxDefaultPosition, wxDefaultSize,
GetStyle( style ));
513 mpWind->SetName(wxStripMenuCodes(translated));
515 return pReadOnlyText;
527 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxComboBox);
531 int n = choices.size();
534 wxString Choices[50];
537 Choices[i] = choices[i];
542 mpWind->SetName(wxStripMenuCodes(translated));
557 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxRadioButton);
558 wxRadioButton * pRad;
560 wxDefaultPosition, wxDefaultSize,
GetStyle( style ) );
561 mpWind->SetName(wxStripMenuCodes(translated));
563 pRad->SetValue(
true );
565 pRad->SetValue( selector == initValue );
586 return wxSliderBase::SetFocus();
597 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSlider);
605 GetStyle( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS )
607#if wxUSE_ACCESSIBILITY
625 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSpinCtrl);
626 wxSpinCtrl * pSpinCtrl;
629 wxDefaultPosition, wxDefaultSize,
630 GetStyle( wxSP_VERTICAL | wxSP_ARROW_KEYS ),
633 mpWind->SetName(wxStripMenuCodes(translated));
647 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
648 wxTextCtrl * pTextCtrl;
649 wxSize Size(wxDefaultSize);
653 mpDlg->GetTextExtent( wxT(
"9"), &width,
nullptr );
654 Size.SetWidth( nChars * width );
658#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
659 long flags = wxTE_RIGHT;
661 long flags = wxTE_LEFT;
665 wxDefaultPosition, Size,
GetStyle( flags ));
666#if wxUSE_ACCESSIBILITY
670 mpWind->SetName(wxStripMenuCodes(translated));
683 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
684 wxTextCtrl * pTextCtrl;
685 wxSize Size(wxDefaultSize);
688 Size.SetWidth( nChars *5 );
692#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
693 long flags = wxTE_RIGHT;
695 long flags = wxTE_LEFT;
698 wxTextValidator
Validator(wxFILTER_NUMERIC);
700 wxDefaultPosition, Size,
GetStyle( flags ),
703#if wxUSE_ACCESSIBILITY
707 mpWind->SetName(wxStripMenuCodes(translated));
717 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
718 wxTextCtrl * pTextCtrl;
721 wxDefaultPosition, wxDefaultSize,
GetStyle( wxTE_MULTILINE ));
722#if wxUSE_ACCESSIBILITY
728 pTextCtrl->SetInsertionPoint( 0 );
729 pTextCtrl->ShowPosition( 0 );
748 translatedValue, wxDefaultPosition, wxDefaultSize,
750 mpWind->SetName(translatedValue);
758 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListBox);
759 wxListBox * pListBox;
762 wxDefaultPosition, wxDefaultSize, choices,
GetStyle(0));
763 pListBox->SetMinSize( wxSize( 120,150 ));
773 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxGrid);
777 wxDefaultSize,
GetStyle( wxWANTS_CHARS ));
778 pGrid->SetMinSize( wxSize( 120, 150 ));
784 std::initializer_list<const ListControlColumn> columns,
785 long listControlStyles
790 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListCtrl);
791 wxListCtrl * pListCtrl;
794 wxDefaultPosition, wxDefaultSize,
GetStyle( wxLC_ICON ));
795 pListCtrl->SetMinSize( wxSize( 120,150 ));
804 std::initializer_list<const ListControlColumn> columns,
805 long listControlStyles
810 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListCtrl);
811 wxListCtrl * pListCtrl;
814 wxDefaultPosition, wxSize(230,120),
815 GetStyle( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER ));
825 wxListCtrl *pListCtrl,
826 long listControlStyles,
827 std::initializer_list<const ListControlColumn> columns )
834 for (
auto style = 1l; style <= listControlStyles; style <<= 1 )
835 if ( (style & listControlStyles) )
836 pListCtrl->SetSingleStyle(style,
true);
840 columns.size() > 0 &&
begin(columns)->format == wxLIST_FORMAT_RIGHT;
845 pListCtrl->InsertColumn( iCol++, wxString{} );
847 for (
auto &column : columns)
848 pListCtrl->InsertColumn(
849 iCol++, column.heading.Translation(), column.format, column.width );
852 pListCtrl->DeleteColumn( 0 );
859 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTreeCtrl);
860 wxTreeCtrl * pTreeCtrl;
864 pTreeCtrl->SetMinSize( wxSize( 120,650 ));
875 wxBitmapButton * pBtn;
877 wxDefaultPosition, wxDefaultSize,
GetStyle( wxBU_AUTODRAW ) );
878 pBtn->SetWindowStyle( wxBORDER_NONE );
879 pBtn->SetCanFocus(
false);
902 pBox->SetLabel( translated );
906#if wxUSE_ACCESSIBILITY
910 pBox->SetName(wxT(
"\a"));
913 pBox->SetName( wxStripMenuCodes( translated ) );
914 mpSubSizer = std::make_unique<wxStaticBoxSizer>(
943 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxScrolledWindow);
945 wxScrolledWindow * pScroller;
948 pScroller->SetScrollRate( 20,20 );
951 pScroller->SetName(wxT(
"\a"));
952 pScroller->SetLabel(wxT(
"\a"));
976 wxSize ScrollSize =
mpSizer->GetMinSize();
977 int yMin = ScrollSize.y+4;
978 int xMin = ScrollSize.x+4;
985 mpParent->SetMinSize( wxSize(xMin, yMin) );
995 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1002 mpWind->SetBackgroundColour(
1004 ? wxColour( 190,200,230) :
1005 wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
1031 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxNotebook);
1032 wxNotebook * pNotebook;
1034 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1052 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSimplebook);
1053 wxSimplebook * pNotebook;
1055 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1075 auto pNotebook =
static_cast< wxBookCtrlBase*
>(
mpParent );
1077 const auto translated = Name.Translation();
1078 pPage->SetName(translated);
1108 const wxPoint& pos = wxDefaultPosition,
1109 const wxSize&
size = wxDefaultSize,
1110 long style = wxTAB_TRAVERSAL ) :
1115 void OnPaint( wxPaintEvent &event );
1117 DECLARE_EVENT_TABLE()
1137 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1142 mpWind->SetBackgroundColour(
1143 wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
1173 mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
1190 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1199 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1217 mpSubSizer = std::make_unique<wxWrapSizer>(wxHORIZONTAL, 0);
1234 mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1251 mpShuttle->TransferWrappedType( Name, WrappedRef );
1269 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1270 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1279 wxASSERT( pCheckBox );
1285 wxASSERT( pCheckBox );
1286 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1305 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1306 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1315 wxASSERT( pCheckBox );
1321 wxASSERT( pCheckBox );
1322 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1342 wxSpinCtrl * pSpinCtrl=NULL;
1344 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1345 pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1354 wxASSERT( pSpinCtrl );
1360 wxASSERT( pSpinCtrl );
1361 pSpinCtrl->SetValue( WrappedRef.
ReadAsInt() );
1380 wxTextCtrl * pTextBox=NULL;
1382 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1383 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1392 wxASSERT( pTextBox );
1398 wxASSERT( pTextBox );
1418 wxTextCtrl * pTextBox=NULL;
1420 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1421 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1430 wxASSERT( pTextBox );
1436 wxASSERT( pTextBox );
1455 wxSlider * pSlider=NULL;
1468 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1469 pSlider = wxDynamicCast(pWnd, wxSlider);
1470 wxASSERT( pSlider );
1476 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1477 pSlider = wxDynamicCast(pWnd, wxSlider);
1478 wxASSERT( pSlider );
1479 pSlider->SetValue( WrappedRef.
ReadAsInt() );
1501 wxChoice * pChoice=NULL;
1506 pChoice =
AddChoice( Prompt, choices, Selected );
1515 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1516 pChoice = wxDynamicCast(pWnd, wxChoice);
1517 wxASSERT( pChoice );
1518 Selected = pChoice->GetSelection();
1523 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1524 pChoice = wxDynamicCast(pWnd, wxChoice);
1525 wxASSERT( pChoice );
1526 pChoice->SetSelection( Selected );
1548 wxASSERT( !Temp.empty() );
1555 wxRadioButton * pRadioButton = NULL;
1564 wxDefaultPosition, wxDefaultSize,
1571 pRadioButton->SetValue( value );
1573 pRadioButton->SetName(wxStripMenuCodes(Prompt));
1581 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1582 pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1583 wxASSERT( pRadioButton );
1584 if( pRadioButton->GetValue() )
1592 return pRadioButton;
1697 double &pos,
const double max,
const double min )
1705 float &pos,
const float fMin,
const float fMax)
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;
1716 float &pos,
const float fMin,
const float fMax)
1718 int iVal=(pos-fMin)*100.0/(fMax-fMin);
1723 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1724 pos = iVal*(fMax-fMin)*0.01+fMin;
1734 auto result =
TieChoice( Prompt, Index, choices );
1735 if ( Index >= 0 && Index < choices.size() )
1736 Selected = choices[ Index ];
1753 if( n == wxNOT_FOUND )
1763 if( n== wxNOT_FOUND )
1766 if( n < (
int)Choices.size() )
1823 return (iStep==1) || (iStep==2);
1828 return (iStep==1) || (iStep==2);
1832 return (iStep==2) || (iStep==3);
1847 wxCheckBox * pCheck=NULL;
1864 wxCheckBox * pCheck=NULL;
1883 wxSlider * pSlider=NULL;
1902 wxSpinCtrl * pSpinCtrl=NULL;
1920 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1938 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1956 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1976 choiceSetting.
Read();
1978 const auto &symbols = choiceSetting.
GetSymbols();
1979 const auto &SettingName = choiceSetting.
Key();
1981 const auto &Choices = symbols.GetMsgids();
1982 const auto &InternalChoices = symbols.GetInternals();
1984 wxChoice * pChoice=(wxChoice*)NULL;
1988 wxString TempStr = Default;
2014 const std::vector<int> * pInternalChoices,
2015 int iNoMatchSelector)
2017 auto fn = [](
int arg){
return wxString::Format(
"%d", arg ); };
2020 if ( pInternalChoices )
2022 transform_container<wxArrayStringEx>(*pInternalChoices,
fn);
2024 for (
int ii = 0; ii < (int)Choices.size(); ++ii )
2025 InternalChoices.push_back(
fn( ii ) );
2032 if ( pInternalChoices )
2035 defaultIndex = Default;
2036 if ( defaultIndex < 0 || defaultIndex >= (
int)Choices.size() )
2086 wxWindow *pWind, wxWindow *pDlg )
2091 pWind->SetMinSize( pWind->GetBestSize() );
2093 pWind->SetMinSize( item.
mMinSize );
2098 else if ( step == 1) {
2110 if (
auto pButton =
dynamic_cast< wxBitmapButton*
>( pWind ))
2123 pWind->Enable(
false );
2126 pWind->Connect( pair.first, pair.second,
nullptr, pDlg );
2135 int useFlags = Flags;
2167 if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
2237#ifdef EXPERIMENTAL_TRACK_PANEL
2240#include "../extnpanel-src/GuiWaveTrack.h"
2244 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize)
2250 Init( vertical, minSize );
2261 mpShuttle = std::make_unique<ShuttlePrefs>();
2286 wxASSERT(parent != NULL);
2290#if defined(__WXMAC__)
2292#elif defined(__WXGTK20__)
2294#elif defined(__WXMSW__)
2295 wxButton b(parent, 0, wxEmptyString);
2296 margin = b.ConvertDialogToPixels(wxSize(2, 0)).x;
2298 wxButton b(parent, 0, wxEmptyString);
2299 margin = b->ConvertDialogToPixels(wxSize(4, 0)).x;
2304 auto bs = std::make_unique<wxStdDialogButtonSizer>();
2306 const auto makeButton =
2307 [parent]( wxWindowID
id,
const wxString
label = {} ) {
2309 result->SetName( result->GetLabel() );
2315 b = makeButton( wxID_OK );
2322 bs->AddButton( makeButton( wxID_CANCEL ) );
2327 b = makeButton( wxID_YES );
2334 bs->AddButton( makeButton( wxID_NO ) );
2339 b = makeButton( wxID_APPLY );
2346 bs->AddButton( makeButton( wxID_CANCEL,
XO(
"&Close").Translation() ) );
2349#if defined(__WXMSW__)
2356 b->SetToolTip(
XO(
"Help").Translation() );
2357 b->SetLabel(
XO(
"Help").Translation());
2358 b->SetName( b->GetLabel() );
2365 bs->Add( makeButton(
ePreviewID,
XO(
"&Preview").Translation() ),
2366 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2370 bs->Add( makeButton(
ePreviewDryID,
XO(
"Dry Previe&w").Translation() ),
2371 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2377 bs->Add( makeButton(
eSettingsID,
XO(
"&Settings").Translation() ),
2378 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2384 bs->Add( extra, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2388 bs->AddStretchSpacer();
2391 size_t lastLastSpacer = 0;
2392 size_t lastSpacer = 0;
2393 wxSizerItemList & list = bs->GetChildren();
2394 for(
size_t i = 0, cnt = list.size(); i < cnt; i++ )
2396 if( list[i]->IsSpacer() )
2402 lastLastSpacer = lastSpacer;
2409 b = makeButton(
eDebugID,
XO(
"Debu&g").Translation() );
2410 bs->Insert( ++lastLastSpacer, b, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2413#if !defined(__WXMSW__)
2427 b->SetToolTip(
XO(
"Help").Translation() );
2428 b->SetLabel(
XO(
"Help").Translation());
2429 b->SetName( b->GetLabel() );
2430 bs->Add( b, 0, wxALIGN_CENTER );
2435 auto s = std::make_unique<wxBoxSizer>( wxVERTICAL );
2436 s->Add( bs.release(), 1, wxEXPAND | wxALL, 7 );
2439 return std::unique_ptr<wxSizer>{ s.release() };
2465 return mpSizer->Add( width, height, prop );
2471 transform_container<wxArrayStringEx>(
2479 for(
size_t i = 0; i < items.size(); i++ )
2484 window->GetTextExtent(items[i], &x, &y );
2493#if defined(__WXMAC__)
2495#elif defined(__WXMSW__)
2497#elif defined(__WXGTK__)
2503 window->SetMinSize( { maxw, -1 } );
2523 return transform_range<TranslatableStrings>(
2524 strings, strings + nStrings,
2531 return Msgids( strings.data(), strings.size() );
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
std::unique_ptr< wxSizer > CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
void SetIfCreated(wxChoice *&Var, wxChoice *Val)
const int nMaxNestedSizers
std::vector< TranslatableString > TranslatableStrings
This specialization of Setting for bool adds a Toggle method to negate the saved value.
bool Write(const wxString &value)
const wxString & Key() const
const EnumValueSymbols & GetSymbols() const
const EnumValueSymbol & Default() const
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
const wxString & Internal() const
const TranslatableString & Msgid() const
const wxString Translation() const
Specialization of Setting for double.
Specialization of Setting for int.
An InvisiblePanel is a panel which does not repaint its own background.
InvisiblePanel(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void OnPaint(wxPaintEvent &event)
void OnErase(wxEraseEvent &)
const SettingPath & GetPath() const
const T & GetDefault() const
Base class for shuttling data to and from a GUI.
wxSimplebook * StartSimplebook()
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
int GetBorder() const noexcept
wxNotebookPage * StartNotebookPage(const TranslatableString &Name)
long GetStyle(long Style)
wxCheckBox * AddCheckBoxOnRight(const TranslatableString &Prompt, bool Selected)
wxComboBox * AddCombo(const TranslatableString &Prompt, const wxString &Selected, const wxArrayStringEx &choices)
virtual wxTextCtrl * TieIntegerTextBox(const TranslatableString &Prompt, const IntSetting &Setting, const int nChars)
ShuttleGuiBase(wxWindow *pParent, teShuttleMode ShuttleMode, bool vertical, wxSize minSize)
void DoDataShuttle(const wxString &Name, WrappedType &WrappedRef)
void StartRadioButtonGroup(ChoiceSetting &Setting)
Call this before any TieRadioButton calls.
wxPanel * StartPanel(int iStyle=0)
wxNotebook * StartNotebook()
wxString mRadioValueString
The index of this radio item. -1 for none.
wxSlider * TieVSlider(const TranslatableString &Prompt, float &pos, const float fMin, const float fMax)
wxCheckBox * AddCheckBox(const TranslatableString &Prompt, bool Selected)
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
DialogDefinition::Item mItem
void UpdateSizersAtStart()
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
static void ApplyItem(int step, const DialogDefinition::Item &item, wxWindow *pWind, wxWindow *pDlg)
wxTextCtrl * AddNumericTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
void AddUnits(const TranslatableString &Prompt, int wrapWidth=0)
Left aligned text string.
int TranslateToIndex(const wxString &Value, const wxArrayStringEx &Choices)
String-to-Index.
virtual wxChoice * TieNumberAsChoice(const TranslatableString &Prompt, IntSetting &Setting, const TranslatableStrings &Choices, const std::vector< int > *pInternalChoices=nullptr, int iNoMatchSelector=0)
wxSpinCtrl * AddSpinCtrl(const TranslatableString &Prompt, int Value, int Max, int Min)
void SetStretchyRow(int i)
Used to modify an already placed FlexGridSizer to make a row stretchy.
void StartVerticalLay(int iProp=1)
std::vector< EnumValueSymbol > mRadioSymbols
ReadOnlyText * AddReadOnlyText(const TranslatableString &Caption, const wxString &Value)
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
void HandleOptionality(const TranslatableString &Prompt)
wxSlider * DoTieSlider(const TranslatableString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
virtual ~ShuttleGuiBase()
wxBitmapButton * AddBitmapButton(const wxBitmap &Bitmap, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
wxListBox * AddListBox(const wxArrayStringEx &choices)
wxTextCtrl * AddTextWindow(const wxString &Value)
Multiline text box that grows.
void StartWrapLay(int PositionFlags=wxEXPAND, int iProp=0)
void Init(bool vertical, wxSize minSize)
void AddIcon(wxBitmap *pBmp)
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
wxCheckBox * DoTieCheckBoxOnRight(const TranslatableString &Prompt, WrappedType &WrappedRef)
wxCheckBox * TieCheckBoxOnRight(const TranslatableString &Prompt, bool &Var)
void EndRadioButtonGroup()
wxScrolledWindow * StartScroller(int iStyle=0)
wxRadioButton * AddRadioButton(const TranslatableString &Prompt, int selector=0, int initValue=0)
wxString TranslateFromIndex(const int nIn, const wxArrayStringEx &Choices)
Index-to-String.
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
std::optional< WrappedType > mRadioValue
The setting controlled by a group.
wxSpinCtrl * TieSpinCtrl(const TranslatableString &Prompt, int &Value, const int max, const int min=0)
wxString mRadioSettingName
ShuttleGuiBase & Prop(int iProp)
wxWindow * AddWindow(wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE)
wxCheckBox * DoTieCheckBox(const TranslatableString &Prompt, WrappedType &WrappedRef)
void AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
wxRadioButton * AddRadioButtonToGroup(const TranslatableString &Prompt, int selector=1, int initValue=0)
wxSpinCtrl * DoTieSpinCtrl(const TranslatableString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
wxSlider * AddSlider(const TranslatableString &Prompt, int pos, int Max, int Min=0)
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
std::unique_ptr< Shuttle > mpShuttle
int mRadioCount
The wrapped value associated with the active radio button.
void UpdateSizersCore(bool bPrepend, int Flags, bool prompt=false)
wxChoice * AddChoice(const TranslatableString &Prompt, const TranslatableStrings &choices, int Selected=-1)
wxTextCtrl * DoTieNumericTextBox(const TranslatableString &Prompt, WrappedType &WrappedRef, const int nChars)
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
wxListCtrl * AddListControlReportMode(std::initializer_list< const ListControlColumn > columns={}, long listControlStyles=0)
wxSizer * pSizerStack[nMaxNestedSizers]
void AddConstTextBox(const TranslatableString &Caption, const TranslatableString &Value)
Single line text box of fixed size.
wxTextCtrl * DoTieTextBox(const TranslatableString &Prompt, WrappedType &WrappedRef, const int nChars)
wxListCtrl * AddListControl(std::initializer_list< const ListControlColumn > columns={}, long listControlStyles=0)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
void AddFixedText(const TranslatableString &Str, bool bCenter=false, int wrapWidth=0)
void SetProportions(int Default)
wxSlider * TieSlider(const TranslatableString &Prompt, int &pos, const int max, const int min=0)
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
wxPanel * StartInvisiblePanel()
void AddTitle(const TranslatableString &Prompt, int wrapWidth=0)
Centred text string.
wxRadioButton * TieRadioButton()
This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair.
void DoInsertListColumns(wxListCtrl *pListCtrl, long listControlStyles, std::initializer_list< const ListControlColumn > columns)
wxRadioButton * DoAddRadioButton(const TranslatableString &Prompt, int style, int selector, int initValue)
Unwrapped string value.
std::unique_ptr< wxSizer > mpSubSizer
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
wxSizerItem * AddSpace(int width, int height, int prop=0)
ShuttleGui & Optional(bool &bVar)
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
ShuttleGui(wxWindow *pParent, teShuttleMode ShuttleMode, bool vertical=true, wxSize minSize={ 250, 100 })
static void SetMinSize(wxWindow *window, const TranslatableStrings &items)
Specialization of Setting for strings.
wxBitmap & Bitmap(int iIndex)
Holds a msgid for the translation catalog; may also bind format arguments.
wxString StrippedTranslation() const
wxString Translation() const
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
A Validator is an object which checks whether a wxVariant satisfies a certain criterion....
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
void WriteToAsInt(const int InInt)
void WriteToAsBool(const bool InBool)
void WriteToAsString(const wxString &InStr)
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
std::function< void(wxWindow *) > mValidatorSetter
std::vector< std::pair< wxEventType, wxObjectEventFunction > > mRootConnections
TranslatableString mToolTip
TranslatableString mNameSuffix