Still use wxPreviewFrame size if it was explicitly specified

Even though it's better to not specify the preview frame size at all,
the size should still be used if it was explicitly specified, but this
didn't happen any more after the addition of the call to Fit().

Fix this now by only doing the equivalent of Fit() if no size was
explicitly given.

Also add advice about not setting the size explicitly to the
documentation.
This commit is contained in:
Vadim Zeitlin
2022-05-21 17:13:49 +01:00
parent fc0a4d4e62
commit 663fa1c77b
3 changed files with 16 additions and 2 deletions

View File

@@ -195,6 +195,9 @@ public:
Pass a print preview object plus other normal frame arguments.
The print preview object will be destroyed by the frame when it closes.
Note that @a size typically should @e not be specified explicitly to
let the frame use its default size, adapted to its contents.
*/
wxPreviewFrame(wxPrintPreviewBase* preview, wxWindow* parent,
const wxString& title = "Print Preview",