📄 linkitem.cpp
字号:
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1997 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include "stdafx.h"
#include "padview.h"
#include "paddoc.h"
#include "paditem.h"
#include "linkitem.h"
#include <limits.h>
IMPLEMENT_DYNAMIC(CPadLinkItem, CEmbeddedItem)
CPadLinkItem::CPadLinkItem(CPadDoc* pContainerDoc, LPCTSTR pszItemName)
: CEmbeddedItem(pContainerDoc)
{
CString strItemName(pszItemName);
SetItemName(strItemName);
_stscanf(strItemName, _T("%d %d"), &m_nBeg, &m_nEnd);
}
CPadLinkItem::CPadLinkItem(CPadDoc* pContainerDoc, int nFrom, int nTo)
: CEmbeddedItem(pContainerDoc)
{
m_nBeg = nFrom;
m_nEnd = nTo;
TCHAR buf[30];
wsprintf(buf, _T("%d %d"), m_nBeg, m_nEnd);
SetItemName(buf);
}
void CPadLinkItem::OnShow()
{
CPadDoc* pDoc = (CPadDoc*)GetDocument();
ASSERT(pDoc != NULL);
ASSERT_VALID(pDoc);
ASSERT_KINDOF(CPadDoc, pDoc);
pDoc->SetSelection(m_nBeg, m_nEnd);
CEmbeddedItem::OnShow();
}
/////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -