]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/splash.h
Use wxGetTranslation() instead of _() in the public headers.
[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
3f4fc796 7// Copyright: (c) Julian Smart
99d80019 8// Licence: wxWindows Licence
3f4fc796
JS
9/////////////////////////////////////////////////////////////////////////////
10
3f4fc796
JS
11#ifndef _WX_SPLASH_H_
12#define _WX_SPLASH_H_
13
d84d25dd 14#include "wx/bitmap.h"
6e043ba9 15#include "wx/eventfilter.h"
d84d25dd 16#include "wx/frame.h"
6e043ba9 17#include "wx/timer.h"
d84d25dd 18
3f4fc796
JS
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
b5dbe15d 30class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow;
3f4fc796
JS
31
32/*
33 * wxSplashScreen
34 */
35
6e043ba9
VZ
36class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame,
37 public wxEventFilter
3f4fc796
JS
38{
39public:
479101ca 40 // for RTTI macros only
6e043ba9 41 wxSplashScreen() { Init(); }
479101ca
RD
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);
d3c7fc99 47 virtual ~wxSplashScreen();
3f4fc796
JS
48
49 void OnCloseWindow(wxCloseEvent& event);
50 void OnNotify(wxTimerEvent& event);
51
52 long GetSplashStyle() const { return m_splashStyle; }
53 wxSplashScreenWindow* GetSplashWindow() const { return m_window; }
54 int GetTimeout() const { return m_milliseconds; }
55
6e043ba9
VZ
56 // Override wxEventFilter method to hide splash screen on any user input.
57 virtual int FilterEvent(wxEvent& event);
58
3f4fc796 59protected:
6e043ba9
VZ
60 // Common part of all ctors.
61 void Init();
62
3f4fc796
JS
63 wxSplashScreenWindow* m_window;
64 long m_splashStyle;
65 int m_milliseconds;
66 wxTimer m_timer;
67
12f190b0
VS
68 DECLARE_DYNAMIC_CLASS(wxSplashScreen)
69 DECLARE_EVENT_TABLE()
c0c133e1 70 wxDECLARE_NO_COPY_CLASS(wxSplashScreen);
3f4fc796
JS
71};
72
73/*
74 * wxSplashScreenWindow
75 */
76
12f190b0 77class WXDLLIMPEXP_ADV wxSplashScreenWindow: public wxWindow
3f4fc796
JS
78{
79public:
80 wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER);
81
82 void OnPaint(wxPaintEvent& event);
83 void OnEraseBackground(wxEraseEvent& event);
3f4fc796
JS
84
85 void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
86 wxBitmap& GetBitmap() { return m_bitmap; }
87
88protected:
89 wxBitmap m_bitmap;
90
2eb10e2a 91 DECLARE_EVENT_TABLE()
c0c133e1 92 wxDECLARE_NO_COPY_CLASS(wxSplashScreenWindow);
3f4fc796
JS
93};
94
95
96#endif
97 // _WX_SPLASH_H_