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 );
240 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxStaticText);
252 auto text =
safenew wxStaticText(
GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize,
256 text->Wrap(wrapWidth);
257 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 );
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));
684 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
685 wxTextCtrl * pTextCtrl;
686 wxSize Size(wxDefaultSize);
689 Size.SetWidth( nChars *5 );
693#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
694 long flags = wxTE_RIGHT;
696 long flags = wxTE_LEFT;
700 flags = wxTE_PROCESS_ENTER;
702 wxTextValidator
Validator(wxFILTER_NUMERIC);
704 wxDefaultPosition, Size,
GetStyle( flags ),
707#if wxUSE_ACCESSIBILITY
711 mpWind->SetName(wxStripMenuCodes(translated));
721 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTextCtrl);
722 wxTextCtrl * pTextCtrl;
725 wxDefaultPosition, wxDefaultSize,
GetStyle( wxTE_MULTILINE ));
726#if wxUSE_ACCESSIBILITY
732 pTextCtrl->SetInsertionPoint( 0 );
733 pTextCtrl->ShowPosition( 0 );
752 translatedValue, wxDefaultPosition, wxDefaultSize,
754 mpWind->SetName(translatedValue);
762 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListBox);
763 wxListBox * pListBox;
766 wxDefaultPosition, wxDefaultSize, choices,
GetStyle(0));
767 pListBox->SetMinSize( wxSize( 120,150 ));
777 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxGrid);
781 wxDefaultSize,
GetStyle( wxWANTS_CHARS ));
782 pGrid->SetMinSize( wxSize( 120, 150 ));
788 std::initializer_list<const ListControlColumn> columns,
789 long listControlStyles
794 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxListCtrl);
795 wxListCtrl * pListCtrl;
798 wxDefaultPosition, wxDefaultSize,
GetStyle( wxLC_ICON ));
799 pListCtrl->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, wxSize(230,120),
819 GetStyle( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER ));
829 wxListCtrl *pListCtrl,
830 long listControlStyles,
831 std::initializer_list<const ListControlColumn> columns )
838 for (
auto style = 1l; style <= listControlStyles; style <<= 1 )
839 if ( (style & listControlStyles) )
840 pListCtrl->SetSingleStyle(style,
true);
844 columns.size() > 0 &&
begin(columns)->format == wxLIST_FORMAT_RIGHT;
849 pListCtrl->InsertColumn( iCol++, wxString{} );
851 for (
auto &column : columns)
852 pListCtrl->InsertColumn(
853 iCol++, column.heading.Translation(), column.format, column.width );
856 pListCtrl->DeleteColumn( 0 );
863 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxTreeCtrl);
864 wxTreeCtrl * pTreeCtrl;
868 pTreeCtrl->SetMinSize( wxSize( 120,650 ));
879 wxBitmapButton * pBtn;
881 wxDefaultPosition, wxDefaultSize,
GetStyle( wxBU_AUTODRAW ) );
882 pBtn->SetWindowStyle( wxBORDER_NONE );
883 pBtn->SetCanFocus(
false);
906 pBox->SetLabel( translated );
910#if wxUSE_ACCESSIBILITY
914 pBox->SetName(
wxT(
"\a"));
917 pBox->SetName( wxStripMenuCodes( translated ) );
918 mpSubSizer = std::make_unique<wxStaticBoxSizer>(
947 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxScrolledWindow);
949 wxScrolledWindow * pScroller;
952 pScroller->SetScrollRate( 20,20 );
955 pScroller->SetName(
wxT(
"\a"));
956 pScroller->SetLabel(
wxT(
"\a"));
980 wxSize ScrollSize =
mpSizer->GetMinSize();
981 int yMin = ScrollSize.y+4;
982 int xMin = ScrollSize.x+4;
989 mpParent->SetMinSize( wxSize(xMin, yMin) );
999 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1006 mpWind->SetBackgroundColour(
1008 ? wxColour( 190,200,230) :
1009 wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
1035 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxNotebook);
1036 wxNotebook * pNotebook;
1038 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1056 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSimplebook);
1057 wxSimplebook * pNotebook;
1059 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1079 auto pNotebook =
static_cast< wxBookCtrlBase*
>(
mpParent );
1081 const auto translated = Name.Translation();
1082 pPage->SetName(translated);
1112 const wxPoint& pos = wxDefaultPosition,
1113 const wxSize&
size = wxDefaultSize,
1114 long style = wxTAB_TRAVERSAL ) :
1119 void OnPaint( wxPaintEvent &event );
1121 DECLARE_EVENT_TABLE()
1141 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1146 mpWind->SetBackgroundColour(
1147 wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
1177 mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
1194 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1203 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1221 mpSubSizer = std::make_unique<wxWrapSizer>(wxHORIZONTAL, 0);
1238 mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1255 mpShuttle->TransferWrappedType( Name, WrappedRef );
1273 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1274 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1283 wxASSERT( pCheckBox );
1289 wxASSERT( pCheckBox );
1290 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1309 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1310 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1319 wxASSERT( pCheckBox );
1325 wxASSERT( pCheckBox );
1326 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1346 wxSpinCtrl * pSpinCtrl=NULL;
1348 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1349 pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1358 wxASSERT( pSpinCtrl );
1364 wxASSERT( pSpinCtrl );
1365 pSpinCtrl->SetValue( WrappedRef.
ReadAsInt() );
1384 wxTextCtrl * pTextBox=NULL;
1386 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1387 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1396 wxASSERT( pTextBox );
1402 wxASSERT( pTextBox );
1423 wxTextCtrl * pTextBox=NULL;
1425 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1426 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1435 wxASSERT( pTextBox );
1441 wxASSERT( pTextBox );
1460 wxSlider * pSlider=NULL;
1473 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1474 pSlider = wxDynamicCast(pWnd, wxSlider);
1475 wxASSERT( pSlider );
1481 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1482 pSlider = wxDynamicCast(pWnd, wxSlider);
1483 wxASSERT( pSlider );
1484 pSlider->SetValue( WrappedRef.
ReadAsInt() );
1506 wxChoice * pChoice=NULL;
1511 pChoice =
AddChoice( Prompt, choices, Selected );
1520 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1521 pChoice = wxDynamicCast(pWnd, wxChoice);
1522 wxASSERT( pChoice );
1523 Selected = pChoice->GetSelection();
1528 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1529 pChoice = wxDynamicCast(pWnd, wxChoice);
1530 wxASSERT( pChoice );
1531 pChoice->SetSelection( Selected );
1553 wxASSERT( !Temp.empty() );
1560 wxRadioButton * pRadioButton = NULL;
1569 wxDefaultPosition, wxDefaultSize,
1576 pRadioButton->SetValue( value );
1578 pRadioButton->SetName(wxStripMenuCodes(Prompt));
1586 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1587 pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1588 wxASSERT( pRadioButton );
1589 if( pRadioButton->GetValue() )
1597 return pRadioButton;
1704 double &pos,
const double max,
const double min )
1712 float &pos,
const float fMin,
const float fMax)
1714 const float RoundFix=0.0000001f;
1715 int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1716 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1717 pos = iVal*(fMax-fMin)*0.01+fMin;
1723 float &pos,
const float fMin,
const float fMax)
1725 int iVal=(pos-fMin)*100.0/(fMax-fMin);
1730 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1731 pos = iVal*(fMax-fMin)*0.01+fMin;
1741 auto result =
TieChoice( Prompt, Index, choices );
1742 if ( Index >= 0 && Index < choices.size() )
1743 Selected = choices[ Index ];
1760 if( n == wxNOT_FOUND )
1770 if( n== wxNOT_FOUND )
1773 if( n < (
int)Choices.size() )
1830 return (iStep==1) || (iStep==2);
1835 return (iStep==1) || (iStep==2);
1839 return (iStep==2) || (iStep==3);
1854 wxCheckBox * pCheck=NULL;
1871 wxCheckBox * pCheck=NULL;
1890 wxSlider * pSlider=NULL;
1909 wxSpinCtrl * pSpinCtrl=NULL;
1927 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1945 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1961 const int nChars,
bool acceptEnter)
1963 wxTextCtrl * pText=(wxTextCtrl*)NULL;
1983 choiceSetting.
Read();
1985 const auto &symbols = choiceSetting.
GetSymbols();
1986 const auto &SettingName = choiceSetting.
Key();
1988 const auto &Choices = symbols.GetMsgids();
1989 const auto &InternalChoices = symbols.GetInternals();
1991 wxChoice * pChoice=(wxChoice*)NULL;
2021 const std::vector<int> * pInternalChoices,
2022 int iNoMatchSelector)
2024 auto fn = [](
int arg){
return wxString::Format(
"%d", arg ); };
2027 if ( pInternalChoices )
2029 transform_container<wxArrayStringEx>(*pInternalChoices,
fn);
2031 for (
int ii = 0; ii < (int)Choices.size(); ++ii )
2032 InternalChoices.push_back(
fn( ii ) );
2039 if ( pInternalChoices )
2043 if ( defaultIndex < 0 || defaultIndex >= (
int)Choices.size() )
2093 wxWindow *pWind, wxWindow *pDlg )
2098 pWind->SetMinSize( pWind->GetBestSize() );
2100 pWind->SetMinSize( item.
mMinSize );
2105 else if ( step == 1) {
2117 if (
auto pButton =
dynamic_cast< wxBitmapButton*
>( pWind ))
2130 pWind->Enable(
false );
2133 pWind->Connect( pair.first, pair.second,
nullptr, pDlg );
2142 int useFlags = Flags;
2174 if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
2245 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize)
2251 Init( vertical, minSize );
2262 mpShuttle = std::make_unique<ShuttlePrefs>();
2287 wxASSERT(parent != NULL);
2291#if defined(__WXMAC__)
2293#elif defined(__WXGTK20__)
2295#elif defined(__WXMSW__)
2296 wxButton b(parent, 0, wxEmptyString);
2297 margin = b.ConvertDialogToPixels(wxSize(2, 0)).x;
2299 wxButton b(parent, 0, wxEmptyString);
2300 margin = b->ConvertDialogToPixels(wxSize(4, 0)).x;
2305 auto bs = std::make_unique<wxStdDialogButtonSizer>();
2307 const auto makeButton =
2308 [parent]( wxWindowID
id,
const wxString
label = {} ) {
2310 result->SetName( result->GetLabel() );
2316 b = makeButton( wxID_OK );
2323 bs->AddButton( makeButton( wxID_CANCEL ) );
2328 b = makeButton( wxID_YES );
2335 bs->AddButton( makeButton( wxID_NO ) );
2340 b = makeButton( wxID_APPLY );
2347 bs->AddButton( makeButton( wxID_CANCEL,
XO(
"&Close").Translation() ) );
2350#if defined(__WXMSW__)
2357 b->SetToolTip(
XO(
"Help").Translation() );
2358 b->SetLabel(
XO(
"Help").Translation());
2359 b->SetName( b->GetLabel() );
2366 bs->Add( makeButton(
ePreviewID,
XO(
"&Preview").Translation() ),
2367 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2371 bs->Add( makeButton(
ePreviewDryID,
XO(
"Dry Previe&w").Translation() ),
2372 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2378 bs->Add( makeButton(
eSettingsID,
XO(
"&Settings").Translation() ),
2379 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2385 bs->Add( extra, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2389 bs->AddStretchSpacer();
2392 size_t lastLastSpacer = 0;
2393 size_t lastSpacer = 0;
2394 wxSizerItemList & list = bs->GetChildren();
2395 for(
size_t i = 0, cnt = list.size(); i < cnt; i++ )
2397 if( list[i]->IsSpacer() )
2403 lastLastSpacer = lastSpacer;
2410 b = makeButton(
eDebugID,
XO(
"Debu&g").Translation() );
2411 bs->Insert( ++lastLastSpacer, b, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2414#if !defined(__WXMSW__)
2428 b->SetToolTip(
XO(
"Help").Translation() );
2429 b->SetLabel(
XO(
"Help").Translation());
2430 b->SetName( b->GetLabel() );
2431 bs->Add( b, 0, wxALIGN_CENTER );
2436 auto s = std::make_unique<wxBoxSizer>( wxVERTICAL );
2437 s->Add( bs.release(), 1, wxEXPAND | wxALL, 7 );
2440 return std::unique_ptr<wxSizer>{ s.release() };
2466 return mpSizer->Add( width, height, prop );
2472 transform_container<wxArrayStringEx>(
2480 for(
size_t i = 0; i < items.size(); i++ )
2485 window->GetTextExtent(items[i], &x, &y );
2494#if defined(__WXMAC__)
2496#elif defined(__WXMSW__)
2498#elif defined(__WXGTK__)
2504 window->SetMinSize( { maxw, -1 } );
2524 return transform_range<TranslatableStrings>(
2525 strings, strings + nStrings,
2532 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)
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)
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