]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/splash.h
Only return -1,0,1 from wxXmlResource::CompareVersion().
[wxWidgets.git] / include / wx / generic / splash.h
CommitLineData
3f4fc796 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/generic/splash.h
3f4fc796
JS
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
99d80019 9// Licence: wxWindows Licence
3f4fc796
JS
10/////////////////////////////////////////////////////////////////////////////
11
3f4fc796
JS
12#ifndef _WX_SPLASH_H_
13#define _WX_SPLASH_H_
14
d84d25dd 15#include "wx/bitmap.h"
6e043ba9 16#include "wx/eventfilter.h"
d84d25dd 17#include "wx/frame.h"
6e043ba9 18#include "wx/timer.h"
d84d25dd 19
3f4fc796
JS
20
21/*
22 * A window for displaying a splash screen
23 */
24
25#define wxSPLASH_CENTRE_ON_PARENT 0x01
26#define wxSPLASH_CENTRE_ON_SCREEN 0x02
27#define wxSPLASH_NO_CENTRE 0x00
28#define wxSPLASH_TIMEOUT 0x04
29#define wxSPLASH_NO_TIMEOUT 0x00
30
b5dbe15d 31class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow;
3f4fc796
JS
32
33/*
34 * wxSplashScreen
35 */
36
6e043ba9
VZ
37class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame,
38 public wxEventFilter
3f4fc796
JS
39{
40public:
479101ca 41 // for RTTI macros only
6e043ba9 42 wxSplashScreen() { Init(); }
479101ca
RD
43 wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
44 wxWindow* parent, wxWindowID id,
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
47 long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP);
d3c7fc99 48 virtual ~wxSplashScreen();
3f4fc796
JS
49
50 void OnCloseWindow(wxCloseEvent& event);
51 void OnNotify(wxTimerEvent& event);
52
53 long GetSplashStyle() const { return m_splashStyle; }
54 wxSplashScreenWindow* GetSplashWindow() const { return m_window; }
55 int GetTimeout() const { return m_milliseconds; }
56
6e043ba9
VZ
57 // Override wxEventFilter method to hide splash screen on any user input.
58 virtual int FilterEvent(wxEvent& event);
59
3f4fc796 60protected:
6e043ba9
VZ
61 // Common part of all ctors.
62 void Init();
63
3f4fc796
JS
64 wxSplashScreenWindow* m_window;
65 long m_splashStyle;
66 int m_milliseconds;
67 wxTimer m_timer;
68
12f190b0
VS
69 DECLARE_DYNAMIC_CLASS(wxSplashScreen)
70 DECLARE_EVENT_TABLE()
c0c133e1 71 wxDECLARE_NO_COPY_CLASS(wxSplashScreen);
3f4fc796
JS
72};
73
74/*
75 * wxSplashScreenWindow
76 */
77
12f190b0 78class WXDLLIMPEXP_ADV wxSplashScreenWindow: public wxWindow
3f4fc796
JS
79{
80public:
81 wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER);
82
83 void OnPaint(wxPaintEvent& event);
84 void OnEraseBackground(wxEraseEvent& event);
3f4fc796
JS
85
86 void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
87 wxBitmap& GetBitmap() { return m_bitmap; }
88
89protected:
90 wxBitmap m_bitmap;
91
2eb10e2a 92 DECLARE_EVENT_TABLE()
c0c133e1 93 wxDECLARE_NO_COPY_CLASS(wxSplashScreenWindow);
3f4fc796
JS
94};
95
96
97#endif
98 // _WX_SPLASH_H_