22#include <wx/listbase.h>
56class wxScrolledWindow;
82#include <wx/statbox.h>
88 template<
typename... Args >
90 : wxStaticBox(
std::forward<Args>(args)... )
92 m_container.EnableSelfFocus();
101 using wxSlider::wxSlider;
118 template<
typename Factory>
122 return std::move(*
this);
126 template<
typename V,
typename... Args>
128 {
return std::move(*this).
Validator( [args...]{ return V( args... ); } ); }
133 return std::move( *
this );
140 return std::move( *
this );
148 return std::move( *
this );
154 return std::move( *
this );
161 return std::move( *
this );
167 return std::move( *
this );
174 template<
typename Tag,
typename Argument,
typename Handler >
176 wxEventTypeTag<Tag> eventType,
177 void (Handler::*func)(Argument&)
180 std::is_base_of_v<Argument, Tag>,
185 (void(wxEvtHandler::*)(wxEvent&)) (
186 static_cast<void(wxEvtHandler::*)(Argument&)
>( func )
189 return std::move( *
this );
195 return std::move ( *
this );
201 return std::move ( *
this );
207 return std::move( *
this );
213 return std::move( *
this );
251 void Init(
bool vertical, wxSize minSize );
259 wxWindow * AddWindow(wxWindow* pWindow,
int PositionFlags = wxALIGN_CENTRE);
260 wxSlider * AddSlider(
264 int Value,
int Max,
int Min);
265 wxTreeCtrl * AddTree();
272 wxRadioButton * AddRadioButton(
274 wxRadioButton * AddRadioButtonToGroup(
279 wxButton * AddButton(
281 bool setDefault =
false );
284 wxBitmapButton * AddBitmapButton(
285 const wxBitmap &Bitmap,
int PositionFlags = wxALIGN_CENTRE,
286 bool setDefault =
false );
289 wxStaticText * AddVariableText(
291 int PositionFlags = 0,
int wrapWidth = 0);
294 const wxString &Value);
295 wxTextCtrl * AddTextBox(
297 const wxString &Value,
const int nChars);
298 wxTextCtrl * AddNumericTextBox(
300 const wxString &Value,
const int nChars);
301 wxTextCtrl * AddTextWindow(
const wxString &Value);
307 int f = wxLIST_FORMAT_LEFT,
int w = wxLIST_AUTOSIZE)
308 : heading(h),
format(f), width(w)
315 wxListCtrl * AddListControl(
316 std::initializer_list<const ListControlColumn> columns = {},
317 long listControlStyles = 0
319 wxListCtrl * AddListControlReportMode(
320 std::initializer_list<const ListControlColumn> columns = {},
321 long listControlStyles = 0
341 void AddIcon( wxBitmap * pBmp);
344 void AddConstTextBox(
349 void StartHorizontalLay(
int PositionFlags=wxALIGN_CENTRE,
int iProp=1);
350 void EndHorizontalLay();
352 void StartVerticalLay(
int iProp=1);
353 void StartVerticalLay(
int PositionFlags,
int iProp);
354 void EndVerticalLay();
356 void StartWrapLay(
int PositionFlags=wxEXPAND,
int iProp = 0);
359 wxScrolledWindow * StartScroller(
int iStyle=0);
361 wxPanel * StartPanel(
int iStyle=0);
363 void StartMultiColumn(
int nCols,
int PositionFlags=wxALIGN_LEFT);
364 void EndMultiColumn();
374 wxNotebook * StartNotebook();
377 wxSimplebook * StartSimplebook();
378 void EndSimplebook();
384 void EndNotebookPage();
386 wxPanel * StartInvisiblePanel(
int border = 0);
387 void EndInvisiblePanel();
390 void EndRadioButtonGroup();
392 bool DoStep(
int iStep );
393 int TranslateToIndex(
const wxString &Value,
const wxArrayStringEx &Choices );
394 wxString TranslateFromIndex(
const int nIn,
const wxArrayStringEx &Choices );
398 wxTextCtrl * TieTextBox(
400 wxTextCtrl * TieTextBox(
402 wxTextCtrl * TieTextBox(
405 wxTextCtrl * TieNumericTextBox(
const TranslatableString &Prompt,
int &Value,
const int nChars=0);
406 wxTextCtrl * TieNumericTextBox(
const TranslatableString &Prompt,
double &Value,
const int nChars=0);
411 wxChoice * TieChoice(
414 wxChoice * TieChoice(
417 wxSlider * TieSlider(
419 int &pos,
const int max,
const int min = 0);
420 wxSlider * TieSlider(
422 double &pos,
const double max,
const double min = 0.0);
423 wxSlider * TieSlider(
425 float &pos,
const float fMin,
const float fMax);
426 wxSlider * TieVSlider(
428 float &pos,
const float fMin,
const float fMax);
432 wxRadioButton * TieRadioButton();
435 int &Value,
const int max,
const int min = 0 );
442 virtual wxCheckBox * TieCheckBox(
445 virtual wxCheckBox * TieCheckBoxOnRight(
460 const std::vector<int> * pInternalChoices =
nullptr,
461 int iNoMatchSelector = 0);
463 virtual wxTextCtrl * TieTextBox(
467 virtual wxTextCtrl * TieIntegerTextBox(
471 virtual wxTextCtrl * TieNumericTextBox(
475 virtual wxSlider * TieSlider(
480 virtual wxSpinCtrl * TieSpinCtrl(
487 int GetBorder() const noexcept;
488 void SetSizerProportion(
int iProp ) {miSizerProp = iProp;};
489 void SetStretchyCol(
int i );
490 void SetStretchyRow(
int i );
497 wxASSERT(mpParent != NULL);
506 wxWindow *pWind, wxWindow *pDlg );
509 void SetProportions(
int Default );
513 void UpdateSizersCore(
bool bPrepend,
int Flags,
bool prompt =
false );
515 void UpdateSizersC();
516 void UpdateSizersAtStart();
518 long GetStyle(
long Style );
521 void DoInsertListColumns(
522 wxListCtrl *pListCtrl,
523 long listControlStyles,
524 std::initializer_list<const ListControlColumn> columns );
556 void DoDataShuttle(
const wxString &Name,
WrappedType & WrappedRef );
558 wxTextCtrl * DoTieTextBox(
561 wxTextCtrl * DoTieNumericTextBox(
564 wxSlider * DoTieSlider(
575 wxRadioButton * DoAddRadioButton(
584extern void SetIfCreated( wxChoice *&Var, wxChoice * Val );
585extern void SetIfCreated( wxTextCtrl *&Var, wxTextCtrl * Val );
586extern void SetIfCreated( wxStaticText *&Var, wxStaticText * Val );
624 wxWindow *extra = NULL );
632 bool vertical =
true,
633 wxSize minSize = { 250, 100 }
643 std::move( mItem ).
Focus( focused );
649 std::move( mItem ).
Disable( disabled );
655 std::move( mItem ).
ToolTip( tip );
674 template<
typename Factory>
683 template<
typename V,
typename...Args>
687 std::move( mItem ).
Validator<V>( std::forward<Args>(args)... );
695 template<
typename Tag,
typename Argument,
typename Handler >
697 wxEventTypeTag<Tag> eventType,
698 void (Handler::*func)(Argument&)
701 std::is_base_of_v<Argument, Tag>,
710 std::move( mItem ).
Position( flags );
725 std::move( mItem ).
Style( iStyle );
730 { std::move( mItem ).
MinSize();
return *
this; }
732 { std::move( mItem ).
MinSize( sz );
return *
this; }
736 void AddStandardButtons(
739 wxSizerItem * AddSpace(
int width,
int height,
int prop = 0 );
745 static void SetMinSize( wxWindow *window,
const wxArrayStringEx & items );
const TranslatableString name
AUDACITY_DLL_API std::unique_ptr< wxSizer > CreateStdButtonSizer(wxWindow *parent, long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
AUDACITY_DLL_API TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
const int nMaxNestedSizers
void SetIfCreated(wxChoice *&Var, wxChoice *Val)
std::vector< TranslatableString > TranslatableStrings
This specialization of Setting for bool adds a Toggle method to negate the saved value.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Specialization of Setting for double.
Specialization of Setting for int.
Base class for shuttling data to and from a GUI.
void SetBorder(int Border)
wxString mRadioValueString
The index of this radio item. -1 for none.
DialogDefinition::Item mItem
wxCheckBox * AddCheckBoxOnRight(const TranslatableString &Prompt, const wxChar *)=delete
wxCheckBox * AddCheckBox(const TranslatableString &Prompt, const wxChar *)=delete
std::vector< EnumValueSymbol > mRadioSymbols
wxSlider * AddVSlider(const TranslatableString &Prompt, int pos, int Max)
wxCheckBox * AddCheckBoxOnRight(const TranslatableString &Prompt, const char *)=delete
std::optional< WrappedType > mRadioValue
The setting controlled by a group.
wxString mRadioSettingName
ShuttleGuiBase & Prop(int iProp)
wxCheckBox * AddCheckBox(const TranslatableString &Prompt, const char *)=delete
std::unique_ptr< Shuttle > mpShuttle
int mRadioCount
The wrapped value associated with the active radio button.
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
std::unique_ptr< wxSizer > mpSubSizer
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
ShuttleGui & NameSuffix(const TranslatableString &suffix)
ShuttleGui & Validator(const Factory &f)
ShuttleGui & ToolTip(const TranslatableString &tip)
ShuttleGui & Prop(int iProp)
ShuttleGui & Focus(bool focused=true)
ShuttleGui & Name(const TranslatableString &name)
ShuttleGui & Style(long iStyle)
ShuttleGui & MinSize(wxSize sz)
ShuttleGui & Position(int flags)
auto ConnectRoot(wxEventTypeTag< Tag > eventType, void(Handler::*func)(Argument &)) -> std::enable_if_t< std::is_base_of_v< Argument, Tag >, ShuttleGui & >
ShuttleGui & Disable(bool disabled=true)
ShuttleGui & Size(wxSize size)
wxSizerItem * AddSpace(int size)
ShuttleGui & Validator(Args &&...args)
Moves data from one place to another, converting it as required.
Specialization of Setting for strings.
Holds a msgid for the translation catalog; may also bind format arguments.
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
wxStaticBoxWrapper(Args &&...args)
Item && Focus(bool focused=true) &&
Item && Disable(bool disabled=true) &&
Item && Style(long style) &&
std::function< void(wxWindow *) > mValidatorSetter
Item && Name(const TranslatableString &name) &&
Item && Position(int flags) &&
std::vector< std::pair< wxEventType, wxObjectEventFunction > > mRootConnections
Item && NameSuffix(const TranslatableString &suffix) &&
Item && ToolTip(const TranslatableString &tip) &&
TranslatableString mToolTip
Item && MinSize(wxSize sz) &&
Item && Validator(Args &&... args) &&
auto ConnectRoot(wxEventTypeTag< Tag > eventType, void(Handler::*func)(Argument &)) &&-> std::enable_if_t< std::is_base_of_v< Argument, Tag >, Item && >
Item && Validator(const Factory &f) &&
TranslatableString mNameSuffix
Item && Size(wxSize size) &&
ListControlColumn(const TranslatableString &h, int f=wxLIST_FORMAT_LEFT, int w=wxLIST_AUTOSIZE)
TranslatableString heading