⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 twscriptedit.h

📁 模拟了tec2000的所有功能
💻 H
字号:
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998 by Juraj Rojko jrojko@twist.cz
// All rights reserved
//
#if !defined(AFX_TWSCRIPTEDIT_H__82F5E419_1C74_11D1_87FA_00403395B157__INCLUDED_)
#define AFX_TWSCRIPTEDIT_H__82F5E419_1C74_11D1_87FA_00403395B157__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// TWScriptEdit.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CTWScriptEdit window

#include"HelpRelated.h"
#include "Asm.h"
#include "MicroIns.h"

class Casm;

class CTWScriptEdit : public CRichEditCtrl
{
// Construction
public:
	CTWScriptEdit();

	void Initialize();
// Attributes
public:
	void SetCaseSensitive(BOOL bSensitive);
	void SetChangeCase(BOOL bChange);

	void SetSLComment(TCHAR chComment, TCHAR chComment2 = 0);
	void SetSLComment(LPCTSTR lpszComment);
	void SetStringQuotes(LPCTSTR lpszStrQ);

	void AddKeywords(LPCTSTR lpszKwd);
	void AddConstants(LPCTSTR lpszKwd);
	void ClearKeywords();
	void ClearConstants();

	void SetKeywordColor(COLORREF clr, BOOL bBold);
	void SetConstantColor(COLORREF clr, BOOL bBold);
	void SetCommentColor(COLORREF clr, BOOL bBold);
	void SetNumberColor(COLORREF clr, BOOL bBold);
	void SetStringColor(COLORREF clr, BOOL bBold);
	void SetOtherColor(COLORREF clr, BOOL bBold);
	
	void GetInsFromCmd(char * ins,char * cmd);
	void OnlyC(char * ins);
	void GetLastCmdFromText(char * cmd);
	void GetLastInsFromText(char * ins);
	void GetLastLineFromText(char *line);
	void ShowHelp();
	void GetFirstCharFromLastLine(char * ch);
	int GetLengthOfLastLine();
	void MakeUp(char *ch,int n);
	void MakeLow(char *ch,int n);
	void ShowRegisterContext();
	void ChangeColor();
	static void Run(LPVOID param);
    static void OutConsole(LPVOID param);
	void OutConsole1(char ch);


// Operations
public:
	void FormatAll();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTWScriptEdit)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CTWScriptEdit();

	WORD interBase;

	bool inter1_0,inter1_1,inter2_0,inter2_1,inter3_0,inter3_1,inter;

//	Casm asmtemp;

	Casm asmtemp;
	MicroIns microtemp;

	int end;


	CString text;
	char curchar;
	char strins[500];
	int inslength;

	char instemp[500];
	int instemplen;
	char buffer[500];

	bool runflag;
	HANDLE hTh;
	HANDLE hOut;
	volatile HANDLE m_hEvent;

	HelpRelated help;
//	bool helpsign;

	// Generated message map functions
public:

	CWinThread * m_pThread;

	BOOL IsStringQuote(TCHAR ch);
	int IsKeyword(LPCTSTR lpszSymbol);
	int IsConstant(LPCTSTR lpszSymbol);

	void SetFormatRange(int nStart, int nEnd, BOOL bBold, COLORREF clr);
	void FormatTextRange(int nStart, int nEnd);
	void FormatTextLines(int nStart, int nEnd);
	void ChangeCase(int nStart, int nEnd, LPCTSTR lpszStr);


	struct SymbolColor {
		COLORREF clrColor;
		BOOL bBold;
	};

	enum ChangeType {ctUndo, ctUnknown, ctReplSel, ctDelete, ctBack, ctCut, ctPaste, ctMove};

	BOOL m_bCaseSensitive; //大小写是否敏感
	BOOL m_bChangeCase; //是否可以改变改变大小写

	TCHAR m_chComment; 
	TCHAR m_chComment2;
	CString m_strComment;

	CString m_strStringQuotes;
	CString m_strKeywords;  //关键字
	CString m_strKeywordsLower; //关键字的小写形式
	CString m_strConstants;   //常量
	CString m_strConstantsLower;

	SymbolColor m_icComment;  //注释的颜色值
	SymbolColor m_icNumber; //数字的颜色值
	SymbolColor m_icString; //字符串的颜色值
	SymbolColor m_icKeyword; //关键字的颜色值
	SymbolColor m_icConstant; //常量的颜色值 
    SymbolColor m_icOther;

	BOOL m_bInForcedChange;  //相当于临界区,互斥访问
	ChangeType m_changeType;
	CHARRANGE m_crOldSel;

	//{{AFX_MSG(CTWScriptEdit)
	afx_msg void OnChange();
	afx_msg UINT OnGetDlgCode();
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
	afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
	afx_msg void OnProtected(NMHDR*, LRESULT* pResult);
	afx_msg void OnSelChange(NMHDR*, LRESULT* pResult);

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TWSCRIPTEDIT_H__82F5E419_1C74_11D1_87FA_00403395B157__INCLUDED_)

⌨️ 快捷键说明

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