- char buf[10];
- if (printData.GetEnablePageNumbers())
- {
- fromText->Enable(TRUE);
- toText->Enable(TRUE);
-
- sprintf(buf, "%d", printData.GetFromPage());
- fromText->SetValue(buf);
- sprintf(buf, "%d", printData.GetToPage());
- toText->SetValue(buf);
-
- if (printData.GetAllPages())
- rangeRadioBox->SetSelection(0);
- else
- rangeRadioBox->SetSelection(1);
- }
- else
- {
- fromText->Enable(FALSE);
- toText->Enable(FALSE);
- rangeRadioBox->SetSelection(0);
- rangeRadioBox->wxRadioBox::Enable(1, FALSE);
- }
- sprintf(buf, "%d", printData.GetNoCopies());
- noCopiesText->SetValue(buf);
-
- printToFileCheckBox->SetValue(printData.GetPrintToFile());
- printToFileCheckBox->Enable(printData.GetEnablePrintToFile());
- return TRUE;
+ char buf[10];
+
+ if(m_printDialogData.GetFromPage() != 0)
+ {
+ if(m_fromText)
+ {
+ if (m_printDialogData.GetEnablePageNumbers())
+ {
+ m_fromText->Enable(TRUE);
+ m_toText->Enable(TRUE);
+ sprintf(buf, "%d", m_printDialogData.GetFromPage());
+ m_fromText->SetValue(buf);
+ sprintf(buf, "%d", m_printDialogData.GetToPage());
+ m_toText->SetValue(buf);
+ if(m_rangeRadioBox)
+ if (m_printDialogData.GetAllPages())
+ m_rangeRadioBox->SetSelection(0);
+ else
+ m_rangeRadioBox->SetSelection(1);
+ }
+ else
+ {
+ m_fromText->Enable(FALSE);
+ m_toText->Enable(FALSE);
+ if(m_rangeRadioBox)
+ {
+ m_rangeRadioBox->SetSelection(0);
+ m_rangeRadioBox->wxRadioBox::Enable(1, FALSE);
+ }
+ }
+ }
+ }
+ sprintf(buf, "%d", m_printDialogData.GetNoCopies());
+ m_noCopiesText->SetValue(buf);
+
+ m_printToFileCheckBox->SetValue(m_printDialogData.GetPrintToFile());
+ m_printToFileCheckBox->Enable(m_printDialogData.GetEnablePrintToFile());
+ return TRUE;