1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: app.h
|
|
|
|
// Purpose: wxApp class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_APP_H_
|
|
|
|
#define _WX_APP_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "app.h"
|
|
|
|
#endif
|
|
|
|
|
1999-01-16 00:13:58 +00:00
|
|
|
#include "wx/event.h"
|
1999-07-05 11:22:45 +00:00
|
|
|
#include "wx/icon.h"
|
1998-05-20 14:12:05 +00: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-06 00:44:26 +00:00
|
|
|
class WXDLLEXPORT wxApp : public wxAppBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-07-06 00:44:26 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
1998-10-14 23:53:24 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
public:
|
|
|
|
wxApp();
|
|
|
|
virtual ~wxApp();
|
1998-07-29 12:00:17 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
// override base class (pure) virtuals
|
|
|
|
virtual int MainLoop();
|
|
|
|
virtual void ExitMainLoop();
|
|
|
|
virtual bool Initialized();
|
|
|
|
virtual bool Pending() ;
|
|
|
|
virtual void Dispatch() ;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
virtual wxIcon GetStdIcon(int which) const;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
virtual void SetPrintMode(int mode) { m_printMode = mode; }
|
|
|
|
virtual int GetPrintMode() const { return m_printMode; }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
// implementation only
|
|
|
|
void OnIdle(wxIdleEvent& event);
|
|
|
|
void OnEndSession(wxCloseEvent& event);
|
|
|
|
void OnQueryEndSession(wxCloseEvent& event);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
// Send idle event to all top-level windows.
|
|
|
|
// Returns TRUE if more idle time is requested.
|
|
|
|
bool SendIdleEvents();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
// Send idle event to window and all subwindows
|
|
|
|
// Returns TRUE if more idle time is requested.
|
|
|
|
bool SendIdleEvents(wxWindow* win);
|
1998-05-27 23:05:10 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
void SetAuto3D(bool flag) { m_auto3D = flag; }
|
|
|
|
bool GetAuto3D() const { return m_auto3D; }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
protected:
|
1999-07-06 00:44:26 +00: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 14:12:05 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
1999-07-06 00:44:26 +00: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-11-24 12:30:56 +00:00
|
|
|
|
|
|
|
#if wxUSE_RICHEDIT
|
|
|
|
// initialize the richedit DLL of (at least) given version, return TRUE if
|
|
|
|
// ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
|
|
|
|
static bool InitRichEdit(int version = 2);
|
|
|
|
#endif // wxUSE_RICHEDIT
|
|
|
|
|
|
|
|
// returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
|
|
|
|
// wasn't found at all
|
|
|
|
static int GetComCtl32Version();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
public:
|
1999-07-06 00:44:26 +00:00
|
|
|
int m_nCmdShow;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
protected:
|
1999-07-06 00:44:26 +00:00
|
|
|
bool m_keepGoing ;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-07-06 00:44:26 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
|
1999-12-16 21:29:54 +00:00
|
|
|
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance,
|
|
|
|
char *lpszCmdLine, int nCmdShow, bool enterLoop = TRUE);
|
1998-05-20 14:12:05 +00:00
|
|
|
#else
|
|
|
|
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_APP_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|