bool MyApp::OnInit(void)
{
+ if ( !wxApp::OnInit() )
+ return false;
+
wxInitAllImageHandlers();
m_testFont.Create(10, wxSWISS, wxNORMAL, wxNORMAL);
{ // 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);