2003-03-17 13:41:00 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: mfctest.h
|
2004-05-25 11:20:37 +00:00
|
|
|
// Purpose: Sample to demonstrate mixing MFC and wxWidgets code
|
2003-03-17 13:41:00 +00:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1998-05-20 14:21:00 +00:00
|
|
|
|
|
|
|
#ifndef __MFCTEST_H__
|
|
|
|
#define __MFCTEST_H__
|
|
|
|
|
2017-12-03 16:50:18 +00:00
|
|
|
// CMainWindow: just a normal MFC window class.
|
1998-05-20 14:21:00 +00:00
|
|
|
class CMainWindow : public CFrameWnd
|
|
|
|
{
|
|
|
|
public:
|
2002-03-17 14:16:03 +00:00
|
|
|
CMainWindow();
|
1998-05-20 14:21:00 +00:00
|
|
|
|
2002-03-17 14:16:03 +00:00
|
|
|
//{{AFX_MSG( CMainWindow )
|
|
|
|
afx_msg void OnPaint();
|
|
|
|
afx_msg void OnAbout();
|
|
|
|
afx_msg void OnTest();
|
|
|
|
//}}AFX_MSG
|
1998-05-20 14:21:00 +00:00
|
|
|
|
2002-03-17 14:16:03 +00:00
|
|
|
DECLARE_MESSAGE_MAP()
|
2015-07-09 18:06:48 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
class wxNativeContainerWindow* m_containerWX;
|
1998-05-20 14:21:00 +00:00
|
|
|
};
|
|
|
|
|
2017-12-03 16:50:18 +00:00
|
|
|
#if START_WITH_MFC_WINDOW
|
|
|
|
|
|
|
|
// There is no need to define an application class if the default behaviour of
|
|
|
|
// using the wxWindow created in wxApp::OnInit() as main window is acceptable,
|
|
|
|
// but if we want to create the initial window in MFC, we need this class in
|
|
|
|
// order to override InitMainWnd() in it.
|
|
|
|
class SampleMFCWinApp : public wxMFCWinApp
|
1998-05-20 14:21:00 +00:00
|
|
|
{
|
2017-12-03 16:50:18 +00:00
|
|
|
protected:
|
|
|
|
BOOL InitMainWnd() wxOVERRIDE
|
|
|
|
{
|
|
|
|
// Demonstrate creation of an initial MFC main window.
|
|
|
|
m_pMainWnd = new CMainWindow();
|
|
|
|
m_pMainWnd->ShowWindow( m_nCmdShow );
|
|
|
|
m_pMainWnd->UpdateWindow();
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
1998-05-20 14:21:00 +00:00
|
|
|
};
|
|
|
|
|
2017-12-03 16:50:18 +00:00
|
|
|
#else // !START_WITH_MFC_WINDOW
|
1998-05-20 14:21:00 +00:00
|
|
|
|
2017-12-03 16:50:18 +00:00
|
|
|
typedef wxMFCWinApp SampleMFCWinApp;
|
1998-05-20 14:21:00 +00:00
|
|
|
|
2017-12-03 16:50:18 +00:00
|
|
|
#endif // START_WITH_MFC_WINDOW/!START_WITH_MFC_WINDOW
|
1998-05-20 14:21:00 +00:00
|
|
|
|
|
|
|
#endif // __MFCTEST_H__
|