Allow specifying the maximum width of static text in dialogs

This patch allows specification of the maximum width of static texts
created with wxDialog::CreateTextSizer.

The patch preserves backwards compatibility by setting the previous
width value as the default argument value.

Closes https://github.com/wxWidgets/wxWidgets/pull/355
This commit is contained in:
Tobias Schlager
2016-12-01 09:43:29 +01:00
committed by Vadim Zeitlin
parent aad8663698
commit 73f6f622f9
3 changed files with 18 additions and 10 deletions

View File

@@ -116,13 +116,15 @@ public:
#if wxUSE_STATTEXT // && wxUSE_TEXTCTRL
// splits text up at newlines and places the lines into a vertical
// wxBoxSizer
wxSizer *CreateTextSizer( const wxString& message );
// wxBoxSizer, with the given maximum width, lines will not be wrapped
// for negative values of widthMax
wxSizer *CreateTextSizer(const wxString& message, int widthMax = -1);
// same as above but uses a customized wxTextSizerWrapper to create
// non-standard controls for the lines
wxSizer *CreateTextSizer( const wxString& message,
wxTextSizerWrapper& wrapper );
wxSizer *CreateTextSizer(const wxString& message,
wxTextSizerWrapper& wrapper,
int widthMax = -1);
#endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL
// returns a horizontal wxBoxSizer containing the given buttons