📄 hexeditview.h
字号:
#pragma once
#include "GameMasterDoc.h"
// CHexEditView 视图
//内存编辑视图,用于实现内存编辑修改
class CHexEditView : public CView
{
DECLARE_DYNCREATE(CHexEditView)
public:
CHexEditView(); // 动态创建所使用的受保护的构造函数
virtual ~CHexEditView();
//属性
protected:
UINT m_nRows; //总的行数
UINT m_nPageRows;//一页的行数
UINT m_nPageCols;//一页的列数
int m_nTopLine;//一页里最上面的行
int m_nLeftChar;//一页里最左边的列
int m_nLineHeight;//行高
int m_nCharWidth;//列宽
CFont font;//视图字体
//16进制编辑有关数据
BOOL m_bFocused;
BOOL m_bStartDrag;
BOOL m_bFirst;
int m_nHexStart; //16进制显示起始位置
int m_nTextStart; //ASCII码字符显示起始位置
UINT m_nSelStart, m_nSelEnd,m_noriStart; //被选中的字符串
int m_nCharCount;//字符串长度
DWORD startAddress; //要显示的起始地址
char *strText;
//操作
protected:
//获取客户区信息
void GetClientInfo();
UINT PointPos(CPoint point);
//设置滚动条;
void SetVertScrollBar();//垂直
void SetHorzScrollBar();//水平
//计算顶行和左列
void ChangeLeft();
void ChangeTop();
public:
//设置视图属性
void SetView(DWORD dwAddress,char *text,int nDocChar,LOGFONT lf);
//重载
public:
virtual void OnDraw(CDC* pDC); // 重写以绘制此视图
CGameMasterDoc* GetDocument() const;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
// virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
virtual BOOL PreTranslateMessage(MSG* pMsg);
//上下左右处理
afx_msg void OnCharLeft();
afx_msg void OnCharRight();
afx_msg void OnLineUp();
afx_msg void OnLineDown();
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
};
#ifndef _DEBUG // HexEditView.cpp 的调试版本
inline CGameMasterDoc* CHexEditView::GetDocument() const
{ return reinterpret_cast<CGameMasterDoc*>(m_pDocument); }
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -