]>
Commit | Line | Data |
---|---|---|
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 | |
22 | class WXDLLEXPORT wxFrame; | |
23 | class WXDLLEXPORT wxWindow; | |
24 | class WXDLLEXPORT wxApp ; | |
25 | class WXDLLEXPORT wxKeyEvent; | |
26 | class WXDLLEXPORT wxLog; | |
27 | ||
2bda0e17 KB |
28 | // Represents the application. Derive OnInit and declare |
29 | // a new App object to start application | |
094637f6 | 30 | class WXDLLEXPORT wxApp : public wxAppBase |
2bda0e17 | 31 | { |
094637f6 | 32 | DECLARE_DYNAMIC_CLASS(wxApp) |
c085e333 | 33 | |
094637f6 VZ |
34 | public: |
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(); | |
42 | virtual bool Pending() ; | |
43 | virtual void Dispatch() ; | |
2bda0e17 | 44 | |
094637f6 | 45 | virtual wxIcon GetStdIcon(int which) const; |
2bda0e17 | 46 | |
094637f6 VZ |
47 | virtual void SetPrintMode(int mode) { m_printMode = mode; } |
48 | virtual int GetPrintMode() const { return m_printMode; } | |
2bda0e17 | 49 | |
094637f6 VZ |
50 | // implementation only |
51 | void OnIdle(wxIdleEvent& event); | |
52 | void OnEndSession(wxCloseEvent& event); | |
53 | void OnQueryEndSession(wxCloseEvent& event); | |
2bda0e17 | 54 | |
094637f6 VZ |
55 | // Send idle event to all top-level windows. |
56 | // Returns TRUE if more idle time is requested. | |
57 | bool SendIdleEvents(); | |
2bda0e17 | 58 | |
094637f6 VZ |
59 | // Send idle event to window and all subwindows |
60 | // Returns TRUE if more idle time is requested. | |
61 | bool SendIdleEvents(wxWindow* win); | |
4e066dd2 | 62 | |
094637f6 VZ |
63 | void SetAuto3D(bool flag) { m_auto3D = flag; } |
64 | bool GetAuto3D() const { return m_auto3D; } | |
2bda0e17 KB |
65 | |
66 | protected: | |
094637f6 VZ |
67 | bool m_showOnInit; |
68 | int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT | |
69 | bool m_auto3D ; // Always use 3D controls, except where overriden | |
70 | ||
71 | /* Windows-specific wxApp definitions */ | |
2bda0e17 KB |
72 | |
73 | public: | |
74 | ||
094637f6 VZ |
75 | // Implementation |
76 | static bool Initialize(); | |
77 | static void CleanUp(); | |
78 | ||
79 | static bool RegisterWindowClasses(); | |
80 | // Convert Windows to argc, argv style | |
81 | void ConvertToStandardCommandArgs(char* p); | |
82 | virtual bool DoMessage(); | |
83 | virtual bool ProcessMessage(WXMSG* pMsg); | |
84 | void DeletePendingObjects(); | |
85 | bool ProcessIdle(); | |
094637f6 | 86 | void ProcessPendingEvents(); |
094637f6 | 87 | int GetComCtl32Version() const; |
2bda0e17 KB |
88 | |
89 | public: | |
094637f6 | 90 | int m_nCmdShow; |
2bda0e17 KB |
91 | |
92 | protected: | |
094637f6 | 93 | bool m_keepGoing ; |
2bda0e17 | 94 | |
094637f6 | 95 | DECLARE_EVENT_TABLE() |
2bda0e17 KB |
96 | }; |
97 | ||
98 | #if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL)) | |
99 | int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance, char *lpszCmdLine, | |
100 | int nCmdShow, bool enterLoop = TRUE); | |
101 | #else | |
102 | int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance); | |
103 | #endif | |
104 | ||
105 | #endif | |
bbcdf8bc | 106 | // _WX_APP_H_ |
2bda0e17 | 107 |