📄 scrollstate.h
字号:
// ScrollState.h: interface for the ScrollState class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SCROLLSTATE_H__BFFBF43B_66FA_46C4_A24A_57ACB79615F3__INCLUDED_)
#define AFX_SCROLLSTATE_H__BFFBF43B_66FA_46C4_A24A_57ACB79615F3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class ScrollState
{
public:
ScrollState();
virtual ~ScrollState();
public:
/**-----------------------------------------------------------------------------
* 名 称: <OnPageDown>
* 说 明: <向下翻页>
* 参 数: <UGint nRecordIndex>:
* 返 回: <>
*-----------------------------------------------------------------------------------*/
bool OnPageDown(int nRecordIndex = 0);
/**-----------------------------------------------------------------------------
* 名 称: <OnPageUp>
* 说 明: <向上翻页>
* 参 数: <UGint nRecordIndex>:
* 返 回: <>
*-----------------------------------------------------------------------------------*/
bool OnPageUp(int& nRecordIndex);
/**-----------------------------------------------------------------------------
* 名 称: <OnSetSize>
* 说 明: <记录滚动条原始大小>
* 参 数: < HWND hWnd>:<滚动条句柄>
* <HWND hForm>:<父窗体句柄>
* 返 回:
*-----------------------------------------------------------------------------------*/
void OnSetSize(HWND hWnd, HWND hForm);
/**-----------------------------------------------------------------------------
* 名 称: <UpdataScrollPosition>
* 说 明: <点击上、下移按钮时滑块作相应的移动>
* 参 数: <long lPage>:<在第几页>
* 返 回:
*-----------------------------------------------------------------------------------*/
void UpdataScrollPosition(long lPage);
/**-----------------------------------------------------------------------------
* 名 称: <OnInitScrollState>
* 说 明: <初始化滑块>
* 参 数: <UGint nRecordCount>:<总的记录数,及滑块的范围>
* <UGint nCount>:<总的页数>
* 返 回: <当总的记录数小于单页记录数时只,页数为1>
*-----------------------------------------------------------------------------------*/
long OnInitScrollState(int nRecordCount, int nCount);
private:
long m_lBarTop; // 记录移动滑块前的top位置
long m_lBarLeft; // 记录移动滑块前的Left位置
long m_lBarBottom; // 记录移动滑块前的Bottom位置
long m_lBarRight; // 记录移动滑块前的Right位置
long m_lBarHight; // 高度
long m_lBarWidth; // 宽度
int m_nPageCount; // 总的页数
int m_nPageIndex; // 当前页位置 从0开始
int m_nTotal; // 记录总数
int m_nRows; // 每页的记录数
HWND m_hWnd; // 滚动条句柄
};
#endif // !defined(AFX_SCROLLSTATE_H__BFFBF43B_66FA_46C4_A24A_57ACB79615F3__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -