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)
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));
#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)
);
#include "wx/dcclient.h"
#endif
-/*
- * wxSplashScreen
- */
-#define wxSPLASH_TIMER_ID 9999
+// ----------------------------------------------------------------------------
+// wxSplashScreen
+// ----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxSplashScreen, wxFrame)
+#define wxSPLASH_TIMER_ID 9999
+IMPLEMENT_DYNAMIC_CLASS(wxSplashScreen, wxFrame)
BEGIN_EVENT_TABLE(wxSplashScreen, wxFrame)
EVT_TIMER(wxSPLASH_TIMER_ID, wxSplashScreen::OnNotify)
EVT_CLOSE(wxSplashScreen::OnCloseWindow)
* slightly too small.
*/
-wxSplashScreen::wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style):
- wxFrame(parent, id, wxEmptyString, wxPoint(0,0), wxSize(100, 100), style)
+wxSplashScreen::wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
+ wxWindow* parent, wxWindowID id, const wxPoint& pos,
+ const wxSize& size, long style)
+ : wxFrame(parent, id, wxEmptyString, wxPoint(0,0), wxSize(100, 100), style)
{
// At least for GTK+ 2.0, this hint is not available.
#if defined(__WXGTK20__)
m_window->SetFocus();
#if defined( __WXMSW__ ) || defined(__WXMAC__)
Update(); // Without this, you see a blank screen for an instant
+#elif defined(__WXGTK20__)
+ // we don't need to do anything at least on wxGTK with GTK+ 2.12.9
#else
wxYieldIfNeeded(); // Should eliminate this
#endif
this->Destroy();
}
-/*
- * wxSplashScreenWindow
- */
+// ----------------------------------------------------------------------------
+// wxSplashScreenWindow
+// ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxSplashScreenWindow, wxWindow)
#ifdef __WXGTK__
EVT_MOUSE_EVENTS(wxSplashScreenWindow::OnMouseEvent)
END_EVENT_TABLE()
-wxSplashScreenWindow::wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style):
- wxWindow(parent, id, pos, size, style)
+wxSplashScreenWindow::wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent,
+ wxWindowID id, const wxPoint& pos,
+ const wxSize& size, long style)
+ : wxWindow(parent, id, pos, size, style)
{
m_bitmap = bitmap;
SetPalette(* bitmap.GetPalette());
}
#endif
-
}
// VZ: why don't we do it under wxGTK?
void wxSplashScreenWindow::OnEraseBackground(wxEraseEvent& event)
{
- if (event.GetDC())
+ if (event.GetDC() && m_bitmap.Ok())
{
- if (m_bitmap.Ok())
- {
- wxDrawSplashBitmap(* event.GetDC(), m_bitmap, 0, 0);
- }
+ wxDrawSplashBitmap(* event.GetDC(), m_bitmap, 0, 0);
}
else
{
wxClientDC dc(this);
if (m_bitmap.Ok())
- {
wxDrawSplashBitmap(dc, m_bitmap, 0, 0);
- }
}
}
{
if (event.LeftDown() || event.RightDown())
GetParent()->Close(true);
+ else
+ event.Skip();
}
void wxSplashScreenWindow::OnChar(wxKeyEvent& WXUNUSED(event))