Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXSplashWindow.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                            S p l a s h    W i n d o w                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2004,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXSplashWindow.h,v 1.10 2006/01/22 17:58:09 fox Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FXSPLASHWINDOW_H
00025 #define FXSPLASHWINDOW_H
00026 
00027 #ifndef FXTOPWINDOW_H
00028 #include "FXTopWindow.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 /// Splash Window options
00035 enum {
00036   SPLASH_SIMPLE    = 0,                 /// Simple rectangular splash window
00037   SPLASH_SHAPED    = 0x02000000,        /// Shaped splash window
00038   SPLASH_OWNS_ICON = 0x04000000,        /// Splash window will own the icon and destroy it
00039   SPLASH_DESTROY   = 0x08000000         /// Splash window will destroy itself when timer expires
00040   };
00041 
00042 
00043 /**
00044 * The Splash Window is a window typically shown during startup
00045 * of an application.  It comprises a large icon, which is also
00046 * used as the shape of the window if SPLASH_SHAPED is passed;
00047 * with the SPLASH_SIMPLE option the window will be simply rectangular.
00048 */
00049 class FXAPI FXSplashWindow : public FXTopWindow {
00050   FXDECLARE(FXSplashWindow)
00051 protected:
00052   FXIcon *icon;         // Really big icon
00053   FXuint  delay;        // Delay before hiding
00054 protected:
00055   FXSplashWindow();
00056 private:
00057   FXSplashWindow(const FXSplashWindow&);
00058   FXSplashWindow &operator=(const FXSplashWindow&);
00059 public:
00060   long onPaint(FXObject*,FXSelector,void*);
00061 public:
00062 
00063   /// Construct splash window
00064   FXSplashWindow(FXApp* ap,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
00065 
00066   /// Construct splash window
00067   FXSplashWindow(FXWindow* ow,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
00068 
00069   /// Create
00070   virtual void create();
00071 
00072   /// Detach
00073   virtual void detach();
00074 
00075   /// Show splash window
00076   virtual void show();
00077 
00078   /// Show splash window with a given placement
00079   virtual void show(FXuint placement);
00080 
00081   /// Hide splash window
00082   virtual void hide();
00083 
00084   /// Return the default width of this window
00085   virtual FXint getDefaultWidth();
00086 
00087   /// Return the default height of this window
00088   virtual FXint getDefaultHeight();
00089 
00090   /// Set the icon for the splash window
00091   void setIcon(FXIcon* ic);
00092 
00093   /// Get the icon for this splash window
00094   FXIcon* getIcon() const { return icon; }
00095 
00096   /// Set or change delay
00097   void setDelay(FXuint ms);
00098 
00099   /// Return delay
00100   FXuint getDelay() const { return delay; }
00101 
00102   /// Save label to a stream
00103   virtual void save(FXStream& store) const;
00104 
00105   /// Load label from a stream
00106   virtual void load(FXStream& store);
00107 
00108   /// Destroy splash window
00109   virtual ~FXSplashWindow();
00110   };
00111 
00112 }
00113 
00114 #endif

Copyright © 1997-2005 Jeroen van der Zijp