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 wxIcon
GetStdIcon(int which
) const;
47 virtual void SetPrintMode(int mode
) { m_printMode
= mode
; }
48 virtual int GetPrintMode() const { return m_printMode
; }
50 // implementation only
51 void OnIdle(wxIdleEvent
& event
);
52 void OnEndSession(wxCloseEvent
& event
);
53 void OnQueryEndSession(wxCloseEvent
& event
);
55 // Send idle event to all top-level windows.
56 // Returns TRUE if more idle time is requested.
57 bool SendIdleEvents();
59 // Send idle event to window and all subwindows
60 // Returns TRUE if more idle time is requested.
61 bool SendIdleEvents(wxWindow
* win
);
63 void SetAuto3D(bool flag
) { m_auto3D
= flag
; }
64 bool GetAuto3D() const { return m_auto3D
; }
68 int m_printMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
69 bool m_auto3D
; // Always use 3D controls, except where overriden
71 /* Windows-specific wxApp definitions */
76 static bool Initialize();
77 static void CleanUp();
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();
86 int GetComCtl32Version() const;
97 #if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
98 int WXDLLEXPORT
wxEntry(WXHINSTANCE hInstance
, WXHINSTANCE hPrevInstance
, char *lpszCmdLine
,
99 int nCmdShow
, bool enterLoop
= TRUE
);
101 int WXDLLEXPORT
wxEntry(WXHINSTANCE hInstance
);