Added Ok() member for print data, print dialog, page dialog, page dialog data

so we can test in advance whether the print/page setup dialogs will fail.
Removed assertions that would fire if the default printer was not found, for example.
Added call to Ok() from HTML print code with suitable error message.
Commented out my erroneous fix to wxStaticText.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-05-08 19:00:43 +00:00
parent c0187f69d6
commit 58cf0491e3
6 changed files with 79 additions and 8 deletions

View File

@@ -853,6 +853,16 @@ void wxPrintData::operator=(const wxPrintSetupData& setupData)
}
#endif // wxCOMPATIBILITY_WITH_PRINTSETUPDATA
// Is this data OK for showing the print dialog?
bool wxPrintData::Ok() const
{
#ifdef __WXMSW__
((wxPrintData*)this)->ConvertToNative();
return (m_devMode != NULL) ;
#else
return TRUE;
#endif
}
// ----------------------------------------------------------------------------
// Print dialog data
@@ -967,7 +977,8 @@ void wxPrintDialogData::ConvertToNative()
m_printData.SetNativeData((void*) NULL);
wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
// Shouldn't assert; we should be able to test Ok-ness at a higher level
//wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
pd->hDevNames = (HGLOBAL)(DWORD) m_printData.GetNativeDataDevNames();
@@ -1279,7 +1290,8 @@ void wxPageSetupDialogData::ConvertToNative()
m_printData.SetNativeData((void*) NULL);
wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
// Shouldn't assert; we should be able to test Ok-ness at a higher level
//wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
// Pass the devnames data (created in m_printData.ConvertToNative)
// to the PRINTDLG structure, since it'll