Fetch the repository succeeded.
This action will force synchronization from Seconight/MFC_连连看游戏, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
// CHelpDialog.cpp: 实现文件
//
#include "pch.h"
#include "Lianliankan.h"
#include "CHelpDialog.h"
#include "afxdialogex.h"
// CHelpDialog 对话框
IMPLEMENT_DYNAMIC(CHelpDialog, CDialogEx)
CHelpDialog::CHelpDialog(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_HELP_DIALOG, pParent)
{
m_nXPos = 0;
m_nYPos = 0;
}
CHelpDialog::~CHelpDialog()
{
}
void CHelpDialog::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CHelpDialog, CDialogEx)
ON_WM_PAINT()
ON_WM_VSCROLL()
END_MESSAGE_MAP()
// CHelpDialog 消息处理程序
void CHelpDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CDialogEx::OnPaint()
/*dc.BitBlt(0, 0, 3840, 2160, &m_dcMem, 700, 200, SRCCOPY);*/
//CPaintDC dc(this); // device context for painting
// 用指定的坐标设置设备环境的窗口原点
SetWindowOrgEx(dc.m_hDC, m_nXPos, m_nYPos, NULL);
// 创建一块和窗口滑动区域一样大的内存DC,这样才不会出现窗口图形叠加的问题
CRect rc(0, 0, 0, 0);
SCROLLINFO si = { sizeof(SCROLLINFO) };
si.fMask = SIF_RANGE;
GetScrollInfo(SB_VERT, &si);
rc.bottom = si.nMax;
GetScrollInfo(SB_HORZ, &si);
rc.right = si.nMax;
CDC memDC;
memDC.CreateCompatibleDC(&dc);
CBitmap memBitmap;
memBitmap.CreateCompatibleBitmap(&dc, rc.Width(), rc.Height());
CBitmap* pOldBmp = memDC.SelectObject(&memBitmap);
memDC.FillSolidRect(&rc, RGB(0, 0, 0));
CFont font;
font.CreateFont(20, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS, _T("Arial"));
memDC.SetBkMode(TRANSPARENT);
memDC.SetTextColor(RGB(255, 255, 255));
CFont* pOldFont = memDC.SelectObject(&font);
int nH = 40;
CRect rcText(0, rc.top, rc.right, rc.top + nH);
CString str;
CTime time;
for (int i = 0; i < 200; i++)
{
::OffsetRect(&rcText, 0, nH);
if (rcText.bottom > rc.bottom)
{
break;
}
time = CTime::GetCurrentTime();
str.Format(_T("当前行:[%d] "), i);
str += time.Format(_T("%Y年%m%d日 %H时%M分%S秒 <%c>"));
str += _T(" -------------------- ");
str += str;
str += str;
memDC.DrawText(str, rcText, DT_LEFT);
}
dc.BitBlt(0, 0, 1920, 1080, &m_dcMem, 0, 0, SRCCOPY);
memDC.SelectObject(pOldFont);
memDC.SelectObject(pOldBmp);
memDC.DeleteDC();
memBitmap.DeleteObject();
CDialogEx::OnPaint();
}
BOOL CHelpDialog::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: 在此添加额外的初始化
CBitmap bmpMain;
bmpMain.LoadBitmapW(IDB_HELP);
//创建兼容DC
CClientDC dc(this);
m_dcMem.CreateCompatibleDC(&dc);
m_dcMem.SelectObject(&bmpMain);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CHelpDialog::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
//SCROLLINFO scrollinfo;
//GetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
//int unit = 3;
//switch (nSBCode)
//{
//case SB_LINEUP: //Scroll one line up
// scrollinfo.nPos -= 1;
// if (scrollinfo.nPos < scrollinfo.nMin)
// {
// scrollinfo.nPos = scrollinfo.nMin;
// break;
// }
// SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
// ScrollWindow(0, unit);
//
// break;
//case SB_LINEDOWN: //Scroll one line down
// scrollinfo.nPos += 1;
// if (scrollinfo.nPos + scrollinfo.nPage > scrollinfo.nMax) //此处一定要注意加上滑块的长度,再作判断
// {
// scrollinfo.nPos = scrollinfo.nMax;
// break;
// }
// SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
// ScrollWindow(0, -unit);
//
// break;
//case SB_PAGEUP: //Scroll one page up.
// scrollinfo.nPos -= 5;
// if (scrollinfo.nPos <= scrollinfo.nMin)
// {
// scrollinfo.nPos = scrollinfo.nMin;
// break;
// }
// SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
// ScrollWindow(0, unit * 5);
//
// break;
//case SB_PAGEDOWN: //Scroll one page down
// scrollinfo.nPos += 5;
// if (scrollinfo.nPos + scrollinfo.nPage >= scrollinfo.nMax) //此处一定要注意加上滑块的长度,再作判断
// {
// scrollinfo.nPos = scrollinfo.nMax;
// break;
// }
// SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
// ScrollWindow(0, -unit * 5);
//
// break;
//case SB_ENDSCROLL: //End scroll
// break;
//case SB_THUMBPOSITION: //Scroll to the absolute position. The current position is provided in nPos
// break;
//case SB_THUMBTRACK: //Drag scroll box to specified position. The current position is provided in nPos
// ScrollWindow(0, (scrollinfo.nPos - nPos) * unit);
// scrollinfo.nPos = nPos;
// SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
// break;
//}
SCROLLINFO si = { sizeof(si) };
si.fMask = SIF_ALL;
GetScrollInfo(SB_VERT, &si);
int nPrevPos = si.nPos;
switch (nSBCode)
{
case SB_TOP:
si.nPos = si.nMin;
break;
case SB_BOTTOM:
si.nPos = si.nMax;
break;
case SB_LINEUP:
si.nPos -= 1500;
break;
case SB_LINEDOWN:
si.nPos += 1500;
break;
case SB_PAGEUP:
si.nPos -= si.nPage;
break;
case SB_PAGEDOWN:
si.nPos += si.nPage;
break;
case SB_THUMBTRACK:
si.nPos = si.nTrackPos;
break;
default:
break;
}
si.fMask = SIF_POS;
SetScrollInfo(SB_VERT, &si, TRUE);
if (si.nPos != nPrevPos)
{
m_nYPos += si.nPos - nPrevPos;
ScrollWindow(0, nPrevPos - si.nPos, NULL, NULL);
Invalidate(FALSE);
UpdateWindow();
}
CDialogEx::OnVScroll(nSBCode, nPos, pScrollBar);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。