]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/app.h
removed relic: GetMaxLineWidth
[wxWidgets.git] / include / wx / os2 / app.h
CommitLineData
0e320a79
DW
1/////////////////////////////////////////////////////////////////////////////
2// Name: app.h
3// Purpose: wxApp class
d88de032 4// Author: David Webster
0e320a79 5// Modified by:
d88de032 6// Created: 10/13/99
0e320a79 7// RCS-ID: $Id$
d88de032 8// Copyright: (c) David Webster
0e320a79
DW
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_APP_H_
13#define _WX_APP_H_
14
0e320a79 15#include "wx/event.h"
d88de032 16#include "wx/icon.h"
0e320a79
DW
17
18class WXDLLEXPORT wxFrame;
19class WXDLLEXPORT wxWindow;
20class WXDLLEXPORT wxApp ;
21class WXDLLEXPORT wxKeyEvent;
22class WXDLLEXPORT wxLog;
23
0e320a79 24WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
43543d98 25WXDLLEXPORT_DATA(extern HAB) vHabmain;
0e320a79
DW
26
27// Force an exit from main loop
9ed0fac8 28void WXDLLEXPORT wxExit(void);
0e320a79
DW
29
30// Yield to other apps/messages
9ed0fac8 31bool WXDLLEXPORT wxYield(void);
0e320a79
DW
32
33// Represents the application. Derive OnInit and declare
34// a new App object to start application
d88de032 35class WXDLLEXPORT wxApp : public wxAppBase
0e320a79 36{
d88de032 37 DECLARE_DYNAMIC_CLASS(wxApp)
0e320a79 38
d88de032
DW
39public:
40 wxApp();
41 virtual ~wxApp();
0e320a79 42
9ed0fac8
DW
43 virtual bool OnInitGui(void);
44
d88de032 45 // override base class (pure) virtuals
9ed0fac8
DW
46 virtual int MainLoop(void);
47 virtual void ExitMainLoop(void);
48 virtual bool Initialized(void);
49 virtual bool Pending(void) ;
50 virtual void Dispatch(void);
0e320a79 51
d88de032 52 virtual wxIcon GetStdIcon(int which) const;
0e320a79 53
9ed0fac8
DW
54 virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
55 virtual int GetPrintMode(void) const { return m_nPrintMode; }
0e320a79 56
d88de032 57 // implementation only
9ed0fac8
DW
58 void OnIdle(wxIdleEvent& rEvent);
59 void OnEndSession(wxCloseEvent& rEvent);
60 void OnQueryEndSession(wxCloseEvent& rEvent);
0e320a79 61
d88de032
DW
62 // Send idle event to all top-level windows.
63 // Returns TRUE if more idle time is requested.
9ed0fac8 64 bool SendIdleEvents(void);
0e320a79 65
d88de032
DW
66 // Send idle event to window and all subwindows
67 // Returns TRUE if more idle time is requested.
9ed0fac8 68 bool SendIdleEvents(wxWindow* pWin);
0e320a79 69
9ed0fac8
DW
70 void SetAuto3D(bool bFlag) { m_bAuto3D = bFlag; }
71 bool GetAuto3D(void) const { return m_bAuto3D; }
0e320a79
DW
72
73protected:
9ed0fac8
DW
74 bool m_bShowOnInit;
75 int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
76 bool m_bAuto3D ; // Always use 3D controls, except where overriden
0e320a79 77
9ed0fac8
DW
78 //
79 // PM-specific wxApp definitions */
80 //
d88de032 81public:
0e320a79 82
d88de032 83 // Implementation
9ed0fac8
DW
84 static bool Initialize(HAB vHab);
85 static void CleanUp(void);
d88de032 86
9ed0fac8
DW
87 static bool RegisterWindowClasses(HAB vHab);
88 virtual bool DoMessage(void);
d88de032 89 virtual bool ProcessMessage(WXMSG* pMsg);
9ed0fac8
DW
90 void DeletePendingObjects(void);
91 bool ProcessIdle(void);
d88de032 92#if wxUSE_THREADS
9ed0fac8 93 void ProcessPendingEvents(void);
d88de032 94#endif
0e320a79
DW
95
96public:
9ed0fac8 97 int m_nCmdShow;
0e320a79
DW
98
99protected:
9ed0fac8 100 bool m_bKeepGoing ;
0e320a79 101
d88de032 102 DECLARE_EVENT_TABLE()
9ed0fac8 103private:
9ed0fac8
DW
104 HMQ m_hMq;
105 QMSG m_vMsg;
0e320a79
DW
106};
107
9ed0fac8 108int WXDLLEXPORT wxEntry( int argc, char *argv[] );
0e320a79
DW
109#endif
110 // _WX_APP_H_
111