📄 membar.cpp
字号:
// mybar.cpp : implementation file
//
#include "stdafx.h"
#include "Architecture.h"
#include "Globals.h"
#include "Splitter.h"
#include "MainFrm.h"
#include "DlxDoc.h"
#include "MemBar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMemBar
extern CDlxDoc * MyDoc;
CMemBar::CMemBar()
{
}
CMemBar::~CMemBar()
{
}
BEGIN_MESSAGE_MAP(CMemBar, baseCMyBar)
//{{AFX_MSG_MAP(CMemBar)
ON_WM_CREATE()
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMemBar message handlers
int CMemBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (baseCMyBar::OnCreate(lpCreateStruct) == -1)
return -1;
SetSCBStyle(GetSCBStyle() | SCBS_SHOWEDGES | SCBS_SIZECHILD);
const DWORD dwViewStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD | WS_BORDER|LVS_ALIGNTOP|LVS_REPORT;
if(!m_wndChild.Create(dwViewStyle,CRect(0,0,500,100),this,1984))
return -1;
m_wndChild.SetExtendedStyle(LVS_EX_GRIDLINES);
m_wndChild.InsertColumn(0,_T("Data Memory"),LVCFMT_LEFT,100);
// m_wndChild.InsertColumn(1,_T("Memory"),LVCFMT_LEFT,100);
MemInsert(false);
return 0;
}
void CMemBar::MemInsert(bool first)
{
m_wndChild.DeleteAllItems();
char msg[100];
if(first)
for(int i=0;i<100;i++)
{
sprintf(msg,"Memory [%d]: %d",i,MyDoc->m_Memory[i]);
m_wndChild.InsertItem(i,msg);
}
else
for(int i=0;i<100;i++)
{
sprintf(msg,"Memory [%d]: %d",i,0);
m_wndChild.InsertItem(i,msg);
}
}
void CMemBar :: MemUpdate(int intem)
{
char msg[100];
sprintf(msg,"Memory [%d]: %d",intem,MyDoc->m_Memory[intem]);
m_wndChild.DeleteItem(intem);
m_wndChild.InsertItem(intem,msg);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -