X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58ed4361e90ebca9e84b112dd4791dee38503556..48889bca6f8b2504f78c0f47b32f5e95c64d915d:/samples/splash/splash.cpp?ds=sidebyside diff --git a/samples/splash/splash.cpp b/samples/splash/splash.cpp index 9fe6957fe7..3b9af61fd4 100644 --- a/samples/splash/splash.cpp +++ b/samples/splash/splash.cpp @@ -90,7 +90,7 @@ private: // IDs for the controls and the menu commands enum { - Minimal_Run = wxID_HIGHEST + 1, + Minimal_Run = wxID_HIGHEST + 1 }; // ---------------------------------------------------------------------------- @@ -123,6 +123,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxImage::AddHandler(new wxPNGHandler); // create the main application window @@ -144,7 +147,11 @@ bool MyApp::OnInit() 6000, frame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxSTAY_ON_TOP); } + +#if !defined(__WXGTK20__) + // we don't need it at least on wxGTK with GTK+ 2.12.9 wxYield(); +#endif // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -217,14 +224,17 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) if (ok) { wxImage image = bitmap.ConvertToImage(); + // do not scale on already small screens if (!m_isPda) image.Rescale( bitmap.GetWidth()/2, bitmap.GetHeight()/2 ); + bitmap = wxBitmap(image); wxSplashScreen *splash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_PARENT | wxSPLASH_NO_TIMEOUT, 0, this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxSTAY_ON_TOP); + wxWindow *win = splash->GetSplashWindow(); #if wxUSE_MEDIACTRL wxMediaCtrl *media = new wxMediaCtrl( win, wxID_EXIT, _T("press.mpg"), wxPoint(2,2)); @@ -232,7 +242,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) #else wxStaticText *text = new wxStaticText( win, wxID_EXIT, - _T("click somewhere\non image"), + _T("click somewhere\non this image"), wxPoint(m_isPda ? 0 : 13, m_isPda ? 0 : 11) );