2011-10-25 00:55:52 +04:00
|
|
|
// MainFrm.cpp : implementation of the CMainFrame class
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
2016-04-29 16:07:46 +03:00
|
|
|
|
2011-10-25 00:55:52 +04:00
|
|
|
#include "mfc1.h"
|
|
|
|
|
|
|
|
#include "MainFrm.h"
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
#define new DEBUG_NEW
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// CMainFrame
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
|
2016-05-16 17:34:04 +03:00
|
|
|
ON_WM_CREATE()
|
2011-10-25 00:55:52 +04:00
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
static UINT indicators[] = {
|
|
|
|
ID_SEPARATOR, // status line indicator
|
|
|
|
ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL,
|
2011-10-25 00:55:52 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// CMainFrame construction/destruction
|
|
|
|
|
|
|
|
CMainFrame::CMainFrame()
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
// TODO: add member initialization code here
|
2011-10-25 00:55:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
CMainFrame::~CMainFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE |
|
|
|
|
CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
|
|
|
|
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
|
|
|
|
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) {
|
|
|
|
TRACE0("Failed to create toolbar\n");
|
|
|
|
return -1; // fail to create
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!m_wndStatusBar.Create(this) ||
|
|
|
|
!m_wndStatusBar.SetIndicators(indicators,
|
|
|
|
sizeof(indicators) / sizeof(UINT))) {
|
|
|
|
TRACE0("Failed to create status bar\n");
|
|
|
|
return -1; // fail to create
|
|
|
|
}
|
|
|
|
// TODO: Delete these three lines if you don't want the toolbar to be
|
|
|
|
// dockable
|
|
|
|
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
|
|
|
EnableDocking(CBRS_ALIGN_ANY);
|
|
|
|
DockControlBar(&m_wndToolBar);
|
|
|
|
|
|
|
|
return 0;
|
2011-10-25 00:55:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!CMDIFrameWnd::PreCreateWindow(cs))
|
|
|
|
return FALSE;
|
|
|
|
// TODO: Modify the Window class or styles here by modifying
|
|
|
|
// the CREATESTRUCT cs
|
2011-10-25 00:55:52 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
return TRUE;
|
2011-10-25 00:55:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// CMainFrame diagnostics
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
void CMainFrame::AssertValid() const
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
CMDIFrameWnd::AssertValid();
|
2011-10-25 00:55:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMainFrame::Dump(CDumpContext& dc) const
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
CMDIFrameWnd::Dump(dc);
|
2011-10-25 00:55:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif //_DEBUG
|
|
|
|
|
|
|
|
// CMainFrame message handlers
|