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>
124#if wxUSE_ACCESSIBILITY
129 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize )
132 wxASSERT( (pParent != NULL ) || ( ShuttleMode !=
eIsCreating));
136 Init( vertical, minSize );
171 wxWindow * pGrandParent =
mpParent->GetParent();
174 mpSizer = pGrandParent->GetSizer();
182 mpSizer =
safenew wxBoxSizer(vertical ? wxVERTICAL : wxHORIZONTAL));
206 wxFlexGridSizer *pSizer = wxDynamicCast(
mpSizer, wxFlexGridSizer);
208 pSizer->AddGrowableCol( i, 1 );
216 wxFlexGridSizer *pSizer = wxDynamicCast(
mpSizer, wxFlexGridSizer);
218 pSizer->AddGrowableRow( i, 1 );
241 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxStaticText);
253 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
257 text->Wrap(wrapWidth);
258 mpWind->SetName(wxStripMenuCodes(translated));
273 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
277 text->Wrap(wrapWidth);
278 mpWind->SetName(translated);
290 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
294 text->Wrap(wrapWidth);
295 mpWind->SetName(translated);
323 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxCheckBox);
324 wxCheckBox * pCheckBox;
328 pCheckBox->SetValue(Selected);
329 if (realPrompt.empty()) {
332#if wxUSE_ACCESSIBILITY
336 pCheckBox->SetName(
wxT(
"\a"));
351 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxCheckBox);
352 wxCheckBox * pCheckBox;
356 pCheckBox->SetValue(Selected);
367 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxButton);
371 translated, wxDefaultPosition, wxDefaultSize,
373 mpWind->SetName(wxStripMenuCodes(translated));
382 const wxBitmap &Bitmap,
int PositionFlags,
bool setDefault)
386 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxBitmapButton);
387 wxBitmapButton * pBtn;
389 wxDefaultPosition, wxDefaultSize,
GetStyle( wxBU_AUTODRAW ) );
390 pBtn->SetBackgroundColour(
391 wxColour( 246,246,243));
407 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxChoice);
416 transform_container<wxArrayString>(
420 pChoice->SetMinSize( { 180, -1 } );
422#if wxUSE_ACCESSIBILITY
428 if ( Selected >= 0 && Selected < (
int)choices.size() )
429 pChoice->SetSelection( Selected );
450 miId, translated, wxDefaultPosition, wxDefaultSize,
454 text->Wrap( wrapWidth );
455 mpWind->SetName(wxStripMenuCodes(translated));
467 bool bCenter,
int PositionFlags,
int wrapWidth )
472 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxStaticText);
474 wxStaticText *pStatic;
476 wxDefaultPosition, wxDefaultSize,
480 text->Wrap( wrapWidth );
481 mpWind->SetName(wxStripMenuCodes(translated));
514 mpWind->SetName(wxStripMenuCodes(translated));
516 return pReadOnlyText;
528 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxComboBox);
532 int n = choices.size();
535 wxString Choices[50];
538 Choices[i] = choices[i];
543 mpWind->SetName(wxStripMenuCodes(translated));
558 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxRadioButton);
559 wxRadioButton * pRad;
562 mpWind->SetName(wxStripMenuCodes(translated));
564 pRad->SetValue(
true );
566 pRad->SetValue( selector == initValue );
598 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSlider);
606 GetStyle( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS )
608#if wxUSE_ACCESSIBILITY
626 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSpinCtrl);
627 wxSpinCtrl * pSpinCtrl;
630 wxDefaultPosition, wxDefaultSize,
631 GetStyle( wxSP_VERTICAL | wxSP_ARROW_KEYS ),
634 mpWind->SetName(wxStripMenuCodes(translated));
642 double Max,
double Min)
667 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
668 wxTextCtrl * pTextCtrl;
669 wxSize
Size(wxDefaultSize);
673 mpDlg->GetTextExtent(
wxT(
"9"), &width,
nullptr );
674 Size.SetWidth( nChars * width );
678#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
679 long flags = wxTE_RIGHT;
681 long flags = wxTE_LEFT;
686#if wxUSE_ACCESSIBILITY
690 mpWind->SetName(wxStripMenuCodes(translated));
704 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
705 wxTextCtrl * pTextCtrl;
706 wxSize
Size(wxDefaultSize);
709 Size.SetWidth( nChars *5 );
713#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
714 long flags = wxTE_RIGHT;
716 long flags = wxTE_LEFT;
720 flags = wxTE_PROCESS_ENTER;
722 wxTextValidator
Validator(wxFILTER_NUMERIC);
727#if wxUSE_ACCESSIBILITY
731 mpWind->SetName(wxStripMenuCodes(translated));
741 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
742 wxTextCtrl * pTextCtrl;
745 wxDefaultPosition, wxDefaultSize,
GetStyle( wxTE_MULTILINE ));
746#if wxUSE_ACCESSIBILITY
752 pTextCtrl->SetInsertionPoint( 0 );
753 pTextCtrl->ShowPosition( 0 );
772 translatedValue, wxDefaultPosition, wxDefaultSize,
774 mpWind->SetName(translatedValue);
782 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListBox);
783 wxListBox * pListBox;
786 wxDefaultPosition, wxDefaultSize, choices,
GetStyle(0));
787 pListBox->SetMinSize( wxSize( 120,150 ));
797 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxGrid);
801 wxDefaultSize,
GetStyle( wxWANTS_CHARS ));
802 pGrid->SetMinSize( wxSize( 120, 150 ));
808 std::initializer_list<const ListControlColumn> columns,
809 long listControlStyles
814 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListCtrl);
815 wxListCtrl * pListCtrl;
818 wxDefaultPosition, wxDefaultSize,
GetStyle( wxLC_ICON ));
819 pListCtrl->SetMinSize( wxSize( 120,150 ));
828 std::initializer_list<const ListControlColumn> columns,
829 long listControlStyles
834 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListCtrl);
835 wxListCtrl * pListCtrl;
838 wxDefaultPosition, wxSize(230,120),
839 GetStyle( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER ));
849 wxListCtrl *pListCtrl,
850 long listControlStyles,
851 std::initializer_list<const ListControlColumn> columns )
859 if ( (
style & listControlStyles) )
860 pListCtrl->SetSingleStyle(
style,
true);
864 columns.size() > 0 &&
begin(columns)->format == wxLIST_FORMAT_RIGHT;
869 pListCtrl->InsertColumn( iCol++, wxString{} );
871 for (
auto &column : columns)
872 pListCtrl->InsertColumn(
873 iCol++, column.heading.Translation(), column.format, column.width );
876 pListCtrl->DeleteColumn( 0 );
883 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTreeCtrl);
884 wxTreeCtrl * pTreeCtrl;
888 pTreeCtrl->SetMinSize( wxSize( 120,650 ));
899 wxBitmapButton * pBtn;
901 wxDefaultPosition, wxDefaultSize,
GetStyle( wxBU_AUTODRAW ) );
902 pBtn->SetWindowStyle( wxBORDER_NONE );
903 pBtn->SetCanFocus(
false);
926 pBox->SetLabel( translated );
930#if wxUSE_ACCESSIBILITY
934 pBox->SetName(
wxT(
"\a"));
937 pBox->SetName( wxStripMenuCodes( translated ) );
938 mpSubSizer = std::make_unique<wxStaticBoxSizer>(
967 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxScrolledWindow);
969 wxScrolledWindow * pScroller;
972 pScroller->SetScrollRate( 20,20 );
975 pScroller->SetName(
wxT(
"\a"));
976 pScroller->SetLabel(
wxT(
"\a"));
1000 wxSize ScrollSize =
mpSizer->GetMinSize();
1001 int yMin = ScrollSize.y+4;
1002 int xMin = ScrollSize.x+4;
1009 mpParent->SetMinSize( wxSize(xMin, yMin) );
1019 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1026 mpWind->SetBackgroundColour(
1028 ? wxColour( 190,200,230) :
1029 wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
1055 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxNotebook);
1056 wxNotebook * pNotebook;
1058 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1076 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSimplebook);
1077 wxSimplebook * pNotebook;
1079 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1099 auto pNotebook =
static_cast< wxBookCtrlBase*
>(
mpParent );
1101 const auto translated = Name.Translation();
1102 pPage->SetName(translated);
1132 const wxPoint& pos = wxDefaultPosition,
1133 const wxSize&
size = wxDefaultSize,
1134 long style = wxTAB_TRAVERSAL ) :
1139 void OnPaint( wxPaintEvent &event );
1141 DECLARE_EVENT_TABLE()
1161 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1166 mpWind->SetBackgroundColour(
1167 wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
1197 mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
1214 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1223 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1241 mpSubSizer = std::make_unique<wxWrapSizer>(wxHORIZONTAL, 0);
1258 mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1275 mpShuttle->TransferWrappedType( Name, WrappedRef );
1293 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1294 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1303 wxASSERT( pCheckBox );
1309 wxASSERT( pCheckBox );
1310 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1329 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1330 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1339 wxASSERT( pCheckBox );
1345 wxASSERT( pCheckBox );
1346 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1366 wxSpinCtrl * pSpinCtrl=NULL;
1368 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1369 pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1378 wxASSERT( pSpinCtrl );
1384 wxASSERT( pSpinCtrl );
1385 pSpinCtrl->SetValue( WrappedRef.
ReadAsInt() );
1407 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1417 wxASSERT( pSpinCtrl );
1423 wxASSERT( pSpinCtrl );
1443 wxTextCtrl * pTextBox=NULL;
1445 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1446 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1455 wxASSERT( pTextBox );
1461 wxASSERT( pTextBox );
1482 wxTextCtrl * pTextBox=NULL;
1484 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1485 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1494 wxASSERT( pTextBox );
1500 wxASSERT( pTextBox );
1519 wxSlider * pSlider=NULL;
1532 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1533 pSlider = wxDynamicCast(pWnd, wxSlider);
1534 wxASSERT( pSlider );
1540 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1541 pSlider = wxDynamicCast(pWnd, wxSlider);
1542 wxASSERT( pSlider );
1543 pSlider->SetValue( WrappedRef.
ReadAsInt() );
1565 wxChoice * pChoice=NULL;
1570 pChoice =
AddChoice( Prompt, choices, Selected );
1579 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1580 pChoice = wxDynamicCast(pWnd, wxChoice);
1581 wxASSERT( pChoice );
1582 Selected = pChoice->GetSelection();
1587 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1588 pChoice = wxDynamicCast(pWnd, wxChoice);
1589 wxASSERT( pChoice );
1590 pChoice->SetSelection( Selected );
1612 wxASSERT( !Temp.empty() );
1619 wxRadioButton * pRadioButton = NULL;
1628 wxDefaultPosition, wxDefaultSize,
1635 pRadioButton->SetValue( value );
1637 pRadioButton->SetName(wxStripMenuCodes(Prompt));
1645 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1646 pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1647 wxASSERT( pRadioButton );
1648 if( pRadioButton->GetValue() )
1656 return pRadioButton;
1719 const double max,
const double min)
1771 double &pos,
const double max,
const double min )
1779 float &pos,
const float fMin,
const float fMax)
1781 const float RoundFix=0.0000001f;
1782 int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1783 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1784 pos = iVal*(fMax-fMin)*0.01+fMin;
1790 float &pos,
const float fMin,
const float fMax)
1792 int iVal=(pos-fMin)*100.0/(fMax-fMin);
1797 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1798 pos = iVal*(fMax-fMin)*0.01+fMin;
1808 auto result =
TieChoice( Prompt, Index, choices );
1809 if ( Index >= 0 && Index < choices.size() )
1810 Selected = choices[ Index ];
1827 if( n == wxNOT_FOUND )
1837 if( n== wxNOT_FOUND )
1840 if( n < (
int)Choices.size() )
1897 return (iStep==1) || (iStep==2);
1902 return (iStep==1) || (iStep==2);
1906 return (iStep==2) || (iStep==3);
1921 wxCheckBox * pCheck=NULL;
1938 wxCheckBox * pCheck=NULL;
1957 wxSlider * pSlider=NULL;
1976 wxSpinCtrl * pSpinCtrl=NULL;
1994 wxTextCtrl * pText=(wxTextCtrl*)NULL;
2012 wxTextCtrl * pText=(wxTextCtrl*)NULL;
2028 const int nChars,
bool acceptEnter)
2030 wxTextCtrl * pText=(wxTextCtrl*)NULL;
2050 choiceSetting.
Read();
2052 const auto &symbols = choiceSetting.
GetSymbols();
2053 const auto &SettingName = choiceSetting.
Key();
2055 const auto &Choices = symbols.GetMsgids();
2056 const auto &InternalChoices = symbols.GetInternals();
2058 wxChoice * pChoice=(wxChoice*)NULL;
2088 const std::vector<int> * pInternalChoices,
2089 int iNoMatchSelector)
2091 auto fn = [](
int arg){
return wxString::Format(
"%d", arg ); };
2094 if ( pInternalChoices )
2096 transform_container<wxArrayStringEx>(*pInternalChoices,
fn);
2098 for (
int ii = 0; ii < (int)Choices.size(); ++ii )
2099 InternalChoices.push_back(
fn( ii ) );
2106 if ( pInternalChoices )
2110 if ( defaultIndex < 0 || defaultIndex >= (
int)Choices.size() )
2160 wxWindow *pWind, wxWindow *pDlg )
2165 pWind->SetMinSize( pWind->GetBestSize() );
2167 pWind->SetMinSize( item.
mMinSize );
2172 else if ( step == 1) {
2184 if (
auto pButton =
dynamic_cast< wxBitmapButton*
>( pWind ))
2197 pWind->Enable(
false );
2200 pWind->Connect( pair.first, pair.second,
nullptr, pDlg );
2209 int useFlags = Flags;
2241 if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
2312 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize)
2318 Init( vertical, minSize );
2329 mpShuttle = std::make_unique<ShuttlePrefs>();
2354 wxASSERT(parent != NULL);
2358#if defined(__WXMAC__)
2360#elif defined(__WXGTK20__)
2362#elif defined(__WXMSW__)
2363 wxButton b(parent, 0, wxEmptyString);
2364 margin = b.ConvertDialogToPixels(wxSize(2, 0)).x;
2366 wxButton b(parent, 0, wxEmptyString);
2367 margin = b->ConvertDialogToPixels(wxSize(4, 0)).x;
2372 auto bs = std::make_unique<wxStdDialogButtonSizer>();
2374 const auto makeButton =
2375 [parent]( wxWindowID
id,
const wxString
label = {} ) {
2377 result->SetName( result->GetLabel() );
2383 b = makeButton( wxID_OK );
2390 bs->AddButton( makeButton( wxID_CANCEL ) );
2395 b = makeButton( wxID_YES );
2402 bs->AddButton( makeButton( wxID_NO ) );
2407 b = makeButton( wxID_APPLY );
2414 bs->AddButton( makeButton( wxID_CANCEL,
XO(
"&Close").Translation() ) );
2417#if defined(__WXMSW__)
2424 b->SetToolTip(
XO(
"Help").Translation() );
2425 b->SetLabel(
XO(
"Help").Translation());
2426 b->SetName( b->GetLabel() );
2433 bs->Add( makeButton(
ePreviewID,
XO(
"&Preview").Translation() ),
2434 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2438 bs->Add( makeButton(
ePreviewDryID,
XO(
"Dry Previe&w").Translation() ),
2439 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2445 bs->Add( makeButton(
eSettingsID,
XO(
"&Settings").Translation() ),
2446 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2452 bs->Add( extra, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2456 bs->AddStretchSpacer();
2459 size_t lastLastSpacer = 0;
2460 size_t lastSpacer = 0;
2461 wxSizerItemList & list = bs->GetChildren();
2462 for(
size_t i = 0, cnt = list.size(); i < cnt; i++ )
2464 if( list[i]->IsSpacer() )
2470 lastLastSpacer = lastSpacer;
2477 b = makeButton(
eDebugID,
XO(
"Debu&g").Translation() );
2478 bs->Insert( ++lastLastSpacer, b, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2481#if !defined(__WXMSW__)
2495 b->SetToolTip(
XO(
"Help").Translation() );
2496 b->SetLabel(
XO(
"Help").Translation());
2497 b->SetName( b->GetLabel() );
2498 bs->Add( b, 0, wxALIGN_CENTER );
2503 auto s = std::make_unique<wxBoxSizer>( wxVERTICAL );
2504 s->Add( bs.release(), 1, wxEXPAND | wxALL, 7 );
2507 return std::unique_ptr<wxSizer>{ s.release() };
2533 return mpSizer->Add( width, height, prop );
2539 transform_container<wxArrayStringEx>(
2547 for(
size_t i = 0; i < items.size(); i++ )
2552 window->GetTextExtent(items[i], &x, &y );
2561#if defined(__WXMAC__)
2563#elif defined(__WXMSW__)
2565#elif defined(__WXGTK__)
2571 window->SetMinSize( { maxw, -1 } );
2591 return transform_range<TranslatableStrings>(
2592 strings, strings + nStrings,
2599 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()
wxStaticText * AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
wxTextCtrl * DoTieNumericTextBox(const TranslatableString &Prompt, WrappedType &WrappedRef, const int nChars, bool acceptEnter=false)
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)
SpinControl * AddSpinControl(const wxSize &size, const TranslatableString &Prompt, double Value, double Max, double Min)
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)
wxPanel * StartInvisiblePanel(int border=0)
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
DialogDefinition::Item mItem
std::unique_ptr< ShuttlePrefs > mpShuttle
void UpdateSizersAtStart()
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
wxTextCtrl * AddNumericTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars, bool acceptEnter=false)
static void ApplyItem(int step, const DialogDefinition::Item &item, wxWindow *pWind, wxWindow *pDlg)
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)
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)
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0, bool acceptEnter=false)
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)
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)
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)
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)
SpinControl * TieSpinControl(const wxSize &size, const TranslatableString &Prompt, double &Value, const double max, const double min=0)
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
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.
SpinControl * DoTieSpinControl(const wxSize &size, const TranslatableString &Prompt, WrappedType &WrappedRef, const double max, const double min=0)
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)
void SetValue(double value)
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 WriteToAsDouble(const double InDouble)
void WriteToAsBool(const bool InBool)
void WriteToAsString(const wxString &InStr)
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
void SetFocus(const WindowPlacement &focus)
Set the window that accepts keyboard input.
const char * begin(const char *str) noexcept
SizeType< float > Size
Alias for SizeType<float>
std::function< void(wxWindow *) > mValidatorSetter
std::vector< std::pair< wxEventType, wxObjectEventFunction > > mRootConnections
TranslatableString mToolTip
TranslatableString mNameSuffix