📄 outdlg.cpp
字号:
// OutDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Made.h"
#include "OutDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "CompPage.h"
/////////////////////////////////////////////////////////////////////////////
// COutDlg dialog
COutDlg::COutDlg(CWnd* pParent /*=NULL*/)
: CDialog(COutDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(COutDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void COutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COutDlg)
DDX_Control(pDX, IDC_LIST, m_List);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COutDlg, CDialog)
//{{AFX_MSG_MAP(COutDlg)
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COutDlg message handlers
BOOL COutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CCompPage * pf=(CCompPage *)lpvoid;
CString str;
CClientDC dc(this);
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);
m_List.ModifyStyle(0,LVS_REPORT);
m_List.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE,0,LVS_EX_FULLROWSELECT);
m_List.InsertColumn(0,"序号",LVCFMT_LEFT,8*tm.tmAveCharWidth,3);
m_List.InsertColumn(1,"位置",LVCFMT_LEFT,8*tm.tmAveCharWidth,0);
m_List.InsertColumn(2,"文件1",LVCFMT_LEFT,8*tm.tmAveCharWidth,1);
m_List.InsertColumn(3,"文件2",LVCFMT_LEFT,8*tm.tmAveCharWidth,2);
m_List.SetExtendedStyle(0);
CWord * word;
LV_ITEM item;
item.mask=LVIF_TEXT;
for(int i=0;i<pf->m_Word.GetSize();i++)
{
str.Format("%d",i+1);
m_List.InsertItem(i,str);
word=(CWord *)pf->m_Word.GetAt(i);
str.Format("%d",word->sit);
m_List.SetItemText(i,1,str);
str.Format("%d:%c",word->c1,word->c1);
m_List.SetItemText(i,2,str);
str.Format("%d:%c",word->c2,word->c2);
m_List.SetItemText(i,3,str);
if(i>254)
break;
}
str.Format("说明");
m_List.InsertItem(i+1,str);
str.Format("共%d处不同",pf->m_Word.GetSize());
m_List.SetItemText(i+1,1,str);
str.Format("%ld",pf->L_File1);
m_List.SetItemText(i+1,2,str);
str.Format("%ld",pf->L_File2);
m_List.SetItemText(i+1,3,str);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void COutDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if(IsWindowVisible())
m_List.MoveWindow(11,0,cx-20,cy-11);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -