visualkb.h

来自「是一个用C++编写的图形编辑器!」· C头文件 代码 · 共 75 行

H
75
字号
#define MAX_STRINGS 1204  
#include "cstring.h"
#include <afxwin.h>
#include "resource.h"

class CMyApp : public CWinApp
{
public:
    virtual BOOL InitInstance ();
};

class CMainWindow : public CWnd
{
protected:
    int m_cxChar;			// Average character width
    int m_cyChar;			// Character height
    int m_cyLine;			// Vertical line spacing in message box
	int m_nLineCount;      //Total line text 
  	int m_nCurrentRow;		// Index of current row 	
	int m_nCurrentCol;		//Index of current character in the current row
	int m_nPrevCol;
	int m_nPrevRow;
    int m_nLineLimit;			// Maximum width of a line in text box

    HCURSOR m_hCursorArrow;		// Handle of arrow cursor
    HCURSOR m_hCursorIBeam;		// Handle of I-beam cursor

    CPoint m_ptTextOrigin;      // Origin for drawing input text
    CPoint m_ptCaretPos;		// Current caret插字符 position

    CRect m_rcTextBox;			// Coordinates of text box
    CRect m_rcTextBoxBorder;	// Coordinates of text box border
	CRect m_EditBox;
    cstring m_strInputText;     // Input text
	cstring m_strDeleteText;	//deleted text
 	CFont font;
	BOOL b_CaretHide;
	BOOL b_Selected;
public:
	void Adjust(cstring &m_str);
    CMainWindow ();

protected:
	CPoint GetPointFromPosition();//从当前行、列计算出逻辑坐标值
	void GetPositionFromPoint(CPoint point);//根据当前逻辑坐标值计算出行、列
 
   
protected:
    virtual void PostNcDestroy ();

    afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnPaint ();
	afx_msg void OnSize( UINT nType, int cx, int cy );
    afx_msg void OnSetFocus (CWnd* pWnd);
    afx_msg void OnKillFocus (CWnd* pWnd);
    afx_msg BOOL OnSetCursor (CWnd* pWnd, UINT nHitTest, UINT message);
    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 OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyUp( UINT nChar, UINT nRepCnt, UINT nFlags );
    afx_msg void OnChar (UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnFileExit();
 	afx_msg void OnEditDelete();
	afx_msg void OnEditPaste();
	afx_msg void OnEditCopy();
	afx_msg void OnEditCut();
	afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditDelete(CCmdUI* pCmdUI);
    afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);

    DECLARE_MESSAGE_MAP ()
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?