107#include <wx/wxprec.h>
109#include <wx/listctrl.h>
110#include <wx/notebook.h>
111#include <wx/simplebook.h>
112#include <wx/treectrl.h>
113#include <wx/spinctrl.h>
114#include <wx/stattext.h>
115#include <wx/bmpbuttn.h>
116#include <wx/wrapsizer.h>
123#if wxUSE_ACCESSIBILITY
128 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize )
131 wxASSERT( (pParent != NULL ) || ( ShuttleMode !=
eIsCreating));
135 Init( vertical, minSize );
170 wxWindow * pGrandParent =
mpParent->GetParent();
173 mpSizer = pGrandParent->GetSizer();
181 mpSizer =
safenew wxBoxSizer(vertical ? wxVERTICAL : wxHORIZONTAL));
205 wxFlexGridSizer *pSizer = wxDynamicCast(
mpSizer, wxFlexGridSizer);
207 pSizer->AddGrowableCol( i, 1 );
215 wxFlexGridSizer *pSizer = wxDynamicCast(
mpSizer, wxFlexGridSizer);
217 pSizer->AddGrowableRow( i, 1 );
252 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
256 text->Wrap(wrapWidth);
257 mpWind->SetName(wxStripMenuCodes(translated));
270 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
274 text->Wrap(wrapWidth);
275 mpWind->SetName(translated);
287 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
291 text->Wrap(wrapWidth);
292 mpWind->SetName(translated);
320 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxCheckBox);
321 wxCheckBox * pCheckBox;
325 pCheckBox->SetValue(Selected);
326 if (realPrompt.empty()) {
329#if wxUSE_ACCESSIBILITY
333 pCheckBox->SetName(
wxT(
"\a"));
348 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxCheckBox);
349 wxCheckBox * pCheckBox;
353 pCheckBox->SetValue(Selected);
364 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxButton);
368 translated, wxDefaultPosition, wxDefaultSize,
370 mpWind->SetName(wxStripMenuCodes(translated));
379 const wxBitmap &Bitmap,
int PositionFlags,
bool setDefault)
383 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxBitmapButton);
384 wxBitmapButton * pBtn;
386 wxDefaultPosition, wxDefaultSize,
GetStyle( wxBU_AUTODRAW ) );
387 pBtn->SetBackgroundColour(
388 wxColour( 246,246,243));
404 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxChoice);
413 transform_container<wxArrayString>(
417 pChoice->SetMinSize( { 180, -1 } );
419#if wxUSE_ACCESSIBILITY
425 if ( Selected >= 0 && Selected < (
int)choices.size() )
426 pChoice->SetSelection( Selected );
447 miId, translated, wxDefaultPosition, wxDefaultSize,
451 text->Wrap( wrapWidth );
452 mpWind->SetName(wxStripMenuCodes(translated));
464 bool bCenter,
int PositionFlags,
int wrapWidth )
469 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxStaticText);
471 wxStaticText *pStatic;
473 wxDefaultPosition, wxDefaultSize,
477 text->Wrap( wrapWidth );
478 mpWind->SetName(wxStripMenuCodes(translated));
499 auto style =
GetStyle( wxBORDER_NONE );
510 wxDefaultPosition, wxDefaultSize,
GetStyle( style ));
511 mpWind->SetName(wxStripMenuCodes(translated));
513 return pReadOnlyText;
525 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxComboBox);
529 int n = choices.size();
532 wxString Choices[50];
535 Choices[i] = choices[i];
540 mpWind->SetName(wxStripMenuCodes(translated));
555 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxRadioButton);
556 wxRadioButton * pRad;
558 wxDefaultPosition, wxDefaultSize,
GetStyle( style ) );
559 mpWind->SetName(wxStripMenuCodes(translated));
561 pRad->SetValue(
true );
563 pRad->SetValue( selector == initValue );
595 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSlider);
603 GetStyle( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS )
605#if wxUSE_ACCESSIBILITY
623 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSpinCtrl);
624 wxSpinCtrl * pSpinCtrl;
627 wxDefaultPosition, wxDefaultSize,
628 GetStyle( wxSP_VERTICAL | wxSP_ARROW_KEYS ),
631 mpWind->SetName(wxStripMenuCodes(translated));
645 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
646 wxTextCtrl * pTextCtrl;
647 wxSize Size(wxDefaultSize);
651 mpDlg->GetTextExtent(
wxT(
"9"), &width,
nullptr );
652 Size.SetWidth( nChars * width );
656#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
657 long flags = wxTE_RIGHT;
659 long flags = wxTE_LEFT;
663 wxDefaultPosition, Size,
GetStyle( flags ));
664#if wxUSE_ACCESSIBILITY
668 mpWind->SetName(wxStripMenuCodes(translated));
681 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
682 wxTextCtrl * pTextCtrl;
683 wxSize Size(wxDefaultSize);
686 Size.SetWidth( nChars *5 );
690#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
691 long flags = wxTE_RIGHT;
693 long flags = wxTE_LEFT;
696 wxTextValidator
Validator(wxFILTER_NUMERIC);
698 wxDefaultPosition, Size,
GetStyle( flags ),
701#if wxUSE_ACCESSIBILITY
705 mpWind->SetName(wxStripMenuCodes(translated));
715 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
716 wxTextCtrl * pTextCtrl;
719 wxDefaultPosition, wxDefaultSize,
GetStyle( wxTE_MULTILINE ));
720#if wxUSE_ACCESSIBILITY
726 pTextCtrl->SetInsertionPoint( 0 );
727 pTextCtrl->ShowPosition( 0 );
746 translatedValue, wxDefaultPosition, wxDefaultSize,
748 mpWind->SetName(translatedValue);
756 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListBox);
757 wxListBox * pListBox;
760 wxDefaultPosition, wxDefaultSize, choices,
GetStyle(0));
761 pListBox->SetMinSize( wxSize( 120,150 ));
771 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxGrid);
775 wxDefaultSize,
GetStyle( wxWANTS_CHARS ));
776 pGrid->SetMinSize( wxSize( 120, 150 ));
782 std::initializer_list<const ListControlColumn> columns,
783 long listControlStyles
788 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListCtrl);
789 wxListCtrl * pListCtrl;
792 wxDefaultPosition, wxDefaultSize,
GetStyle( wxLC_ICON ));
793 pListCtrl->SetMinSize( wxSize( 120,150 ));
802 std::initializer_list<const ListControlColumn> columns,
803 long listControlStyles
808 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListCtrl);
809 wxListCtrl * pListCtrl;
812 wxDefaultPosition, wxSize(230,120),
813 GetStyle( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER ));
823 wxListCtrl *pListCtrl,
824 long listControlStyles,
825 std::initializer_list<const ListControlColumn> columns )
832 for (
auto style = 1l; style <= listControlStyles; style <<= 1 )
833 if ( (style & listControlStyles) )
834 pListCtrl->SetSingleStyle(style,
true);
838 columns.size() > 0 &&
begin(columns)->format == wxLIST_FORMAT_RIGHT;
843 pListCtrl->InsertColumn( iCol++, wxString{} );
845 for (
auto &column : columns)
846 pListCtrl->InsertColumn(
847 iCol++, column.heading.Translation(), column.format, column.width );
850 pListCtrl->DeleteColumn( 0 );
857 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTreeCtrl);
858 wxTreeCtrl * pTreeCtrl;
862 pTreeCtrl->SetMinSize( wxSize( 120,650 ));
873 wxBitmapButton * pBtn;
875 wxDefaultPosition, wxDefaultSize,
GetStyle( wxBU_AUTODRAW ) );
876 pBtn->SetWindowStyle( wxBORDER_NONE );
877 pBtn->SetCanFocus(
false);
900 pBox->SetLabel( translated );
904#if wxUSE_ACCESSIBILITY
908 pBox->SetName(
wxT(
"\a"));
911 pBox->SetName( wxStripMenuCodes( translated ) );
912 mpSubSizer = std::make_unique<wxStaticBoxSizer>(
941 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxScrolledWindow);
943 wxScrolledWindow * pScroller;
946 pScroller->SetScrollRate( 20,20 );
949 pScroller->SetName(
wxT(
"\a"));
950 pScroller->SetLabel(
wxT(
"\a"));
974 wxSize ScrollSize =
mpSizer->GetMinSize();
975 int yMin = ScrollSize.y+4;
976 int xMin = ScrollSize.x+4;
983 mpParent->SetMinSize( wxSize(xMin, yMin) );
993 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1000 mpWind->SetBackgroundColour(
1002 ? wxColour( 190,200,230) :
1003 wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
1029 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxNotebook);
1030 wxNotebook * pNotebook;
1032 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1050 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSimplebook);
1051 wxSimplebook * pNotebook;
1053 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1073 auto pNotebook =
static_cast< wxBookCtrlBase*
>(
mpParent );
1075 const auto translated = Name.Translation();
1076 pPage->SetName(translated);
1106 const wxPoint& pos = wxDefaultPosition,
1107 const wxSize&
size = wxDefaultSize,
1108 long style = wxTAB_TRAVERSAL ) :
1113 void OnPaint( wxPaintEvent &event );
1115 DECLARE_EVENT_TABLE()
1135 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1140 mpWind->SetBackgroundColour(
1141 wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
1171 mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
1188 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1197 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1215 mpSubSizer = std::make_unique<wxWrapSizer>(wxHORIZONTAL, 0);
1232 mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1249 mpShuttle->TransferWrappedType( Name, WrappedRef );
1267 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1268 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1277 wxASSERT( pCheckBox );
1283 wxASSERT( pCheckBox );
1284 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1303 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1304 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1313 wxASSERT( pCheckBox );
1319 wxASSERT( pCheckBox );
1320 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1340 wxSpinCtrl * pSpinCtrl=NULL;
1342 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1343 pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1352 wxASSERT( pSpinCtrl );
1358 wxASSERT( pSpinCtrl );
1359 pSpinCtrl->SetValue( WrappedRef.
ReadAsInt() );
1378 wxTextCtrl * pTextBox=NULL;
1380 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1381 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1390 wxASSERT( pTextBox );
1396 wxASSERT( pTextBox );
1416 wxTextCtrl * pTextBox=NULL;
1418 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1419 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1428 wxASSERT( pTextBox );
1434 wxASSERT( pTextBox );
1453 wxSlider * pSlider=NULL;
1466 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1467 pSlider = wxDynamicCast(pWnd, wxSlider);
1468 wxASSERT( pSlider );
1474 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1475 pSlider = wxDynamicCast(pWnd, wxSlider);
1476 wxASSERT( pSlider );
1477 pSlider->SetValue( WrappedRef.
ReadAsInt() );
1499 wxChoice * pChoice=NULL;
1504 pChoice =
AddChoice( Prompt, choices, Selected );
1513 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1514 pChoice = wxDynamicCast(pWnd, wxChoice);
1515 wxASSERT( pChoice );
1516 Selected = pChoice->GetSelection();
1521 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1522 pChoice = wxDynamicCast(pWnd, wxChoice);
1523 wxASSERT( pChoice );
1524 pChoice->SetSelection( Selected );
1546 wxASSERT( !Temp.empty() );
1553 wxRadioButton * pRadioButton = NULL;
1562 wxDefaultPosition, wxDefaultSize,
1569 pRadioButton->SetValue( value );
1571 pRadioButton->SetName(wxStripMenuCodes(Prompt));
1579 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1580 pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1581 wxASSERT( pRadioButton );
1582 if( pRadioButton->GetValue() )
1590 return pRadioButton;
1695 double &pos,
const double max,
const double min )
1703 float &pos,
const float fMin,
const float fMax)
1705 const float RoundFix=0.0000001f;
1706 int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1707 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1708 pos = iVal*(fMax-fMin)*0.01+fMin;
1714 float &pos,
const float fMin,
const float fMax)
1716 int iVal=(pos-fMin)*100.0/(fMax-fMin);
1721 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1722 pos = iVal*(fMax-fMin)*0.01+fMin;
1732 auto result =
TieChoice( Prompt, Index, choices );
1733 if ( Index >= 0 && Index < choices.size() )
1734 Selected = choices[ Index ];
1751 if( n == wxNOT_FOUND )
1761 if( n== wxNOT_FOUND )
1764 if( n < (
int)Choices.size() )
1821 return (iStep==1) || (iStep==2);
1826 return (iStep==1) || (iStep==2);
1830 return (iStep==2) || (iStep==3);
1845 wxCheckBox * pCheck=NULL;
1862 wxCheckBox * pCheck=NULL;
1881 wxSlider * pSlider=NULL;
1900 wxSpinCtrl * pSpinCtrl=NULL;
1918 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1936 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1954 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1974 choiceSetting.
Read();
1976 const auto &symbols = choiceSetting.
GetSymbols();
1977 const auto &SettingName = choiceSetting.
Key();
1979 const auto &Choices = symbols.GetMsgids();
1980 const auto &InternalChoices = symbols.GetInternals();
1982 wxChoice * pChoice=(wxChoice*)NULL;
1986 wxString TempStr = Default;
2012 const std::vector<int> * pInternalChoices,
2013 int iNoMatchSelector)
2015 auto fn = [](
int arg){
return wxString::Format(
"%d", arg ); };
2018 if ( pInternalChoices )
2020 transform_container<wxArrayStringEx>(*pInternalChoices,
fn);
2022 for (
int ii = 0; ii < (int)Choices.size(); ++ii )
2023 InternalChoices.push_back(
fn( ii ) );
2030 if ( pInternalChoices )
2033 defaultIndex = Default;
2034 if ( defaultIndex < 0 || defaultIndex >= (
int)Choices.size() )
2084 wxWindow *pWind, wxWindow *pDlg )
2089 pWind->SetMinSize( pWind->GetBestSize() );
2091 pWind->SetMinSize( item.
mMinSize );
2096 else if ( step == 1) {
2108 if (
auto pButton =
dynamic_cast< wxBitmapButton*
>( pWind ))
2121 pWind->Enable(
false );
2124 pWind->Connect( pair.first, pair.second,
nullptr, pDlg );
2133 int useFlags = Flags;
2165 if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
2236 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize)
2242 Init( vertical, minSize );
2253 mpShuttle = std::make_unique<ShuttlePrefs>();
2278 wxASSERT(parent != NULL);
2282#if defined(__WXMAC__)
2284#elif defined(__WXGTK20__)
2286#elif defined(__WXMSW__)
2287 wxButton b(parent, 0, wxEmptyString);
2288 margin = b.ConvertDialogToPixels(wxSize(2, 0)).x;
2290 wxButton b(parent, 0, wxEmptyString);
2291 margin = b->ConvertDialogToPixels(wxSize(4, 0)).x;
2296 auto bs = std::make_unique<wxStdDialogButtonSizer>();
2298 const auto makeButton =
2299 [parent]( wxWindowID
id,
const wxString
label = {} ) {
2301 result->SetName( result->GetLabel() );
2307 b = makeButton( wxID_OK );
2314 bs->AddButton( makeButton( wxID_CANCEL ) );
2319 b = makeButton( wxID_YES );
2326 bs->AddButton( makeButton( wxID_NO ) );
2331 b = makeButton( wxID_APPLY );
2338 bs->AddButton( makeButton( wxID_CANCEL,
XO(
"&Close").Translation() ) );
2341#if defined(__WXMSW__)
2348 b->SetToolTip(
XO(
"Help").Translation() );
2349 b->SetLabel(
XO(
"Help").Translation());
2350 b->SetName( b->GetLabel() );
2357 bs->Add( makeButton(
ePreviewID,
XO(
"&Preview").Translation() ),
2358 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2362 bs->Add( makeButton(
ePreviewDryID,
XO(
"Dry Previe&w").Translation() ),
2363 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2369 bs->Add( makeButton(
eSettingsID,
XO(
"&Settings").Translation() ),
2370 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2376 bs->Add( extra, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2380 bs->AddStretchSpacer();
2383 size_t lastLastSpacer = 0;
2384 size_t lastSpacer = 0;
2385 wxSizerItemList & list = bs->GetChildren();
2386 for(
size_t i = 0, cnt = list.size(); i < cnt; i++ )
2388 if( list[i]->IsSpacer() )
2394 lastLastSpacer = lastSpacer;
2401 b = makeButton(
eDebugID,
XO(
"Debu&g").Translation() );
2402 bs->Insert( ++lastLastSpacer, b, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2405#if !defined(__WXMSW__)
2419 b->SetToolTip(
XO(
"Help").Translation() );
2420 b->SetLabel(
XO(
"Help").Translation());
2421 b->SetName( b->GetLabel() );
2422 bs->Add( b, 0, wxALIGN_CENTER );
2427 auto s = std::make_unique<wxBoxSizer>( wxVERTICAL );
2428 s->Add( bs.release(), 1, wxEXPAND | wxALL, 7 );
2431 return std::unique_ptr<wxSizer>{ s.release() };
2457 return mpSizer->Add( width, height, prop );
2463 transform_container<wxArrayStringEx>(
2471 for(
size_t i = 0; i < items.size(); i++ )
2476 window->GetTextExtent(items[i], &x, &y );
2485#if defined(__WXMAC__)
2487#elif defined(__WXMSW__)
2489#elif defined(__WXGTK__)
2495 window->SetMinSize( { maxw, -1 } );
2515 return transform_range<TranslatableStrings>(
2516 strings, strings + nStrings,
2523 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)
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)
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)
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)
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.
void SetFocus(const WindowPlacement &focus)
Set the window that accepts keyboard input.
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