]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/evtloop.h
updated to derive from wxEventLoopManual
[wxWidgets.git] / include / wx / msw / evtloop.h
CommitLineData
3754265e
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/msw/evtloop.h
3// Purpose: wxEventLoop class for MSW
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 2004-07-31
7// RCS-ID: $Id$
8// Copyright: (c) 2003-2004 Vadim Zeitlin <vadim@wxwindows.org>
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_MSW_EVTLOOP_H_
13#define _WX_MSW_EVTLOOP_H_
14
15// ----------------------------------------------------------------------------
16// wxEventLoop
17// ----------------------------------------------------------------------------
18
c8026dea 19class WXDLLEXPORT wxEventLoop : public wxEventLoopManual
3754265e
VZ
20{
21public:
22 wxEventLoop();
23
24 // implement base class pure virtuals
3754265e
VZ
25 virtual bool Pending() const;
26 virtual bool Dispatch();
3754265e
VZ
27
28 // MSW-specific methods
29 // --------------------
30
31 // preprocess a message, return true if processed (i.e. no further
32 // dispatching required)
33 virtual bool PreProcessMessage(WXMSG *msg);
34
35 // process a single message
36 virtual void ProcessMessage(WXMSG *msg);
37
a7b7500c
VZ
38 // set the critical window: this is the window such that all the events
39 // except those to this window (and its children) stop to be processed
40 // (typical examples: assert or crash report dialog)
41 //
42 // calling this function with NULL argument restores the normal event
43 // handling
b4626104 44 static void SetCriticalWindow(wxWindowMSW *win) { ms_winCritical = win; }
a7b7500c
VZ
45
46 // return true if there is no critical window or if this window is [a child
47 // of] the critical one
b4626104 48 static bool AllowProcessing(wxWindowMSW *win)
a7b7500c
VZ
49 {
50 return !ms_winCritical || IsChildOfCriticalWindow(win);
51 }
52
3754265e 53protected:
b80e8ac9
VZ
54 // override/implement base class virtuals
55 virtual void WakeUp();
56 virtual void OnNextIteration();
57
a7b7500c
VZ
58 // check if the given window is a child of ms_winCritical (which must be
59 // non NULL)
b4626104 60 static bool IsChildOfCriticalWindow(wxWindowMSW *win);
a7b7500c
VZ
61
62
63 // critical window or NULL
b4626104 64 static wxWindowMSW *ms_winCritical;
3754265e
VZ
65};
66
67#endif // _WX_MSW_EVTLOOP_H_
68