• 大小: 28.47MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-16
  • 语言: C/C++
  • 标签: MFC  实时曲线  

资源简介

应用MFC使用内存双缓冲实现实时曲线无闪烁显示,选中曲线可进行缩放

资源截图

代码片段和文件信息

// MainFrm.cpp : implementation of the CMainframe class
//

#include “stdafx.h“
#include “ScopeTest.h“

#include “MainFrm.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainframe

IMPLEMENT_DYNCREATE(CMainframe CframeWnd)

BEGIN_MESSAGE_MAP(CMainframe CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_CREATE()
ON_COMMAND(ID_RUN_FUNC OnRunFunc)
ON_COMMAND(ID_FORWARD_FUNC OnForwardFunc)
ON_COMMAND(ID_STOP_FUNC onstopFunc)
ON_COMMAND(ID_DEFAULT_FUNC OnDefaultFunc)
ON_COMMAND(ID_BACK_FUNC OnBackFunc)
ON_EN_KILLFOCUS(IDC_EDIT_XMAX OnKillfocusEditXmax)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR           // status line indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};

/////////////////////////////////////////////////////////////////////////////
// CMainframe construction/destruction

CMainframe::CMainframe()
{
// TODO: add member initialization code here

}

CMainframe::~CMainframe()
{
}

int CMainframe::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CframeWnd::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_TOOLBAR1))
{
TRACE0(“Failed to create toolbar\n“);
return -1;      // fail to create
}
CString strText;
if (!m_wndDlgBar.Create(this IDD_DIALOG_BAR 
 CBRS_TOP | CBRS_GRIPPER| CBRS_SIZE_DYNAMIC AFX_IDW_DIALOGBAR))
return -1;
strText.Format(_T(“视图工具“) );
m_wndDlgBar.SetWindowText( strText );
//m_wndDlgBar.EnableDocking(CBRS_ALIGN_ANY);

m_ImageList.Create(16 16 ILC_COLOR24|ILC_MASK22); //后面两个参数22,不重要。随便指定
m_ImageList.Add(AfxGetApp()->LoadIcon(IDR_MAINframe));   
m_ImageList.Add(AfxGetApp()->LoadIcon(IDR_MAINframe));  
m_ImageList.Add(AfxGetApp()->LoadIcon(IDR_MAINframe));
m_ImageList.Add(AfxGetApp()->LoadIcon(IDR_MAINframe)); 
m_ImageList.Add(AfxGetApp()->LoadIcon(IDR_MAINframe));
m_wndToolBar.GetToolBarCtrl().SetImageList(&m_ImageList);
m_ImageList.Detach();


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);
m_wndDlgBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
DockControlBar(&m_wndDlgBar);
//去除菜单
SetMenu(NULL);
return 0;
}

BOOL CMainframe::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CframeWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1064  2014-12-23 11:23  ScopeTest\Debug\BscMake.command.1.tlog

     文件        896  2014-12-23 11:23  ScopeTest\Debug\bscmake.read.1.tlog

     文件        858  2014-12-23 11:23  ScopeTest\Debug\bscmake.write.1.tlog

     文件       5034  2014-12-23 11:23  ScopeTest\Debug\cl.command.1.tlog

     文件      63008  2014-12-23 11:23  ScopeTest\Debug\CL.read.1.tlog

     文件       3770  2014-12-23 11:23  ScopeTest\Debug\CL.write.1.tlog

     文件          2  2015-01-08 11:03  ScopeTest\Debug\link-cvtres.read.1.tlog

     文件          2  2015-01-08 11:03  ScopeTest\Debug\link-cvtres.write.1.tlog

     文件       2140  2015-01-08 11:03  ScopeTest\Debug\link.command.1.tlog

     文件       6472  2015-01-08 11:03  ScopeTest\Debug\link.read.1.tlog

     文件       1556  2015-01-08 11:03  ScopeTest\Debug\link.write.1.tlog

     文件      62845  2014-12-23 11:23  ScopeTest\Debug\MainFrm.obj

     文件          0  2014-12-23 11:23  ScopeTest\Debug\MainFrm.sbr

     文件        768  2015-01-08 11:03  ScopeTest\Debug\mt.command.1.tlog

     文件        688  2015-01-08 11:03  ScopeTest\Debug\mt.read.1.tlog

     文件        506  2015-01-08 11:03  ScopeTest\Debug\mt.write.1.tlog

     文件       1172  2014-12-22 14:17  ScopeTest\Debug\rc.command.1.tlog

     文件       3818  2014-12-22 14:17  ScopeTest\Debug\rc.read.1.tlog

     文件        542  2014-12-22 14:17  ScopeTest\Debug\rc.write.1.tlog

     文件     238810  2014-12-23 11:23  ScopeTest\Debug\Scope.obj

     文件          0  2014-12-23 11:23  ScopeTest\Debug\Scope.sbr

     文件    9366528  2014-12-22 14:24  ScopeTest\Debug\ScopeTest.bsc

     文件     184320  2015-01-08 11:03  ScopeTest\Debug\ScopeTest.exe

     文件        667  2014-12-22 14:17  ScopeTest\Debug\ScopeTest.exe.embed.manifest

     文件        732  2014-12-22 14:17  ScopeTest\Debug\ScopeTest.exe.embed.manifest.res

     文件        381  2015-01-08 11:03  ScopeTest\Debug\ScopeTest.exe.intermediate.manifest

     文件    1856912  2015-01-08 11:03  ScopeTest\Debug\ScopeTest.ilk

     文件         68  2015-01-08 11:04  ScopeTest\Debug\ScopeTest.lastbuildstate

     文件       1094  2015-01-08 11:04  ScopeTest\Debug\ScopeTest.log

     文件      55004  2014-12-23 11:23  ScopeTest\Debug\ScopeTest.obj

............此处省略57个文件信息

评论

共有 条评论