added option to hide page controls

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1998-08-14 11:20:00 +00:00
parent 163f0dbef0
commit 64a1451536

View File

@@ -96,9 +96,12 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
fromText = (wxTextCtrl*)NULL; fromText = (wxTextCtrl*)NULL;
if(printData.GetFromPage() != 0)
{
rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"), rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"),
wxPoint(5, yPos), wxSize(-1, -1), 2, choices, 2); wxPoint(5, yPos), wxSize(-1, -1), 2, choices, 2);
rangeRadioBox->SetSelection(1); rangeRadioBox->SetSelection(1);
}
yPos += 60; yPos += 60;
xPos = 5; xPos = 5;
@@ -106,6 +109,8 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
int textWidth = 40; int textWidth = 40;
spacing = 10; spacing = 10;
if(printData.GetFromPage() != 0)
{
(void) new wxStaticText(this, wxPRINTID_STATIC, _("From:"), wxPoint(xPos, yPos)); (void) new wxStaticText(this, wxPRINTID_STATIC, _("From:"), wxPoint(xPos, yPos));
xPos += staticWidth; xPos += staticWidth;
@@ -117,6 +122,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
toText = new wxTextCtrl(this, wxPRINTID_TO, "", wxPoint(xPos, yPos), wxSize(textWidth, -1)); toText = new wxTextCtrl(this, wxPRINTID_TO, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
xPos += spacing + textWidth; xPos += spacing + textWidth;
}
(void) new wxStaticText(this, wxPRINTID_STATIC, _("Copies:"), wxPoint(xPos, yPos)); (void) new wxStaticText(this, wxPRINTID_STATIC, _("Copies:"), wxPoint(xPos, yPos));
xPos += spacing + staticWidth; xPos += spacing + staticWidth;
@@ -219,6 +225,9 @@ void wxGenericPrintDialog::OnSetup(wxCommandEvent& WXUNUSED(event))
bool wxGenericPrintDialog::TransferDataToWindow(void) bool wxGenericPrintDialog::TransferDataToWindow(void)
{ {
char buf[10]; char buf[10];
if(printData.GetFromPage() != 0)
{
if (printData.GetEnablePageNumbers()) if (printData.GetEnablePageNumbers())
{ {
fromText->Enable(TRUE); fromText->Enable(TRUE);
@@ -226,7 +235,7 @@ bool wxGenericPrintDialog::TransferDataToWindow(void)
sprintf(buf, "%d", printData.GetFromPage()); sprintf(buf, "%d", printData.GetFromPage());
fromText->SetValue(buf); fromText->SetValue(buf);
sprintf(buf, "%d", printData.GetToPage()); sprintf(buf, "% d", printData.GetFromPage());
toText->SetValue(buf); toText->SetValue(buf);
if (printData.GetAllPages()) if (printData.GetAllPages())
@@ -241,6 +250,7 @@ bool wxGenericPrintDialog::TransferDataToWindow(void)
rangeRadioBox->SetSelection(0); rangeRadioBox->SetSelection(0);
rangeRadioBox->wxRadioBox::Enable(1, FALSE); rangeRadioBox->wxRadioBox::Enable(1, FALSE);
} }
}
sprintf(buf, "%d", printData.GetNoCopies()); sprintf(buf, "%d", printData.GetNoCopies());
noCopiesText->SetValue(buf); noCopiesText->SetValue(buf);
@@ -250,6 +260,8 @@ bool wxGenericPrintDialog::TransferDataToWindow(void)
} }
bool wxGenericPrintDialog::TransferDataFromWindow(void) bool wxGenericPrintDialog::TransferDataFromWindow(void)
{
if(printData.GetFromPage() != -1)
{ {
if (printData.GetEnablePageNumbers()) if (printData.GetEnablePageNumbers())
{ {
@@ -260,6 +272,12 @@ bool wxGenericPrintDialog::TransferDataFromWindow(void)
printData.SetAllPages(TRUE); printData.SetAllPages(TRUE);
else else
printData.SetAllPages(FALSE); printData.SetAllPages(FALSE);
}
else
{ // continuous printing
printData.SetFromPage(1);
printData.SetToPage(32000);
}
printData.SetNoCopies(atoi(noCopiesText->GetValue())); printData.SetNoCopies(atoi(noCopiesText->GetValue()));
printData.SetPrintToFile(printToFileCheckBox->GetValue()); printData.SetPrintToFile(printToFileCheckBox->GetValue());