Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATGUI/CATWaitDlg.h Source File

CATWaitDlg.h

Go to the documentation of this file.
00001 /// \file   CATWaitDlg.h
00002 /// \brief  Wait dialog
00003 /// \ingroup CATGUI
00004 ///
00005 /// Copyright (c) 2003-2008 by Michael Ellison.
00006 /// See COPYING.txt for the \ref gaslicense License (MIT License).
00007 ///
00008 // $Author: mikeellison $
00009 // $Date: 2008-01-30 06:11:10 -0600 (Wed, 30 Jan 2008) $
00010 // $Revision:   $
00011 // $NoKeywords: $
00012 //
00013 //
00014 
00015 #ifndef _GGWaitDlg_H_
00016 #define _GGWaitDlg_H_
00017 
00018 #include "CATGUIInternal.h"
00019 #include "CATWindow.h"
00020 #include "CATSignal.h"
00021 #include "CATProgress.h"
00022 #include "CATMutex.h"
00023 
00024 /// \class CATWaitDlg CATWaitDlg.h
00025 /// \brief Wait dialog
00026 /// \class CAT
00027 class CATWaitDlg : private CATWindow
00028 {
00029 public:
00030     CATWaitDlg( CATINSTANCE instance,
00031         CATInt32        backgroundBmpId,
00032         CATRect&        textRect,
00033         CATInt32        progressBmpOnId  = 0,   // optional progress bar
00034         CATInt32        progressBmpOffId = 0,
00035         CATInt32        progressLeft      = 0,
00036         CATInt32        progressTop       = 0);
00037 
00038     virtual ~CATWaitDlg();
00039 
00040     virtual void StartWait( const CATString& waitMsg,                                       
00041                             CATWindow*       parent   = 0,
00042                             bool             disableParent = false);        
00043 
00044     virtual void        EndWait(bool force = false);
00045     virtual bool        OnClose();
00046     virtual void        OnDestroy();
00047     virtual void        SetProgress( CATFloat32 percent );
00048 
00049     virtual void        SetWaitLabelText( const CATString& waitStr );
00050     virtual CATResult   OnEvent  (        const CATEvent&  event, 
00051                                           CATInt32&        retVal);
00052 
00053     CATUInt32   GetDepth();
00054     bool        IsShowing();
00055 
00056     /// Draw() is called when the window should paint itself. 
00057     ///
00058     /// \param background - ptr to image to draw into
00059     /// \param dirtyRect - part of window to redraw.
00060     virtual void      Draw        (  CATImage*        background,
00061                                      const CATRect&   dirtyRect);
00062 
00063 protected:
00064     static  unsigned int _stdcall WindowThread(void* param);
00065     HANDLE  fHandle;
00066 
00067     CATInt32        fBmpId;
00068     CATUInt32       fDepth;
00069 
00070     CATLabel*       fWaitLabel;
00071 
00072     CATInt32        fProgBmpOnId;
00073     CATInt32        fProgBmpOffId;
00074     CATProgress*    fProgressBar;
00075     CATMutex        fUpdateLock;
00076     CATSignal       fDlgReady;
00077     CATWindow*      fParent;
00078     bool            fDisableParent;
00079     bool            fAllowClose;
00080 };
00081 
00082 
00083 #endif // _GGWaitDlg_H_

Generated on Mon Feb 11 04:09:57 2008 for Game Accessibility Suite by doxygen 1.5.4