]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: splash.h | |
e54c96f1 | 3 | // Purpose: interface of wxSplashScreen |
23324ae1 | 4 | // Author: wxWidgets team |
526954c5 | 5 | // Licence: wxWindows licence |
23324ae1 FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
c9db153a RD |
8 | #define wxSPLASH_CENTRE_ON_PARENT 0x01 |
9 | #define wxSPLASH_CENTRE_ON_SCREEN 0x02 | |
10 | #define wxSPLASH_NO_CENTRE 0x00 | |
11 | #define wxSPLASH_TIMEOUT 0x04 | |
12 | #define wxSPLASH_NO_TIMEOUT 0x00 | |
13 | ||
14 | ||
23324ae1 FM |
15 | /** |
16 | @class wxSplashScreen | |
7c913512 | 17 | |
23324ae1 | 18 | wxSplashScreen shows a window with a thin border, displaying a bitmap |
e725ba4f FM |
19 | describing your application. |
20 | ||
21 | Show it in application initialisation, and then either explicitly destroy | |
23324ae1 | 22 | it or let it time-out. |
7c913512 | 23 | |
23324ae1 | 24 | Example usage: |
7c913512 | 25 | |
23324ae1 | 26 | @code |
e725ba4f | 27 | wxBitmap bitmap; |
23324ae1 FM |
28 | if (bitmap.LoadFile("splash16.png", wxBITMAP_TYPE_PNG)) |
29 | { | |
30 | wxSplashScreen* splash = new wxSplashScreen(bitmap, | |
31 | wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, | |
6bfc18d0 | 32 | 6000, NULL, -1, wxDefaultPosition, wxDefaultSize, |
23324ae1 FM |
33 | wxBORDER_SIMPLE|wxSTAY_ON_TOP); |
34 | } | |
35 | wxYield(); | |
36 | @endcode | |
7c913512 | 37 | |
23324ae1 FM |
38 | @library{wxadv} |
39 | @category{managedwnd} | |
40 | */ | |
41 | class wxSplashScreen : public wxFrame | |
42 | { | |
43 | public: | |
44 | /** | |
45 | Construct the splash screen passing a bitmap, a style, a timeout, a window id, | |
e725ba4f FM |
46 | optional position and size, and a window style. |
47 | ||
4cc4bfaf | 48 | @a splashStyle is a bitlist of some of the following: |
e725ba4f FM |
49 | - wxSPLASH_CENTRE_ON_PARENT |
50 | - wxSPLASH_CENTRE_ON_SCREEN | |
51 | - wxSPLASH_NO_CENTRE | |
52 | - wxSPLASH_TIMEOUT | |
53 | - wxSPLASH_NO_TIMEOUT | |
54 | ||
4cc4bfaf | 55 | @a milliseconds is the timeout in milliseconds. |
23324ae1 FM |
56 | */ |
57 | wxSplashScreen(const wxBitmap& bitmap, long splashStyle, | |
58 | int milliseconds, | |
59 | wxWindow* parent, | |
60 | wxWindowID id, | |
61 | const wxPoint& pos = wxDefaultPosition, | |
62 | const wxSize& size = wxDefaultSize, | |
63 | long style = wxBORDER_SIMPLE|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP); | |
64 | ||
65 | /** | |
66 | Destroys the splash screen. | |
67 | */ | |
adaaa686 | 68 | virtual ~wxSplashScreen(); |
23324ae1 FM |
69 | |
70 | /** | |
e725ba4f | 71 | Returns the splash style (see wxSplashScreen() for details). |
23324ae1 | 72 | */ |
328f5751 | 73 | long GetSplashStyle() const; |
23324ae1 FM |
74 | |
75 | /** | |
76 | Returns the window used to display the bitmap. | |
77 | */ | |
328f5751 | 78 | wxSplashScreenWindow* GetSplashWindow() const; |
23324ae1 FM |
79 | |
80 | /** | |
81 | Returns the timeout in milliseconds. | |
82 | */ | |
328f5751 | 83 | int GetTimeout() const; |
23324ae1 FM |
84 | |
85 | /** | |
86 | Reimplement this event handler if you want to set an application variable on | |
87 | window destruction, for example. | |
88 | */ | |
89 | void OnCloseWindow(wxCloseEvent& event); | |
90 | }; | |
e54c96f1 | 91 |