Files
envi-code/SourceCode/Code2026/tg_shs/shs_blklib/SlidePicture.cpp
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

71 lines
1.4 KiB
C++

// SlidePicture.cpp : implementation file
//
#include "stdafx.h"
#include "SlidePicture.h"
#include "tuanmanage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSlidePicture
CSlidePicture::CSlidePicture()
{
m_nRow = 4;
m_nCol = 4;
}
CSlidePicture::~CSlidePicture()
{
}
BEGIN_MESSAGE_MAP(CSlidePicture, CStatic)
//{{AFX_MSG_MAP(CSlidePicture)
ON_WM_MOUSEWHEEL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSlidePicture message handlers
void CSlidePicture::DividePicture(Array<CRect> &rectArray)
{
CRect rect;
GetWindowRect(rect);
CRect rec;
rect.DeflateRect(2,2);
rectArray.Clear();
int n,m;
n = (rect.right - rect.left)/m_nCol;
m = (rect.bottom - rect.top)/m_nRow;
for (int i = 0;i < m_nRow;i ++)
{
for (int j = 0;j < m_nCol;j++)
{
rec.top = rect.top + m * i;
rec.left = rect.left + n * j;
rec.right = rec.left + n;
rec.bottom = rec.top + m;
rec.DeflateRect(2,2);
rectArray.AddTail(rec);
}
}
}
int CSlidePicture::PageSize()
{
return m_nCol * m_nRow;
}
BOOL CSlidePicture::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
// TODO: Add your message handler code here and/or call default
m_Dlg->MouseWheel(zDelta);
return CStatic::OnMouseWheel(nFlags, zDelta, pt);
}