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 ));
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;
971 pScroller->SetScrollRate( 20,20 );
974 pScroller->SetName(
wxT(
"\a"));
975 pScroller->SetLabel(
wxT(
"\a"));
999 wxSize ScrollSize =
mpSizer->GetMinSize();
1000 int yMin = ScrollSize.y+4;
1001 int xMin = ScrollSize.x+4;
1008 mpParent->SetMinSize( wxSize(xMin, yMin) );
1018 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1025 mpWind->SetBackgroundColour(
1027 ? wxColour( 190,200,230) :
1028 wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
1054 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxNotebook);
1055 wxNotebook * pNotebook;
1057 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1075 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxSimplebook);
1076 wxSimplebook * pNotebook;
1078 miId, wxDefaultPosition, wxDefaultSize,
GetStyle( 0 ));
1098 auto pNotebook =
static_cast< wxBookCtrlBase*
>(
mpParent );
1100 const auto translated = Name.Translation();
1101 pPage->SetName(translated);
1131 const wxPoint& pos = wxDefaultPosition,
1132 const wxSize&
size = wxDefaultSize,
1133 long style = wxTAB_TRAVERSAL ) :
1138 void OnPaint( wxPaintEvent &event );
1140 DECLARE_EVENT_TABLE()
1160 return wxDynamicCast(wxWindow::FindWindowById(
miId,
mpDlg), wxPanel);
1165 mpWind->SetBackgroundColour(
1166 wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
1196 mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
1213 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1222 mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
1240 mpSubSizer = std::make_unique<wxWrapSizer>(wxHORIZONTAL, 0);
1257 mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
1274 mpShuttle->TransferWrappedType( Name, WrappedRef );
1292 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1293 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1302 wxASSERT( pCheckBox );
1308 wxASSERT( pCheckBox );
1309 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1328 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1329 wxCheckBox * pCheckBox = wxDynamicCast(pWnd, wxCheckBox);
1338 wxASSERT( pCheckBox );
1344 wxASSERT( pCheckBox );
1345 pCheckBox->SetValue( WrappedRef.
ReadAsBool() );
1365 wxSpinCtrl * pSpinCtrl=NULL;
1367 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1368 pSpinCtrl = wxDynamicCast(pWnd, wxSpinCtrl);
1377 wxASSERT( pSpinCtrl );
1383 wxASSERT( pSpinCtrl );
1384 pSpinCtrl->SetValue( WrappedRef.
ReadAsInt() );
1406 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1416 wxASSERT( pSpinCtrl );
1422 wxASSERT( pSpinCtrl );
1442 wxTextCtrl * pTextBox=NULL;
1444 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1445 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1454 wxASSERT( pTextBox );
1460 wxASSERT( pTextBox );
1481 wxTextCtrl * pTextBox=NULL;
1483 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1484 pTextBox = wxDynamicCast(pWnd, wxTextCtrl);
1493 wxASSERT( pTextBox );
1499 wxASSERT( pTextBox );
1518 wxSlider * pSlider=NULL;
1531 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1532 pSlider = wxDynamicCast(pWnd, wxSlider);
1533 wxASSERT( pSlider );
1539 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1540 pSlider = wxDynamicCast(pWnd, wxSlider);
1541 wxASSERT( pSlider );
1542 pSlider->SetValue( WrappedRef.
ReadAsInt() );
1564 wxChoice * pChoice=NULL;
1569 pChoice =
AddChoice( Prompt, choices, Selected );
1578 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1579 pChoice = wxDynamicCast(pWnd, wxChoice);
1580 wxASSERT( pChoice );
1581 Selected = pChoice->GetSelection();
1586 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1587 pChoice = wxDynamicCast(pWnd, wxChoice);
1588 wxASSERT( pChoice );
1589 pChoice->SetSelection( Selected );
1611 wxASSERT( !Temp.empty() );
1618 wxRadioButton * pRadioButton = NULL;
1627 wxDefaultPosition, wxDefaultSize,
1634 pRadioButton->SetValue( value );
1636 pRadioButton->SetName(wxStripMenuCodes(Prompt));
1644 wxWindow * pWnd = wxWindow::FindWindowById(
miId,
mpDlg);
1645 pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
1646 wxASSERT( pRadioButton );
1647 if( pRadioButton->GetValue() )
1655 return pRadioButton;
1718 const double max,
const double min)
1770 double &pos,
const double max,
const double min )
1778 float &pos,
const float fMin,
const float fMax)
1780 const float RoundFix=0.0000001f;
1781 int iVal=(pos-fMin+RoundFix)*100.0/(fMax-fMin);
1782 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1783 pos = iVal*(fMax-fMin)*0.01+fMin;
1789 float &pos,
const float fMin,
const float fMax)
1791 int iVal=(pos-fMin)*100.0/(fMax-fMin);
1796 wxSlider * pWnd =
TieSlider( Prompt, iVal, 100 );
1797 pos = iVal*(fMax-fMin)*0.01+fMin;
1807 auto result =
TieChoice( Prompt, Index, choices );
1808 if ( Index >= 0 && Index < choices.size() )
1809 Selected = choices[ Index ];
1826 if( n == wxNOT_FOUND )
1836 if( n== wxNOT_FOUND )
1839 if( n < (
int)Choices.size() )
1896 return (iStep==1) || (iStep==2);
1901 return (iStep==1) || (iStep==2);
1905 return (iStep==2) || (iStep==3);
1920 wxCheckBox * pCheck=NULL;
1937 wxCheckBox * pCheck=NULL;
1956 wxSlider * pSlider=NULL;
1975 wxSpinCtrl * pSpinCtrl=NULL;
1993 wxTextCtrl * pText=(wxTextCtrl*)NULL;
2011 wxTextCtrl * pText=(wxTextCtrl*)NULL;
2027 const int nChars,
bool acceptEnter)
2029 wxTextCtrl * pText=(wxTextCtrl*)NULL;
2049 choiceSetting.
Read();
2051 const auto &symbols = choiceSetting.
GetSymbols();
2052 const auto &SettingName = choiceSetting.
Key();
2054 const auto &Choices = symbols.GetMsgids();
2055 const auto &InternalChoices = symbols.GetInternals();
2057 wxChoice * pChoice=(wxChoice*)NULL;
2087 const std::vector<int> * pInternalChoices,
2088 int iNoMatchSelector)
2090 auto fn = [](
int arg){
return wxString::Format(
"%d", arg ); };
2093 if ( pInternalChoices )
2095 transform_container<wxArrayStringEx>(*pInternalChoices,
fn);
2097 for (
int ii = 0; ii < (int)Choices.size(); ++ii )
2098 InternalChoices.push_back(
fn( ii ) );
2105 if ( pInternalChoices )
2109 if ( defaultIndex < 0 || defaultIndex >= (
int)Choices.size() )
2159 wxWindow *pWind, wxWindow *pDlg )
2164 pWind->SetMinSize( pWind->GetBestSize() );
2166 pWind->SetMinSize( item.
mMinSize );
2171 else if ( step == 1) {
2183 if (
auto pButton =
dynamic_cast< wxBitmapButton*
>( pWind ))
2196 pWind->Enable(
false );
2199 pWind->Connect( pair.first, pair.second,
nullptr, pDlg );
2208 int useFlags = Flags;
2240 if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
2311 wxWindow * pParent,
teShuttleMode ShuttleMode,
bool vertical, wxSize minSize)
2317 Init( vertical, minSize );
2328 mpShuttle = std::make_unique<ShuttlePrefs>();
2353 wxASSERT(parent != NULL);
2357#if defined(__WXMAC__)
2359#elif defined(__WXGTK20__)
2361#elif defined(__WXMSW__)
2362 wxButton b(parent, 0, wxEmptyString);
2363 margin = b.ConvertDialogToPixels(wxSize(2, 0)).x;
2365 wxButton b(parent, 0, wxEmptyString);
2366 margin = b->ConvertDialogToPixels(wxSize(4, 0)).x;
2371 auto bs = std::make_unique<wxStdDialogButtonSizer>();
2373 const auto makeButton =
2374 [parent]( wxWindowID
id,
const wxString
label = {} ) {
2376 result->SetName( result->GetLabel() );
2382 b = makeButton( wxID_OK );
2389 bs->AddButton( makeButton( wxID_CANCEL ) );
2394 b = makeButton( wxID_YES );
2401 bs->AddButton( makeButton( wxID_NO ) );
2406 b = makeButton( wxID_APPLY );
2413 bs->AddButton( makeButton( wxID_CANCEL,
XO(
"&Close").Translation() ) );
2416#if defined(__WXMSW__)
2423 b->SetToolTip(
XO(
"Help").Translation() );
2424 b->SetLabel(
XO(
"Help").Translation());
2425 b->SetName( b->GetLabel() );
2432 bs->Add( makeButton(
ePreviewID,
XO(
"&Preview").Translation() ),
2433 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2437 bs->Add( makeButton(
ePreviewDryID,
XO(
"Dry Previe&w").Translation() ),
2438 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2444 bs->Add( makeButton(
eSettingsID,
XO(
"&Settings").Translation() ),
2445 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin);
2451 bs->Add( extra, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2455 bs->AddStretchSpacer();
2458 size_t lastLastSpacer = 0;
2459 size_t lastSpacer = 0;
2460 wxSizerItemList & list = bs->GetChildren();
2461 for(
size_t i = 0, cnt = list.size(); i < cnt; i++ )
2463 if( list[i]->IsSpacer() )
2469 lastLastSpacer = lastSpacer;
2476 b = makeButton(
eDebugID,
XO(
"Debu&g").Translation() );
2477 bs->Insert( ++lastLastSpacer, b, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
2480#if !defined(__WXMSW__)
2494 b->SetToolTip(
XO(
"Help").Translation() );
2495 b->SetLabel(
XO(
"Help").Translation());
2496 b->SetName( b->GetLabel() );
2497 bs->Add( b, 0, wxALIGN_CENTER );
2502 auto s = std::make_unique<wxBoxSizer>( wxVERTICAL );
2503 s->Add( bs.release(), 1, wxEXPAND | wxALL, 7 );
2506 return std::unique_ptr<wxSizer>{ s.release() };
2532 return mpSizer->Add( width, height, prop );
2538 transform_container<wxArrayStringEx>(
2546 for(
size_t i = 0; i < items.size(); i++ )
2551 window->GetTextExtent(items[i], &x, &y );
2560#if defined(__WXMAC__)
2562#elif defined(__WXMSW__)
2564#elif defined(__WXGTK__)
2570 window->SetMinSize( { maxw, -1 } );
2590 return transform_range<TranslatableStrings>(
2591 strings, strings + nStrings,
2598 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