1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: app.h
|
|
|
|
// Purpose: wxApp class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_APP_H_
|
|
|
|
#define _WX_APP_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "app.h"
|
|
|
|
#endif
|
|
|
|
|
1999-01-15 19:13:58 -05:00
|
|
|
#include "wx/event.h"
|
1999-07-05 07:22:45 -04:00
|
|
|
#include "wx/icon.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxFrame;
|
|
|
|
class WXDLLEXPORT wxWindow;
|
|
|
|
class WXDLLEXPORT wxApp ;
|
|
|
|
class WXDLLEXPORT wxKeyEvent;
|
|
|
|
class WXDLLEXPORT wxLog;
|
|
|
|
|
|
|
|
// Represents the application. Derive OnInit and declare
|
|
|
|
// a new App object to start application
|
1999-07-05 20:44:26 -04:00
|
|
|
class WXDLLEXPORT wxApp : public wxAppBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-07-05 20:44:26 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
1998-10-14 19:53:24 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
public:
|
|
|
|
wxApp();
|
|
|
|
virtual ~wxApp();
|
1998-07-29 08:00:17 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
// override base class (pure) virtuals
|
|
|
|
virtual int MainLoop();
|
|
|
|
virtual void ExitMainLoop();
|
|
|
|
virtual bool Initialized();
|
|
|
|
virtual bool Pending() ;
|
|
|
|
virtual void Dispatch() ;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
virtual wxIcon GetStdIcon(int which) const;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
virtual void SetPrintMode(int mode) { m_printMode = mode; }
|
|
|
|
virtual int GetPrintMode() const { return m_printMode; }
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
// implementation only
|
|
|
|
void OnIdle(wxIdleEvent& event);
|
|
|
|
void OnEndSession(wxCloseEvent& event);
|
|
|
|
void OnQueryEndSession(wxCloseEvent& event);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
// Send idle event to all top-level windows.
|
|
|
|
// Returns TRUE if more idle time is requested.
|
|
|
|
bool SendIdleEvents();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
// Send idle event to window and all subwindows
|
|
|
|
// Returns TRUE if more idle time is requested.
|
|
|
|
bool SendIdleEvents(wxWindow* win);
|
1998-05-27 19:05:10 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
void SetAuto3D(bool flag) { m_auto3D = flag; }
|
|
|
|
bool GetAuto3D() const { return m_auto3D; }
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
protected:
|
1999-07-05 20:44:26 -04:00
|
|
|
bool m_showOnInit;
|
|
|
|
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
|
|
|
bool m_auto3D ; // Always use 3D controls, except where overriden
|
|
|
|
|
|
|
|
/* Windows-specific wxApp definitions */
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
// Implementation
|
|
|
|
static bool Initialize();
|
|
|
|
static void CleanUp();
|
|
|
|
|
|
|
|
static bool RegisterWindowClasses();
|
|
|
|
// Convert Windows to argc, argv style
|
|
|
|
void ConvertToStandardCommandArgs(char* p);
|
|
|
|
virtual bool DoMessage();
|
|
|
|
virtual bool ProcessMessage(WXMSG* pMsg);
|
|
|
|
void DeletePendingObjects();
|
|
|
|
bool ProcessIdle();
|
1999-03-27 13:50:54 -05:00
|
|
|
#if wxUSE_THREADS
|
1999-07-05 20:44:26 -04:00
|
|
|
void ProcessPendingEvents();
|
1999-03-27 13:50:54 -05:00
|
|
|
#endif
|
1999-07-05 20:44:26 -04:00
|
|
|
int GetComCtl32Version() const;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
public:
|
1999-07-05 20:44:26 -04:00
|
|
|
int m_nCmdShow;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
protected:
|
1999-07-05 20:44:26 -04:00
|
|
|
bool m_keepGoing ;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
|
|
|
|
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance, char *lpszCmdLine,
|
|
|
|
int nCmdShow, bool enterLoop = TRUE);
|
|
|
|
#else
|
|
|
|
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_APP_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|