]> git.saurik.com Git - wxWidgets.git/blob - src/generic/prntdlgg.cpp
Motif cell highlighting problem fixed
[wxWidgets.git] / src / generic / prntdlgg.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: prntdlgg.cpp
3 // Purpose: Generic print dialogs
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "prntdlgg.h"
14 #endif
15
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
18
19 #ifdef __BORLANDC__
20 #pragma hdrstop
21 #endif
22
23 #include "wx/defs.h"
24
25 #ifndef WX_PRECOMP
26 #include "wx/utils.h"
27 #include "wx/dc.h"
28 #include "wx/app.h"
29 #include "wx/frame.h"
30 #include "wx/stattext.h"
31 #include "wx/statbox.h"
32 #include "wx/button.h"
33 #include "wx/checkbox.h"
34 #include "wx/textctrl.h"
35 #include "wx/radiobox.h"
36 #include "wx/filedlg.h"
37 #include "wx/choice.h"
38 #include <wx/intl.h>
39 #endif
40
41 #include "wx/generic/prntdlgg.h"
42
43 #if wxUSE_POSTSCRIPT
44 #include "wx/generic/dcpsg.h"
45 #endif
46
47 #include "wx/printdlg.h"
48
49 // For print paper things
50 #include "wx/prntbase.h"
51
52 #include <stdlib.h>
53 #include <string.h>
54
55 #if wxUSE_POSTSCRIPT
56
57 #if !USE_SHARED_LIBRARY
58 IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
59 IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
60 IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxDialog)
61
62 BEGIN_EVENT_TABLE(wxGenericPrintDialog, wxDialog)
63 EVT_BUTTON(wxID_OK, wxGenericPrintDialog::OnOK)
64 EVT_BUTTON(wxPRINTID_SETUP, wxGenericPrintDialog::OnSetup)
65 EVT_RADIOBOX(wxPRINTID_RANGE, wxGenericPrintDialog::OnRange)
66 END_EVENT_TABLE()
67
68 BEGIN_EVENT_TABLE(wxGenericPageSetupDialog, wxDialog)
69 EVT_BUTTON(wxPRINTID_SETUP, wxGenericPageSetupDialog::OnPrinter)
70 END_EVENT_TABLE()
71 #endif
72
73 extern wxPrintPaperDatabase *wxThePrintPaperDatabase;
74
75 /*
76 * Generic print dialog for non-Windows printing use.
77 */
78
79
80 wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
81 wxDialog(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
82 {
83 if ( data )
84 printData = *data;
85
86 (void)new wxStaticBox( this, -1, _( "Printer options" ), wxPoint( 5, 5), wxSize( 300, 60 ) );
87
88 printToFileCheckBox = new wxCheckBox(this, wxPRINTID_PRINTTOFILE, _("Print to File"), wxPoint(20, 25) );
89
90 setupButton = new wxButton(this, wxPRINTID_SETUP, _("Setup..."), wxPoint(160, 25), wxSize(100, -1));
91
92 wxString *choices = new wxString[2];
93 choices[0] = _("All");
94 choices[1] = _("Pages");
95
96 fromText = (wxTextCtrl*)NULL;
97
98 if(printData.GetFromPage() != 0)
99 {
100 rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"),
101 wxPoint(5, 80), wxSize(-1, -1), 2, choices, 1, wxRA_VERTICAL);
102 rangeRadioBox->SetSelection(1);
103 }
104
105 if(printData.GetFromPage() != 0)
106 {
107 (void) new wxStaticText(this, wxPRINTID_STATIC, _("From:"), wxPoint(5, 135));
108
109 fromText = new wxTextCtrl(this, wxPRINTID_FROM, "", wxPoint(45, 130), wxSize(40, -1));
110
111 (void) new wxStaticText(this, wxPRINTID_STATIC, _("To:"), wxPoint(100, 135));
112
113 toText = new wxTextCtrl(this, wxPRINTID_TO, "", wxPoint(133, 130), wxSize(40, -1));
114 }
115
116 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Copies:"), wxPoint(200, 135));
117
118 noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, "", wxPoint(252, 130), wxSize(40, -1));
119
120 wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(40, 180), wxSize(100, -1));
121 (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(180, 180), wxSize(100, -1));
122
123 okButton->SetDefault();
124 okButton->SetFocus();
125 Fit();
126 Centre(wxBOTH);
127
128 // Calls wxWindow::OnInitDialog and then wxGenericPrintDialog::TransferDataToWindow
129 InitDialog();
130 delete[] choices;
131 }
132
133 int wxGenericPrintDialog::ShowModal(void)
134 {
135 if ( printData.GetSetupDialog() )
136 {
137 wxGenericPrintSetupDialog *genericPrintSetupDialog =
138 new wxGenericPrintSetupDialog(GetParent(), wxThePrintSetupData);
139 int ret = genericPrintSetupDialog->ShowModal();
140 if ( ret != wxID_CANCEL )
141 {
142 *wxThePrintSetupData = genericPrintSetupDialog->printData;
143 }
144 genericPrintSetupDialog->Close(TRUE);
145 return ret;
146 }
147 else
148 {
149 return wxDialog::ShowModal();
150 }
151 }
152
153 wxGenericPrintDialog::~wxGenericPrintDialog(void)
154 {
155 }
156
157 void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event))
158 {
159 TransferDataFromWindow();
160
161 // There are some interactions between the global setup data
162 // and the standard print dialog. The global printing 'mode'
163 // is determined by whether the user checks Print to file
164 // or not.
165 if (printData.GetPrintToFile())
166 {
167 wxThePrintSetupData->SetPrinterMode(PS_FILE);
168
169 wxString f = wxFileSelector(_("PostScript file"),
170 wxPathOnly(wxThePrintSetupData->GetPrinterFile()),
171 wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()),
172 "ps", "*.ps", 0, this);
173 if ( f.IsEmpty() )
174 return;
175
176 wxThePrintSetupData->SetPrinterFile(f);
177 }
178 else
179 wxThePrintSetupData->SetPrinterMode(PS_PRINTER);
180
181 EndModal(wxID_OK);
182 }
183
184 void wxGenericPrintDialog::OnRange(wxCommandEvent& event)
185 {
186 if (!fromText) return;
187
188 if (event.GetInt() == 0)
189 {
190 fromText->Enable(FALSE);
191 toText->Enable(FALSE);
192 }
193 else if (event.GetInt() == 1)
194 {
195 fromText->Enable(TRUE);
196 toText->Enable(TRUE);
197 }
198 }
199
200 void wxGenericPrintDialog::OnSetup(wxCommandEvent& WXUNUSED(event))
201 {
202 wxGenericPrintSetupDialog *genericPrintSetupDialog =
203 new wxGenericPrintSetupDialog(this, wxThePrintSetupData);
204 int ret = genericPrintSetupDialog->ShowModal();
205 if ( ret != wxID_CANCEL )
206 {
207 *wxThePrintSetupData = genericPrintSetupDialog->printData;
208 printData.SetOrientation(wxThePrintSetupData->GetPrinterOrientation());
209 }
210
211 genericPrintSetupDialog->Close(TRUE);
212 }
213
214 bool wxGenericPrintDialog::TransferDataToWindow(void)
215 {
216 char buf[10];
217
218 if(printData.GetFromPage() != 0)
219 {
220 if (printData.GetEnablePageNumbers())
221 {
222 fromText->Enable(TRUE);
223 toText->Enable(TRUE);
224
225 sprintf(buf, "%d", printData.GetFromPage());
226 fromText->SetValue(buf);
227 sprintf(buf, "%d", printData.GetToPage());
228 toText->SetValue(buf);
229
230 if (printData.GetAllPages())
231 rangeRadioBox->SetSelection(0);
232 else
233 rangeRadioBox->SetSelection(1);
234 }
235 else
236 {
237 fromText->Enable(FALSE);
238 toText->Enable(FALSE);
239 rangeRadioBox->SetSelection(0);
240 rangeRadioBox->wxRadioBox::Enable(1, FALSE);
241 }
242 }
243 sprintf(buf, "%d", printData.GetNoCopies());
244 noCopiesText->SetValue(buf);
245
246 printToFileCheckBox->SetValue(printData.GetPrintToFile());
247 printToFileCheckBox->Enable(printData.GetEnablePrintToFile());
248 return TRUE;
249 }
250
251 bool wxGenericPrintDialog::TransferDataFromWindow(void)
252 {
253 if(printData.GetFromPage() != -1)
254 {
255 if (printData.GetEnablePageNumbers())
256 {
257 printData.SetFromPage(atoi(fromText->GetValue()));
258 printData.SetToPage(atoi(toText->GetValue()));
259 }
260 if (rangeRadioBox->GetSelection() == 0)
261 printData.SetAllPages(TRUE);
262 else
263 printData.SetAllPages(FALSE);
264 }
265 else
266 { // continuous printing
267 printData.SetFromPage(1);
268 printData.SetToPage(32000);
269 }
270 printData.SetNoCopies(atoi(noCopiesText->GetValue()));
271 printData.SetPrintToFile(printToFileCheckBox->GetValue());
272
273 return TRUE;
274 }
275
276 wxDC *wxGenericPrintDialog::GetPrintDC(void)
277 {
278 return new wxPostScriptDC(wxThePrintSetupData->GetPrinterFile(), FALSE, (wxWindow *) NULL);
279 }
280
281 /*
282 * Generic print setup dialog
283 */
284
285 wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data):
286 wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
287 {
288 if ( data )
289 printData = *data;
290
291 (void) new wxStaticBox(this, wxPRINTID_STATIC, _("Paper size"), wxPoint(10, 10), wxSize(200,60) );
292
293 int xPos = 20;
294 int yPos = 30;
295 paperTypeChoice = CreatePaperTypeChoice(&xPos, &yPos);
296
297 wxString *choices = new wxString[2];
298 choices[0] = _("Portrait");
299 choices[1] = _("Landscape");
300
301 orientationRadioBox = new wxRadioBox(this, wxPRINTID_ORIENTATION, _("Orientation"),
302 wxPoint(10, 80), wxSize(-1, -1), 2, choices, 1, wxRA_VERTICAL );
303 orientationRadioBox->SetSelection(0);
304
305 (void) new wxStaticBox(this, wxPRINTID_STATIC, _("Options"), wxPoint(10, 130), wxSize(200,50) );
306
307 int colourXPos = 145;
308
309 #ifdef __WXMOTIF__
310 colourXPos = 150;
311 #endif
312
313 colourCheckBox = new wxCheckBox(this, wxPRINTID_PRINTCOLOUR, _("Print in colour"), wxPoint(15, colourXPos));
314
315
316 (void) new wxStaticBox(this, wxPRINTID_STATIC, _("Print spooling"), wxPoint(230, 10), wxSize(200,170) );
317
318 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Printer command:"), wxPoint(240, 30));
319
320 printerCommandText = new wxTextCtrl(this, wxPRINTID_COMMAND, "", wxPoint(260, 55), wxSize(150, -1));
321
322 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Printer options:"), wxPoint(240, 110));
323
324 printerOptionsText = new wxTextCtrl(this, wxPRINTID_OPTIONS, "", wxPoint(260, 135), wxSize(150, -1));
325
326 wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(80, 200), wxSize(100, -1));
327 (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(270, 200), wxSize(100, -1));
328
329 okButton->SetDefault();
330 okButton->SetFocus();
331
332 Fit();
333 Centre(wxBOTH);
334
335 InitDialog();
336 delete[] choices;
337 }
338
339 wxGenericPrintSetupDialog::~wxGenericPrintSetupDialog(void)
340 {
341 }
342
343 bool wxGenericPrintSetupDialog::TransferDataToWindow(void)
344 {
345 if (printerCommandText && printData.GetPrinterCommand())
346 printerCommandText->SetValue(printData.GetPrinterCommand());
347 if (printerOptionsText && printData.GetPrinterOptions())
348 printerOptionsText->SetValue(printData.GetPrinterOptions());
349 if (colourCheckBox)
350 colourCheckBox->SetValue(printData.GetColour());
351
352 if (orientationRadioBox)
353 {
354 if (printData.GetPrinterOrientation() == PS_PORTRAIT)
355 orientationRadioBox->SetSelection(0);
356 else
357 orientationRadioBox->SetSelection(1);
358 }
359 return TRUE;
360 }
361
362 bool wxGenericPrintSetupDialog::TransferDataFromWindow(void)
363 {
364 if (printerCommandText)
365 printData.SetPrinterCommand(WXSTRINGCAST printerCommandText->GetValue());
366 if (printerOptionsText)
367 printData.SetPrinterOptions(WXSTRINGCAST printerOptionsText->GetValue());
368 if (colourCheckBox)
369 printData.SetColour(colourCheckBox->GetValue());
370 if (orientationRadioBox)
371 {
372 int sel = orientationRadioBox->GetSelection();
373 if (sel == 0)
374 printData.SetPrinterOrientation(PS_PORTRAIT);
375 else
376 printData.SetPrinterOrientation(PS_LANDSCAPE);
377 }
378 if (paperTypeChoice)
379 {
380 wxString val(paperTypeChoice->GetStringSelection());
381 if (!val.IsNull() && val != "")
382 printData.SetPaperName((char *)(const char *)val);
383 }
384 *wxThePrintSetupData = GetPrintData();
385 return TRUE;
386 }
387
388 wxChoice *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
389 {
390 if (!wxThePrintPaperDatabase)
391 {
392 wxThePrintPaperDatabase = new wxPrintPaperDatabase;
393 wxThePrintPaperDatabase->CreateDatabase();
394 }
395 int n = wxThePrintPaperDatabase->Number();
396 wxString *choices = new wxString [n];
397 int sel = 0;
398 int i;
399 for (i = 0; i < n; i++)
400 {
401 wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Nth(i)->Data();
402 choices[i] = paper->pageName;
403 if (printData.GetPaperName() && choices[i] == printData.GetPaperName())
404 sel = i;
405 }
406
407 int width = 170;
408 #ifdef __WXMOTIF__
409 width = 150;
410 #endif
411
412 wxChoice *choice = new wxChoice(this, wxPRINTID_PAPERSIZE, wxPoint(*x, *y), wxSize(width, -1), n,
413 choices);
414
415 delete[] choices;
416
417 choice->SetSelection(sel);
418 return choice;
419 }
420 #endif
421 // wxUSE_POSTSCRIPT
422
423 /*
424 * Generic page setup dialog
425 */
426
427 void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
428 {
429 // We no longer query GetPrintMode, so we can eliminate the need
430 // to call SetPrintMode.
431 // This has the limitation that we can't explicitly call the PostScript
432 // print setup dialog from the generic Page Setup dialog under Windows,
433 // but since this choice would only happen when trying to do PostScript
434 // printing under Windows (and only in 16-bit Windows which
435 // doesn't have a Windows-specific page setup dialog) it's worth it.
436
437 wxPrintData data;
438 data.SetSetupDialog(TRUE);
439 wxPrintDialog *printDialog = new wxPrintDialog(this, & data);
440 printDialog->ShowModal();
441
442 printDialog->Destroy();
443 }
444
445 wxGenericPageSetupDialog::wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data):
446 wxDialog(parent, -1, _("Page Setup"), wxPoint(0, 0), wxSize(600, 600), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
447 {
448 if ( data )
449 pageData = *data;
450
451 int buttonWidth = 75;
452 int buttonHeight = 25;
453 int spacing = 5;
454 #ifdef __WXMOTIF__
455 spacing = 15;
456 #endif
457
458 int yPos = 5;
459 int xPos = 5;
460
461 wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(5, yPos), wxSize(buttonWidth, buttonHeight));
462 (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(buttonWidth + 5 + spacing, yPos), wxSize(buttonWidth, buttonHeight));
463
464 printerButton = new wxButton(this, wxPRINTID_SETUP, _("Printer..."), wxPoint(buttonWidth*2 + 5 + 2*spacing, yPos), wxSize(buttonWidth, buttonHeight));
465
466 if ( !pageData.GetEnablePrinter() )
467 printerButton->Enable(FALSE);
468
469 // if (printData.GetEnableHelp())
470 // wxButton *helpButton = new wxButton(this, (wxFunction)wxGenericPageSetupHelpProc, _("Help"), -1, -1, buttonWidth, buttonHeight);
471
472 okButton->SetDefault();
473 okButton->SetFocus();
474
475 xPos = 5;
476 yPos += 35;
477
478 #ifdef __WXMOTIF__
479 yPos += 10;
480 #endif
481
482 paperTypeChoice = CreatePaperTypeChoice(&xPos, &yPos);
483
484 xPos = 5;
485
486 wxString *choices = new wxString[2];
487 choices[0] = _("Portrait");
488 choices[1] = _("Landscape");
489 orientationRadioBox = new wxRadioBox(this, wxPRINTID_ORIENTATION, _("Orientation"),
490 wxPoint(xPos, yPos), wxSize(-1, -1), 2, choices, 2);
491 orientationRadioBox->SetSelection(0);
492
493 xPos = 5;
494 yPos += 60;
495
496 int staticWidth = 110;
497 #ifdef __WXMOTIF__
498 staticWidth += 20;
499 #endif
500
501 int textWidth = 60;
502 spacing = 10;
503
504 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Left margin (mm):"), wxPoint(xPos, yPos));
505 xPos += staticWidth;
506
507 marginLeftText = new wxTextCtrl(this, wxPRINTID_LEFTMARGIN, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
508 xPos += textWidth + spacing;
509
510 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Right margin (mm):"), wxPoint(xPos, yPos));
511 xPos += staticWidth;
512
513 marginRightText = new wxTextCtrl(this, wxPRINTID_RIGHTMARGIN, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
514 xPos += textWidth + spacing;
515
516 yPos += 35;
517 xPos = 5;
518
519 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Top margin (mm):"), wxPoint(xPos, yPos));
520 xPos += staticWidth;
521
522 marginTopText = new wxTextCtrl(this, wxPRINTID_TOPMARGIN, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
523 xPos += textWidth + spacing;
524
525 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Bottom margin (mm):"), wxPoint(xPos, yPos));
526 xPos += staticWidth;
527
528 marginBottomText = new wxTextCtrl(this, wxPRINTID_BOTTOMMARGIN, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
529
530 Fit();
531 Centre(wxBOTH);
532
533 InitDialog();
534 delete [] choices;
535 }
536
537 wxGenericPageSetupDialog::~wxGenericPageSetupDialog(void)
538 {
539 }
540
541 bool wxGenericPageSetupDialog::TransferDataToWindow(void)
542 {
543 if (marginLeftText)
544 marginLeftText->SetValue(IntToString((int) pageData.GetMarginTopLeft().x));
545 if (marginTopText)
546 marginTopText->SetValue(IntToString((int) pageData.GetMarginTopLeft().y));
547 if (marginRightText)
548 marginRightText->SetValue(IntToString((int) pageData.GetMarginBottomRight().x));
549 if (marginBottomText)
550 marginBottomText->SetValue(IntToString((int) pageData.GetMarginBottomRight().y));
551
552 if (orientationRadioBox)
553 {
554 if (pageData.GetOrientation() == wxPORTRAIT)
555 orientationRadioBox->SetSelection(0);
556 else
557 orientationRadioBox->SetSelection(1);
558 }
559 return TRUE;
560 }
561
562 bool wxGenericPageSetupDialog::TransferDataFromWindow(void)
563 {
564 if (marginLeftText && marginTopText)
565 pageData.SetMarginTopLeft(wxPoint(atoi((const char *)marginLeftText->GetValue()),atoi((const char *)marginTopText->GetValue())));
566 if (marginRightText && marginBottomText)
567 pageData.SetMarginBottomRight(wxPoint(atoi((const char *)marginRightText->GetValue()),atoi((const char *)marginBottomText->GetValue())));
568
569 if (orientationRadioBox)
570 {
571 int sel = orientationRadioBox->GetSelection();
572 if (sel == 0)
573 {
574 #if wxUSE_POSTSCRIPT
575 wxThePrintSetupData->SetPrinterOrientation(wxPORTRAIT);
576 #endif
577 pageData.SetOrientation(wxPORTRAIT);
578 }
579 else
580 {
581 #if wxUSE_POSTSCRIPT
582 wxThePrintSetupData->SetPrinterOrientation(wxLANDSCAPE);
583 #endif
584 pageData.SetOrientation(wxLANDSCAPE);
585 }
586 }
587 if (paperTypeChoice)
588 {
589 wxString val(paperTypeChoice->GetStringSelection());
590 if (!val.IsNull() && val != "")
591 {
592 wxPrintPaperType* paper = wxThePrintPaperDatabase->FindPaperType((char*) (const char *)val);
593 if ( paper )
594 {
595 pageData.SetPaperSize(wxPoint(paper->widthMM, paper->heightMM));
596 }
597 }
598 }
599
600 return TRUE;
601 }
602
603 wxChoice *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y)
604 {
605 if (!wxThePrintPaperDatabase)
606 {
607 wxThePrintPaperDatabase = new wxPrintPaperDatabase;
608 wxThePrintPaperDatabase->CreateDatabase();
609 }
610 int n = wxThePrintPaperDatabase->Number();
611 wxString *choices = new wxString [n];
612 int sel = 0;
613 int i;
614 for (i = 0; i < n; i++)
615 {
616 wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Nth(i)->Data();
617 choices[i] = paper->pageName;
618 if (pageData.GetPaperSize().x == paper->widthMM && pageData.GetPaperSize().y == paper->heightMM)
619 sel = i;
620 }
621
622 (void) new wxStaticText(this, wxPRINTID_STATIC, _("Paper size"), wxPoint(*x, *y));
623 *y += 25;
624
625 wxChoice *choice = new wxChoice(this, wxPRINTID_PAPERSIZE, wxPoint(*x, *y), wxSize(300, -1), n,
626 choices);
627 *y += 35;
628 delete[] choices;
629
630 choice->SetSelection(sel);
631 return choice;
632 }
633