accel.h
#define LINESIZE 8
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMainWindow : public CFrameWnd
{
public:
CMainWindow();
protected:
int m_nCellWidth;
int m_nCellHeight;
int m_nRibbonWidth;
int m_nViewWidth;
int m_nViewHeight;
int m_nHScrollPos;
int m_nVScrollPos;
int m_nHPageSize;
int m_nVPageSize;
public:
DECLARE_MESSAGE_MAP()
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnPaint();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnSize(UINT nType, int cx, int cy);
};
accel.cpp
#include <afxwin.h>
#include "Accel.h"
CMyApp app;
BOOL CMyApp::InitInstance()
{
// TODO: 在此添加专用代码和/或调用基类
this->m_pMainWnd = new CMainWindow();
this->m_pMainWnd->ShowWindow(this->m_nCmdShow);
this->m_pMainWnd->UpdateWindow();
return TRUE;
//return CWinApp::InitInstance();
}
CMainWindow::CMainWindow()
: m_nCellWidth(0)
, m_nCellHeight(0)
, m_nRibbonWidth(0)<