19#include <wx/listbase.h>
54class wxScrolledWindow;
80#include <wx/statbox.h>
86 template<
typename... Args >
90 m_container.EnableSelfFocus();
99 using wxSlider::wxSlider;
116 template<
typename Factory>
120 return std::move(*
this);
124 template<
typename V,
typename... Args>
126 {
return std::move(*this).
Validator( [args...]{ return V( args... ); } ); }
131 return std::move( *
this );
138 return std::move( *
this );
146 return std::move( *
this );
152 return std::move( *
this );
159 return std::move( *
this );
165 return std::move( *
this );
172 template<
typename Tag,
typename Argument,
typename Handler >
174 wxEventTypeTag<Tag> eventType,
175 void (Handler::*func)(Argument&)
178 std::is_base_of_v<Argument, Tag>,
183 (void(wxEvtHandler::*)(wxEvent&)) (
184 static_cast<void(wxEvtHandler::*)(Argument&)
>( func )
187 return std::move( *
this );
193 return std::move ( *
this );
199 return std::move ( *
this );
205 return std::move( *
this );
211 return std::move( *
this );
249 void Init(
bool vertical, wxSize minSize );
257 wxWindow * AddWindow(wxWindow* pWindow,
int PositionFlags = wxALIGN_CENTRE);
258 wxSlider * AddSlider(
262 int Value,
int Max,
int Min);
263 wxTreeCtrl * AddTree();
270 wxRadioButton * AddRadioButton(
272 wxRadioButton * AddRadioButtonToGroup(
277 wxButton * AddButton(
279 bool setDefault =
false );
282 wxBitmapButton * AddBitmapButton(
283 const wxBitmap &Bitmap,
int PositionFlags = wxALIGN_CENTRE,
284 bool setDefault =
false );
287 wxStaticText * AddVariableText(
289 int PositionFlags = 0,
int wrapWidth = 0);
292 const wxString &Value);
293 wxTextCtrl * AddTextBox(
295 const wxString &Value,
const int nChars);
296 wxTextCtrl * AddNumericTextBox(
298 const wxString &Value,
const int nChars);
299 wxTextCtrl * AddTextWindow(
const wxString &Value);
305 int f = wxLIST_FORMAT_LEFT,
int w = wxLIST_AUTOSIZE)
306 : heading(h),
format(f), width(w)
313 wxListCtrl * AddListControl(
314 std::initializer_list<const ListControlColumn> columns = {},
315 long listControlStyles = 0
317 wxListCtrl * AddListControlReportMode(
318 std::initializer_list<const ListControlColumn> columns = {},
319 long listControlStyles = 0
339 void AddIcon( wxBitmap * pBmp);
342 void AddConstTextBox(
347 void StartHorizontalLay(
int PositionFlags=wxALIGN_CENTRE,
int iProp=1);
348 void EndHorizontalLay();
350 void StartVerticalLay(
int iProp=1);
351 void StartVerticalLay(
int PositionFlags,
int iProp);
352 void EndVerticalLay();
354 void StartWrapLay(
int PositionFlags=wxEXPAND,
int iProp = 0);
357 wxScrolledWindow * StartScroller(
int iStyle=0);
359 wxPanel * StartPanel(
int iStyle=0);
361 void StartMultiColumn(
int nCols,
int PositionFlags=wxALIGN_LEFT);
362 void EndMultiColumn();
372 wxNotebook * StartNotebook();
375 wxSimplebook * StartSimplebook();
376 void EndSimplebook();
382 void EndNotebookPage();
384 wxPanel * StartInvisiblePanel(
int border = 0);
385 void EndInvisiblePanel();
388 void EndRadioButtonGroup();
390 bool DoStep(
int iStep );
391 int TranslateToIndex(
const wxString &Value,
const wxArrayStringEx &Choices );
392 wxString TranslateFromIndex(
const int nIn,
const wxArrayStringEx &Choices );
396 wxTextCtrl * TieTextBox(
398 wxTextCtrl * TieTextBox(
400 wxTextCtrl * TieTextBox(
403 wxTextCtrl * TieNumericTextBox(
const TranslatableString &Prompt,
int &Value,
const int nChars=0);
404 wxTextCtrl * TieNumericTextBox(
const TranslatableString &Prompt,
double &Value,
const int nChars=0);
409 wxChoice * TieChoice(
412 wxChoice * TieChoice(
415 wxSlider * TieSlider(
417 int &pos,
const int max,
const int min = 0);
418 wxSlider * TieSlider(
420 double &pos,
const double max,
const double min = 0.0);
421 wxSlider * TieSlider(
423 float &pos,
const float fMin,
const float fMax);
424 wxSlider * TieVSlider(
426 float &pos,
const float fMin,
const float fMax);
430 wxRadioButton * TieRadioButton();
433 int &Value,
const int max,
const int min = 0 );
440 virtual wxCheckBox * TieCheckBox(
443 virtual wxCheckBox * TieCheckBoxOnRight(
458 const std::vector<int> * pInternalChoices =
nullptr,
459 int iNoMatchSelector = 0);
461 virtual wxTextCtrl * TieTextBox(
465 virtual wxTextCtrl * TieIntegerTextBox(
469 virtual wxTextCtrl * TieNumericTextBox(
473 virtual wxSlider * TieSlider(
478 virtual wxSpinCtrl * TieSpinCtrl(
485 int GetBorder() const noexcept;
486 void SetSizerProportion(
int iProp ) {miSizerProp = iProp;};
487 void SetStretchyCol(
int i );
488 void SetStretchyRow(
int i );
495 wxASSERT(mpParent != NULL);
504 wxWindow *pWind, wxWindow *pDlg );
507 void SetProportions(
int Default );
511 void UpdateSizersCore(
bool bPrepend,
int Flags,
bool prompt =
false );
513 void UpdateSizersC();
514 void UpdateSizersAtStart();
516 long GetStyle(
long Style );
519 void DoInsertListColumns(
520 wxListCtrl *pListCtrl,
521 long listControlStyles,
522 std::initializer_list<const ListControlColumn> columns );
554 void DoDataShuttle(
const wxString &Name,
WrappedType & WrappedRef );
556 wxTextCtrl * DoTieTextBox(
559 wxTextCtrl * DoTieNumericTextBox(
562 wxSlider * DoTieSlider(
573 wxRadioButton * DoAddRadioButton(
582extern void SetIfCreated( wxChoice *&Var, wxChoice * Val );
583extern void SetIfCreated( wxTextCtrl *&Var, wxTextCtrl * Val );
584extern void SetIfCreated( wxStaticText *&Var, wxStaticText * Val );
621 wxWindow *extra = NULL );
629 bool vertical =
true,
630 wxSize minSize = { 250, 100 }
640 std::move( mItem ).
Focus( focused );
646 std::move( mItem ).
Disable( disabled );
652 std::move( mItem ).
ToolTip( tip );
671 template<
typename Factory>
680 template<
typename V,
typename...Args>
684 std::move( mItem ).
Validator<V>( std::forward<Args>(args)... );
692 template<
typename Tag,
typename Argument,
typename Handler >
694 wxEventTypeTag<Tag> eventType,
695 void (Handler::*func)(Argument&)
698 std::is_base_of_v<Argument, Tag>,
707 std::move( mItem ).
Position( flags );
722 std::move( mItem ).
Style( iStyle );
727 { std::move( mItem ).
MinSize();
return *
this; }
729 { std::move( mItem ).
MinSize( sz );
return *
this; }
733 void AddStandardButtons(
736 wxSizerItem * AddSpace(
int width,
int height,
int prop = 0 );
742 static void SetMinSize( wxWindow *window,
const wxArrayStringEx & items );
const TranslatableString name
SHUTTLEGUI_API TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
const int nMaxNestedSizers
SHUTTLEGUI_API std::unique_ptr< wxSizer > CreateStdButtonSizer(wxWindow *parent, long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
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
std::unique_ptr< ShuttlePrefs > mpShuttle
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
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)
A kind of Shuttle to exchange data with preferences e.g. the registry.
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