112 lines
1.8 KiB
C++
112 lines
1.8 KiB
C++
|
|
// MainFrm.cpp : CFastMainFrame 类的实现
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "Fast.h"
|
|
|
|
#include "FastMainFrm.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
|
|
// CFastMainFrame
|
|
|
|
IMPLEMENT_DYNCREATE(CFastMainFrame, CFrameWnd)
|
|
|
|
BEGIN_MESSAGE_MAP(CFastMainFrame, CFrameWnd)
|
|
ON_WM_CREATE()
|
|
ON_COMMAND(ID_CALIBRATOR, &CFastMainFrame::OnCalibrator)
|
|
ON_COMMAND(ID_FISHEYE, &CFastMainFrame::OnFisheye)
|
|
END_MESSAGE_MAP()
|
|
|
|
static UINT indicators[] =
|
|
{
|
|
ID_SEPARATOR, // 状态行指示器
|
|
ID_INDICATOR_CAPS,
|
|
ID_INDICATOR_NUM,
|
|
ID_INDICATOR_SCRL,
|
|
};
|
|
|
|
// CFastMainFrame 构造/析构
|
|
|
|
CFastMainFrame::CFastMainFrame()
|
|
{
|
|
// TODO: 在此添加成员初始化代码
|
|
}
|
|
|
|
CFastMainFrame::~CFastMainFrame()
|
|
{
|
|
}
|
|
|
|
int CFastMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|
{
|
|
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
|
|
return -1;
|
|
|
|
if (!m_wndStatusBar.Create(this))
|
|
{
|
|
TRACE0("未能创建状态栏\n");
|
|
return -1; // 未能创建
|
|
}
|
|
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
|
|
|
|
// 最大化主框架窗口
|
|
ShowWindow(SW_SHOWMAXIMIZED);
|
|
|
|
return 0;
|
|
}
|
|
|
|
BOOL CFastMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
|
{
|
|
if( !CFrameWnd::PreCreateWindow(cs) )
|
|
return FALSE;
|
|
// TODO: 在此处通过修改
|
|
// CREATESTRUCT cs 来修改窗口类或样式
|
|
|
|
// 移除最大化按钮
|
|
cs.style &= ~WS_MAXIMIZEBOX;
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
// CFastMainFrame 诊断
|
|
|
|
#ifdef _DEBUG
|
|
void CFastMainFrame::AssertValid() const
|
|
{
|
|
CFrameWnd::AssertValid();
|
|
}
|
|
|
|
void CFastMainFrame::Dump(CDumpContext& dc) const
|
|
{
|
|
CFrameWnd::Dump(dc);
|
|
}
|
|
#endif //_DEBUG
|
|
|
|
|
|
// CFastMainFrame 消息处理程序
|
|
|
|
|
|
|
|
void CFastMainFrame::ActivateFrame(int nCmdShow)
|
|
{
|
|
// TODO: 在此添加专用代码和/或调用基类
|
|
CFrameWnd::ActivateFrame(nCmdShow);
|
|
}
|
|
|
|
|
|
void CFastMainFrame::OnCalibrator()
|
|
{
|
|
// TODO: 在此添加命令处理程序代码
|
|
theApp.m_bCalibrator = TRUE;
|
|
}
|
|
|
|
|
|
void CFastMainFrame::OnFisheye()
|
|
{
|
|
// TODO: 在此添加命令处理程序代码
|
|
theApp.m_bCalibrator = FALSE;
|
|
}
|