19#include <wx/listbase.h>
54class wxScrolledWindow;
81#include <wx/statbox.h>
87 template<
typename... Args >
91 m_container.EnableSelfFocus();
100 using wxSlider::wxSlider;
117 template<
typename Factory>
121 return std::move(*
this);
125 template<
typename V,
typename... Args>
127 {
return std::move(*this).
Validator( [args...]{ return V( args... ); } ); }
132 return std::move( *
this );
139 return std::move( *
this );
147 return std::move( *
this );
153 return std::move( *
this );
160 return std::move( *
this );
166 return std::move( *
this );
173 template<
typename Tag,
typename Argument,
typename Handler >
175 wxEventTypeTag<Tag> eventType,
176 void (Handler::*func)(Argument&)
179 std::is_base_of_v<Argument, Tag>,
184 (void(wxEvtHandler::*)(wxEvent&)) (
185 static_cast<void(wxEvtHandler::*)(Argument&)
>( func )
188 return std::move( *
this );
194 return std::move ( *
this );
200 return std::move ( *
this );
206 return std::move( *
this );
212 return std::move( *
this );
250 void Init(
bool vertical, wxSize minSize );
258 wxWindow * AddWindow(wxWindow* pWindow,
int PositionFlags = wxALIGN_CENTRE);
259 wxSlider * AddSlider(
263 int Value,
int Max,
int Min);
266 double Max,
double Min);
267 wxTreeCtrl * AddTree();
274 wxRadioButton * AddRadioButton(
276 wxRadioButton * AddRadioButtonToGroup(
281 wxButton * AddButton(
283 bool setDefault =
false );
286 wxBitmapButton * AddBitmapButton(
287 const wxBitmap &Bitmap,
int PositionFlags = wxALIGN_CENTRE,
288 bool setDefault =
false );
291 wxStaticText * AddVariableText(
293 int PositionFlags = 0,
int wrapWidth = 0);
296 const wxString &Value);
297 wxTextCtrl * AddTextBox(
299 const wxString &Value,
const int nChars);
300 wxTextCtrl * AddNumericTextBox(
302 const int nChars,
bool acceptEnter =
false);
303 wxTextCtrl * AddTextWindow(
const wxString &Value);
309 int f = wxLIST_FORMAT_LEFT,
int w = wxLIST_AUTOSIZE)
310 : heading(h),
format(f), width(w)
317 wxListCtrl * AddListControl(
318 std::initializer_list<const ListControlColumn> columns = {},
319 long listControlStyles = 0
321 wxListCtrl * AddListControlReportMode(
322 std::initializer_list<const ListControlColumn> columns = {},
323 long listControlStyles = 0
343 void AddIcon( wxBitmap * pBmp);
346 void AddConstTextBox(
351 void StartHorizontalLay(
int PositionFlags=wxALIGN_CENTRE,
int iProp=1);
352 void EndHorizontalLay();
354 void StartVerticalLay(
int iProp=1);
355 void StartVerticalLay(
int PositionFlags,
int iProp);
356 void EndVerticalLay();
358 void StartWrapLay(
int PositionFlags=wxEXPAND,
int iProp = 0);
361 wxScrolledWindow * StartScroller(
int iStyle=0);
363 wxPanel * StartPanel(
int iStyle=0);
365 void StartMultiColumn(
int nCols,
int PositionFlags=wxALIGN_LEFT);
366 void EndMultiColumn();
376 wxNotebook * StartNotebook();
379 wxSimplebook * StartSimplebook();
380 void EndSimplebook();
386 void EndNotebookPage();
388 wxPanel * StartInvisiblePanel(
int border = 0);
389 void EndInvisiblePanel();
392 void EndRadioButtonGroup();
394 bool DoStep(
int iStep );
395 int TranslateToIndex(
const wxString &Value,
const wxArrayStringEx &Choices );
396 wxString TranslateFromIndex(
const int nIn,
const wxArrayStringEx &Choices );
400 wxTextCtrl * TieTextBox(
402 wxTextCtrl * TieTextBox(
404 wxTextCtrl * TieTextBox(
407 wxTextCtrl* TieNumericTextBox(
409 bool acceptEnter =
false);
410 wxTextCtrl* TieNumericTextBox(
412 bool acceptEnter =
false);
417 wxChoice * TieChoice(
420 wxChoice * TieChoice(
423 wxSlider * TieSlider(
425 int &pos,
const int max,
const int min = 0);
426 wxSlider * TieSlider(
428 double &pos,
const double max,
const double min = 0.0);
429 wxSlider * TieSlider(
431 float &pos,
const float fMin,
const float fMax);
432 wxSlider * TieVSlider(
434 float &pos,
const float fMin,
const float fMax);
438 wxRadioButton * TieRadioButton();
441 int &Value,
const int max,
const int min = 0 );
444 const double max,
const double min = 0);
451 virtual wxCheckBox * TieCheckBox(
454 virtual wxCheckBox * TieCheckBoxOnRight(
469 const std::vector<int> * pInternalChoices =
nullptr,
470 int iNoMatchSelector = 0);
472 virtual wxTextCtrl * TieTextBox(
476 virtual wxTextCtrl * TieIntegerTextBox(
480 virtual wxTextCtrl * TieNumericTextBox(
483 const int nChars,
bool acceptEnter =
false);
484 virtual wxSlider * TieSlider(
489 virtual wxSpinCtrl * TieSpinCtrl(
496 int GetBorder() const noexcept;
497 void SetSizerProportion(
int iProp ) {miSizerProp = iProp;};
498 void SetStretchyCol(
int i );
499 void SetStretchyRow(
int i );
506 wxASSERT(mpParent != NULL);
515 wxWindow *pWind, wxWindow *pDlg );
518 void SetProportions(
int Default );
522 void UpdateSizersCore(
bool bPrepend,
int Flags,
bool prompt =
false );
524 void UpdateSizersC();
525 void UpdateSizersAtStart();
527 long GetStyle(
long Style );
530 void DoInsertListColumns(
531 wxListCtrl *pListCtrl,
532 long listControlStyles,
533 std::initializer_list<const ListControlColumn> columns );
565 void DoDataShuttle(
const wxString &Name,
WrappedType & WrappedRef );
567 wxTextCtrl * DoTieTextBox(
570 wxTextCtrl * DoTieNumericTextBox(
572 const int nChars,
bool acceptEnter =
false);
574 wxSlider * DoTieSlider(
588 wxRadioButton * DoAddRadioButton(
597extern void SetIfCreated( wxChoice *&Var, wxChoice * Val );
598extern void SetIfCreated( wxTextCtrl *&Var, wxTextCtrl * Val );
599extern void SetIfCreated( wxStaticText *&Var, wxStaticText * Val );
636 wxWindow *extra = NULL );
644 bool vertical =
true,
645 wxSize minSize = { 250, 100 }
655 std::move( mItem ).
Focus( focused );
661 std::move( mItem ).
Disable( disabled );
667 std::move( mItem ).
ToolTip( tip );
686 template<
typename Factory>
695 template<
typename V,
typename...Args>
699 std::move( mItem ).
Validator<V>( std::forward<Args>(args)... );
707 template<
typename Tag,
typename Argument,
typename Handler >
709 wxEventTypeTag<Tag> eventType,
710 void (Handler::*func)(Argument&)
713 std::is_base_of_v<Argument, Tag>,
722 std::move( mItem ).
Position( flags );
737 std::move( mItem ).
Style( iStyle );
742 { std::move( mItem ).
MinSize();
return *
this; }
744 { std::move( mItem ).
MinSize( sz );
return *
this; }
748 void AddStandardButtons(
751 wxSizerItem * AddSpace(
int width,
int height,
int prop = 0 );
757 static void SetMinSize( wxWindow *window,
const wxArrayStringEx & items );
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