splash.h 2.6 KB

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