]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/app.h
got rid of wxEvtHandler::m_isWindow, use virtual functions (overridden in wxWindow...
[wxWidgets.git] / include / wx / msw / app.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: app.h
3// Purpose: wxApp class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc
JS
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_APP_H_
13#define _WX_APP_H_
2bda0e17
KB
14
15#ifdef __GNUG__
16#pragma interface "app.h"
17#endif
18
a3ef5bf5 19#include "wx/event.h"
ebea0891 20#include "wx/icon.h"
2bda0e17
KB
21
22class WXDLLEXPORT wxFrame;
23class WXDLLEXPORT wxWindow;
24class WXDLLEXPORT wxApp ;
25class WXDLLEXPORT wxKeyEvent;
26class WXDLLEXPORT wxLog;
27
2bda0e17
KB
28// Represents the application. Derive OnInit and declare
29// a new App object to start application
094637f6 30class WXDLLEXPORT wxApp : public wxAppBase
2bda0e17 31{
094637f6 32 DECLARE_DYNAMIC_CLASS(wxApp)
c085e333 33
094637f6
VZ
34public:
35 wxApp();
36 virtual ~wxApp();
580c10e3 37
094637f6
VZ
38 // override base class (pure) virtuals
39 virtual int MainLoop();
40 virtual void ExitMainLoop();
41 virtual bool Initialized();
1e6feb95
VZ
42 virtual bool Pending();
43 virtual void Dispatch();
e2478fde 44
8461e4c2 45 virtual bool Yield(bool onlyIfNeeded = FALSE);
90a1a975 46 virtual bool ProcessIdle();
e2478fde 47 virtual void WakeUpIdle();
2bda0e17 48
094637f6
VZ
49 virtual void SetPrintMode(int mode) { m_printMode = mode; }
50 virtual int GetPrintMode() const { return m_printMode; }
2bda0e17 51
094637f6
VZ
52 // implementation only
53 void OnIdle(wxIdleEvent& event);
54 void OnEndSession(wxCloseEvent& event);
55 void OnQueryEndSession(wxCloseEvent& event);
2bda0e17 56
094637f6
VZ
57 // Send idle event to all top-level windows.
58 // Returns TRUE if more idle time is requested.
59 bool SendIdleEvents();
2bda0e17 60
094637f6
VZ
61 // Send idle event to window and all subwindows
62 // Returns TRUE if more idle time is requested.
63 bool SendIdleEvents(wxWindow* win);
4e066dd2 64
094637f6
VZ
65 void SetAuto3D(bool flag) { m_auto3D = flag; }
66 bool GetAuto3D() const { return m_auto3D; }
2bda0e17
KB
67
68protected:
1e6feb95
VZ
69 bool m_showOnInit;
70 int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
71 bool m_auto3D ; // Always use 3D controls, except where overriden
094637f6
VZ
72
73 /* Windows-specific wxApp definitions */
2bda0e17
KB
74
75public:
76
094637f6
VZ
77 // Implementation
78 static bool Initialize();
79 static void CleanUp();
80
81 static bool RegisterWindowClasses();
9787a4b6 82 static bool UnregisterWindowClasses();
ed45e263 83
094637f6 84 // Convert Windows to argc, argv style
31f6de22 85 void ConvertToStandardCommandArgs(const char* p);
ed45e263
VZ
86
87 // message processing
88 // ------------------
89
90 // process the given message
91 virtual void DoMessage(WXMSG *pMsg);
92
93 // retrieve the next message from the queue and process it
094637f6 94 virtual bool DoMessage();
ed45e263
VZ
95
96 // preprocess the message
094637f6 97 virtual bool ProcessMessage(WXMSG* pMsg);
ed45e263
VZ
98
99 // idle processing
100 // ---------------
101
094637f6 102 void DeletePendingObjects();
6d167489
VZ
103
104#if wxUSE_RICHEDIT
105 // initialize the richedit DLL of (at least) given version, return TRUE if
106 // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
107 static bool InitRichEdit(int version = 2);
108#endif // wxUSE_RICHEDIT
109
110 // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
111 // wasn't found at all
112 static int GetComCtl32Version();
2bda0e17
KB
113
114public:
094637f6 115 int m_nCmdShow;
2bda0e17
KB
116
117protected:
1e6feb95 118 bool m_keepGoing;
2bda0e17 119
094637f6 120 DECLARE_EVENT_TABLE()
2bda0e17
KB
121};
122
123#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
8f177c8e
VZ
124int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance,
125 char *lpszCmdLine, int nCmdShow, bool enterLoop = TRUE);
2bda0e17
KB
126#else
127int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance);
128#endif
129
130#endif
bbcdf8bc 131 // _WX_APP_H_
2bda0e17 132