1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/splash.h
3 // Purpose: Splash screen class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows Licence
9 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/bitmap.h"
15 #include "wx/eventfilter.h"
21 * A window for displaying a splash screen
24 #define wxSPLASH_CENTRE_ON_PARENT 0x01
25 #define wxSPLASH_CENTRE_ON_SCREEN 0x02
26 #define wxSPLASH_NO_CENTRE 0x00
27 #define wxSPLASH_TIMEOUT 0x04
28 #define wxSPLASH_NO_TIMEOUT 0x00
30 class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow
;
36 class WXDLLIMPEXP_ADV wxSplashScreen
: public wxFrame
,
40 // for RTTI macros only
41 wxSplashScreen() { Init(); }
42 wxSplashScreen(const wxBitmap
& bitmap
, long splashStyle
, int milliseconds
,
43 wxWindow
* parent
, wxWindowID id
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 long style
= wxSIMPLE_BORDER
|wxFRAME_NO_TASKBAR
|wxSTAY_ON_TOP
);
47 virtual ~wxSplashScreen();
49 void OnCloseWindow(wxCloseEvent
& event
);
50 void OnNotify(wxTimerEvent
& event
);
52 long GetSplashStyle() const { return m_splashStyle
; }
53 wxSplashScreenWindow
* GetSplashWindow() const { return m_window
; }
54 int GetTimeout() const { return m_milliseconds
; }
56 // Override wxEventFilter method to hide splash screen on any user input.
57 virtual int FilterEvent(wxEvent
& event
);
60 // Common part of all ctors.
63 wxSplashScreenWindow
* m_window
;
68 DECLARE_DYNAMIC_CLASS(wxSplashScreen
)
70 wxDECLARE_NO_COPY_CLASS(wxSplashScreen
);
74 * wxSplashScreenWindow
77 class WXDLLIMPEXP_ADV wxSplashScreenWindow
: public wxWindow
80 wxSplashScreenWindow(const wxBitmap
& bitmap
, wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
, long style
= wxNO_BORDER
);
82 void OnPaint(wxPaintEvent
& event
);
83 void OnEraseBackground(wxEraseEvent
& event
);
85 void SetBitmap(const wxBitmap
& bitmap
) { m_bitmap
= bitmap
; }
86 wxBitmap
& GetBitmap() { return m_bitmap
; }
92 wxDECLARE_NO_COPY_CLASS(wxSplashScreenWindow
);