![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
00001 /******************************************************************************** 00002 * * 00003 * S p l a s h W i n d o w * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2004,2010 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published by * 00010 * the Free Software Foundation; either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with this program. If not, see <http://www.gnu.org/licenses/> * 00020 ********************************************************************************/ 00021 #ifndef FXSPLASHWINDOW_H 00022 #define FXSPLASHWINDOW_H 00023 00024 #ifndef FXTOPWINDOW_H 00025 #include "FXTopWindow.h" 00026 #endif 00027 00028 namespace FX { 00029 00030 00031 /// Splash Window options 00032 enum { 00033 SPLASH_SIMPLE = 0, /// Simple rectangular splash window 00034 SPLASH_SHAPED = 0x02000000, /// Shaped splash window 00035 SPLASH_OWNS_ICON = 0x04000000, /// Splash window will own the icon and destroy it 00036 SPLASH_DESTROY = 0x08000000 /// Splash window will destroy itself when timer expires 00037 }; 00038 00039 00040 /** 00041 * The Splash Window is a window typically shown during startup 00042 * of an application. It comprises a large icon, which is also 00043 * used as the shape of the window if SPLASH_SHAPED is passed; 00044 * with the SPLASH_SIMPLE option the window will be simply rectangular. 00045 */ 00046 class FXAPI FXSplashWindow : public FXTopWindow { 00047 FXDECLARE(FXSplashWindow) 00048 protected: 00049 FXIcon *icon; // Really big icon 00050 FXTime delay; // Delay before hiding 00051 protected: 00052 FXSplashWindow(); 00053 private: 00054 FXSplashWindow(const FXSplashWindow&); 00055 FXSplashWindow &operator=(const FXSplashWindow&); 00056 public: 00057 long onPaint(FXObject*,FXSelector,void*); 00058 public: 00059 00060 /** 00061 * Construct splash window; the window will be automatically hidden (or deleted 00062 * if SPLASH_DESTROY is passed) after a given delay, specified in nanoseconds). 00063 * The splash window is free floating. Use this constructor when the splash window 00064 * is to be displayed before the main window appears. 00065 */ 00066 FXSplashWindow(FXApp* ap,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXTime ns=2000000000); 00067 00068 /** 00069 * Construct splash window; the window will be automatically hidden (or deleted 00070 * if SPLASH_DESTROY is passed) after a given delay, specified in nanoseconds). 00071 * The splash window stays on top of its owner window, which must already have been 00072 * created previously. 00073 */ 00074 FXSplashWindow(FXWindow* ow,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXTime ns=2000000000); 00075 00076 /// Create 00077 virtual void create(); 00078 00079 /// Detach 00080 virtual void detach(); 00081 00082 /// Show splash window 00083 virtual void show(); 00084 00085 /// Show splash window with a given placement 00086 virtual void show(FXuint placement); 00087 00088 /// Hide splash window 00089 virtual void hide(); 00090 00091 /// Return the default width of this window 00092 virtual FXint getDefaultWidth(); 00093 00094 /// Return the default height of this window 00095 virtual FXint getDefaultHeight(); 00096 00097 /// Set the icon for the splash window 00098 void setIcon(FXIcon* ic); 00099 00100 /// Get the icon for this splash window 00101 FXIcon* getIcon() const { return icon; } 00102 00103 /// Set or change delay in nanoseconds 00104 void setDelay(FXTime ns); 00105 00106 /// Return delay 00107 FXTime getDelay() const { return delay; } 00108 00109 /// Save label to a stream 00110 virtual void save(FXStream& store) const; 00111 00112 /// Load label from a stream 00113 virtual void load(FXStream& store); 00114 00115 /// Destroy splash window 00116 virtual ~FXSplashWindow(); 00117 }; 00118 00119 } 00120 00121 #endif
|
|