]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/splash.h
Add wxUSE_RIBBON to wx/setup_inc.h and wx/chkconf.h.
[wxWidgets.git] / include / wx / generic / splash.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: splash.h
3 // Purpose: Splash screen class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 28/6/2000
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_SPLASH_H_
13 #define _WX_SPLASH_H_
14
15 #include "wx/bitmap.h"
16 #include "wx/timer.h"
17 #include "wx/frame.h"
18
19
20 /*
21 * A window for displaying a splash screen
22 */
23
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
29
30 class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow;
31
32 /*
33 * wxSplashScreen
34 */
35
36 class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame
37 {
38 public:
39 // for RTTI macros only
40 wxSplashScreen() {}
41 wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
42 wxWindow* parent, wxWindowID id,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP);
46 virtual ~wxSplashScreen();
47
48 void OnCloseWindow(wxCloseEvent& event);
49 void OnNotify(wxTimerEvent& event);
50
51 long GetSplashStyle() const { return m_splashStyle; }
52 wxSplashScreenWindow* GetSplashWindow() const { return m_window; }
53 int GetTimeout() const { return m_milliseconds; }
54
55 protected:
56 wxSplashScreenWindow* m_window;
57 long m_splashStyle;
58 int m_milliseconds;
59 wxTimer m_timer;
60
61 DECLARE_DYNAMIC_CLASS(wxSplashScreen)
62 DECLARE_EVENT_TABLE()
63 wxDECLARE_NO_COPY_CLASS(wxSplashScreen);
64 };
65
66 /*
67 * wxSplashScreenWindow
68 */
69
70 class WXDLLIMPEXP_ADV wxSplashScreenWindow: public wxWindow
71 {
72 public:
73 wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER);
74
75 void OnPaint(wxPaintEvent& event);
76 void OnEraseBackground(wxEraseEvent& event);
77 void OnMouseEvent(wxMouseEvent& event);
78 void OnChar(wxKeyEvent& event);
79
80 void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
81 wxBitmap& GetBitmap() { return m_bitmap; }
82
83 protected:
84 wxBitmap m_bitmap;
85
86 DECLARE_EVENT_TABLE()
87 wxDECLARE_NO_COPY_CLASS(wxSplashScreenWindow);
88 };
89
90
91 #endif
92 // _WX_SPLASH_H_