1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: app.h
|
|
|
|
// Purpose: wxApp class
|
1999-10-13 22:34:18 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-13 22:34:18 +00:00
|
|
|
// Created: 10/13/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-13 22:34:18 +00:00
|
|
|
// Copyright: (c) David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_APP_H_
|
|
|
|
#define _WX_APP_H_
|
|
|
|
|
|
|
|
#include "wx/event.h"
|
1999-10-13 22:34:18 +00:00
|
|
|
#include "wx/icon.h"
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxFrame;
|
|
|
|
class WXDLLEXPORT wxWindow;
|
|
|
|
class WXDLLEXPORT wxApp ;
|
|
|
|
class WXDLLEXPORT wxKeyEvent;
|
|
|
|
class WXDLLEXPORT wxLog;
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
|
1999-12-03 05:03:55 +00:00
|
|
|
HAB vHabmain;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
// Force an exit from main loop
|
1999-11-15 04:50:09 +00:00
|
|
|
void WXDLLEXPORT wxExit(void);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
// Yield to other apps/messages
|
1999-11-15 04:50:09 +00:00
|
|
|
bool WXDLLEXPORT wxYield(void);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
// Represents the application. Derive OnInit and declare
|
|
|
|
// a new App object to start application
|
1999-10-13 22:34:18 +00:00
|
|
|
class WXDLLEXPORT wxApp : public wxAppBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
1999-10-13 22:34:18 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
public:
|
|
|
|
wxApp();
|
|
|
|
virtual ~wxApp();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-11-15 04:50:09 +00:00
|
|
|
virtual bool OnInitGui(void);
|
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
// override base class (pure) virtuals
|
1999-11-15 04:50:09 +00:00
|
|
|
virtual int MainLoop(void);
|
|
|
|
virtual void ExitMainLoop(void);
|
|
|
|
virtual bool Initialized(void);
|
|
|
|
virtual bool Pending(void) ;
|
|
|
|
virtual void Dispatch(void);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
virtual wxIcon GetStdIcon(int which) const;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-11-15 04:50:09 +00:00
|
|
|
virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
|
|
|
|
virtual int GetPrintMode(void) const { return m_nPrintMode; }
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
// implementation only
|
1999-11-15 04:50:09 +00:00
|
|
|
void OnIdle(wxIdleEvent& rEvent);
|
|
|
|
void OnEndSession(wxCloseEvent& rEvent);
|
|
|
|
void OnQueryEndSession(wxCloseEvent& rEvent);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
// Send idle event to all top-level windows.
|
|
|
|
// Returns TRUE if more idle time is requested.
|
1999-11-15 04:50:09 +00:00
|
|
|
bool SendIdleEvents(void);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
// Send idle event to window and all subwindows
|
|
|
|
// Returns TRUE if more idle time is requested.
|
1999-11-15 04:50:09 +00:00
|
|
|
bool SendIdleEvents(wxWindow* pWin);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-11-15 04:50:09 +00:00
|
|
|
void SetAuto3D(bool bFlag) { m_bAuto3D = bFlag; }
|
|
|
|
bool GetAuto3D(void) const { return m_bAuto3D; }
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
protected:
|
1999-11-15 04:50:09 +00:00
|
|
|
bool m_bShowOnInit;
|
|
|
|
int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
|
|
|
bool m_bAuto3D ; // Always use 3D controls, except where overriden
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-11-15 04:50:09 +00:00
|
|
|
//
|
|
|
|
// PM-specific wxApp definitions */
|
|
|
|
//
|
1999-10-13 22:34:18 +00:00
|
|
|
public:
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
// Implementation
|
1999-11-15 04:50:09 +00:00
|
|
|
static bool Initialize(HAB vHab);
|
|
|
|
static void CleanUp(void);
|
1999-10-13 22:34:18 +00:00
|
|
|
|
1999-11-15 04:50:09 +00:00
|
|
|
static bool RegisterWindowClasses(HAB vHab);
|
|
|
|
virtual bool DoMessage(void);
|
1999-10-13 22:34:18 +00:00
|
|
|
virtual bool ProcessMessage(WXMSG* pMsg);
|
1999-11-15 04:50:09 +00:00
|
|
|
void DeletePendingObjects(void);
|
|
|
|
bool ProcessIdle(void);
|
1999-10-13 22:34:18 +00:00
|
|
|
#if wxUSE_THREADS
|
1999-11-15 04:50:09 +00:00
|
|
|
void ProcessPendingEvents(void);
|
1999-10-13 22:34:18 +00:00
|
|
|
#endif
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
public:
|
1999-11-15 04:50:09 +00:00
|
|
|
int m_nCmdShow;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
protected:
|
1999-11-15 04:50:09 +00:00
|
|
|
bool m_bKeepGoing ;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-13 22:34:18 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-11-15 04:50:09 +00:00
|
|
|
private:
|
|
|
|
HMQ m_hMq;
|
|
|
|
QMSG m_vMsg;
|
1999-07-29 05:11:30 +00:00
|
|
|
};
|
|
|
|
|
1999-11-15 04:50:09 +00:00
|
|
|
int WXDLLEXPORT wxEntry( int argc, char *argv[] );
|
1999-07-29 05:11:30 +00:00
|
|
|
#endif
|
|
|
|
// _WX_APP_H_
|
|
|
|
|