bool MyApp::OnInit(void)
{
+ if ( !wxApp::OnInit() )
+ return false;
+
wxInitAllImageHandlers();
m_testFont.Create(10, wxSWISS, wxNORMAL, wxNORMAL);
g_printData = new wxPrintData;
- // Set an initial paper size
+ // You could set an initial paper size here
// g_printData->SetPaperId(wxPAPER_LETTER); // for Americans
- g_printData->SetPaperId(wxPAPER_A4); // for everyone else
+// g_printData->SetPaperId(wxPAPER_A4); // for everyone else
g_pageSetupData = new wxPageSetupDialogData;
// copy over initial paper size from print record
{ // GetTextExtent demo:
wxString words[7] = {_T("This "), _T("is "), _T("GetTextExtent "), _T("testing "), _T("string. "), _T("Enjoy "), _T("it!")};
- long w, h;
+ wxCoord w, h;
long x = 200, y= 250;
wxFont fnt(15, wxSWISS, wxNORMAL, wxNORMAL);
float topMarginLogical = (float)(mmToLogical*topMargin);
float rightMarginLogical = (float)(mmToLogical*(pageWidthMM - rightMargin));
- long xExtent, yExtent;
+ wxCoord xExtent, yExtent;
dc->GetTextExtent(text, &xExtent, &yExtent);
float xPos = (float)(((((pageWidthMM - leftMargin - rightMargin)/2.0)+leftMargin)*mmToLogical) - (xExtent/2.0));
dc->DrawText(text, (long)xPos, (long)topMarginLogical);