Use reasonable size for wxPreviewFrame by default
Give a reasonable default size to wxPreviewCanvas and fit wxPreviewFrame to its contents. Remove the useless call to Fit() from SizerWithButtons: the size set inside it was just ignored anyhow. This also allows to stop hardcoding the size in the sample, so don't do this any more. See #22439.
This commit is contained in:
@@ -390,8 +390,7 @@ void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event))
|
||||
return;
|
||||
}
|
||||
|
||||
wxPreviewFrame *frame =
|
||||
new wxPreviewFrame(preview, this, "Demo Print Preview", wxDefaultPosition, FromDIP(wxSize(600, 700)));
|
||||
wxPreviewFrame *frame = new wxPreviewFrame(preview, this, "Demo Print Preview");
|
||||
frame->Centre(wxBOTH);
|
||||
frame->InitializeWithModality(m_previewModality);
|
||||
frame->Show();
|
||||
@@ -425,8 +424,7 @@ void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event))
|
||||
// Pass two printout objects: for preview, and possible printing.
|
||||
wxPrintDialogData printDialogData(* g_printData);
|
||||
wxPrintPreview *preview = new wxPrintPreview(new MyPrintout(this), new MyPrintout(this), &printDialogData);
|
||||
wxPreviewFrame *frame =
|
||||
new wxPreviewFrame(preview, this, "Demo Print Preview", wxDefaultPosition, FromDIP(wxSize(600, 700)));
|
||||
wxPreviewFrame *frame = new wxPreviewFrame(preview, this, "Demo Print Preview");
|
||||
frame->Centre(wxBOTH);
|
||||
frame->Initialize();
|
||||
frame->Show();
|
||||
|
||||
Reference in New Issue
Block a user