1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "app.h"
22 class WXDLLEXPORT wxFrame
;
23 class WXDLLEXPORT wxWindow
;
24 class WXDLLEXPORT wxApp
;
25 class WXDLLEXPORT wxKeyEvent
;
26 class WXDLLEXPORT wxLog
;
28 // Represents the application. Derive OnInit and declare
29 // a new App object to start application
30 class WXDLLEXPORT wxApp
: public wxAppBase
32 DECLARE_DYNAMIC_CLASS(wxApp
)
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();
45 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
46 virtual bool ProcessIdle();
47 virtual void WakeUpIdle();
49 virtual void SetPrintMode(int mode
) { m_printMode
= mode
; }
50 virtual int GetPrintMode() const { return m_printMode
; }
52 // implementation only
53 void OnIdle(wxIdleEvent
& event
);
54 void OnEndSession(wxCloseEvent
& event
);
55 void OnQueryEndSession(wxCloseEvent
& event
);
57 // Send idle event to all top-level windows.
58 // Returns TRUE if more idle time is requested.
59 bool SendIdleEvents();
61 // Send idle event to window and all subwindows
62 // Returns TRUE if more idle time is requested.
63 bool SendIdleEvents(wxWindow
* win
);
65 void SetAuto3D(bool flag
) { m_auto3D
= flag
; }
66 bool GetAuto3D() const { return m_auto3D
; }
70 int m_printMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
71 bool m_auto3D
; // Always use 3D controls, except where overriden
73 /* Windows-specific wxApp definitions */
78 static bool Initialize();
79 static void CleanUp();
81 static bool RegisterWindowClasses();
82 static bool UnregisterWindowClasses();
84 // Convert Windows to argc, argv style
85 void ConvertToStandardCommandArgs(const char* p
);
90 // process the given message
91 virtual void DoMessage(WXMSG
*pMsg
);
93 // retrieve the next message from the queue and process it
94 virtual bool DoMessage();
96 // preprocess the message
97 virtual bool ProcessMessage(WXMSG
* pMsg
);
102 void DeletePendingObjects();
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
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();
120 DECLARE_EVENT_TABLE()
123 #if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
124 int WXDLLEXPORT
wxEntry(WXHINSTANCE hInstance
, WXHINSTANCE hPrevInstance
,
125 char *lpszCmdLine
, int nCmdShow
, bool enterLoop
= TRUE
);
127 int WXDLLEXPORT
wxEntry(WXHINSTANCE hInstance
);