]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/app.h
use base class implementation
[wxWidgets.git] / include / wx / msw / app.h
... / ...
CommitLineData
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$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_APP_H_
13#define _WX_APP_H_
14
15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16#pragma interface "app.h"
17#endif
18
19#include "wx/event.h"
20#include "wx/icon.h"
21
22class WXDLLEXPORT wxFrame;
23class WXDLLEXPORT wxWindow;
24class WXDLLEXPORT wxApp ;
25class WXDLLEXPORT wxKeyEvent;
26class WXDLLEXPORT wxLog;
27
28// Represents the application. Derive OnInit and declare
29// a new App object to start application
30class WXDLLEXPORT wxApp : public wxAppBase
31{
32 DECLARE_DYNAMIC_CLASS(wxApp)
33
34public:
35 wxApp();
36 virtual ~wxApp();
37
38 // override base class (pure) virtuals
39 virtual bool Initialize(int& argc, wxChar **argv);
40 virtual void CleanUp();
41
42 virtual bool Yield(bool onlyIfNeeded = FALSE);
43 virtual void WakeUpIdle();
44
45 virtual void SetPrintMode(int mode) { m_printMode = mode; }
46 virtual int GetPrintMode() const { return m_printMode; }
47
48 // implementation only
49 void OnIdle(wxIdleEvent& event);
50 void OnEndSession(wxCloseEvent& event);
51 void OnQueryEndSession(wxCloseEvent& event);
52
53protected:
54 int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
55
56 /* Windows-specific wxApp definitions */
57
58public:
59
60 // Implementation
61 static bool RegisterWindowClasses();
62 static bool UnregisterWindowClasses();
63
64 // idle processing
65 // ---------------
66
67#if wxUSE_RICHEDIT
68 // initialize the richedit DLL of (at least) given version, return TRUE if
69 // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
70 static bool InitRichEdit(int version = 2);
71#endif // wxUSE_RICHEDIT
72
73 // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
74 // wasn't found at all
75 static int GetComCtl32Version();
76
77public:
78 // the SW_XXX value to be used for the frames opened by the application
79 // (currently seems unused which is a bug -- TODO)
80 static int m_nCmdShow;
81
82protected:
83 DECLARE_EVENT_TABLE()
84 DECLARE_NO_COPY_CLASS(wxApp)
85};
86
87int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance,
88 char *lpszCmdLine, int nCmdShow);
89
90#endif // _WX_APP_H_
91