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

📄 memocomponentunit.hpp

📁 这是一个有关文本编辑器的源程序,支持彩色语法,你可以任意修改,修改后发给我一份
💻 HPP
📖 第 1 页 / 共 2 页
字号:
// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'MemoComponentUnit.pas' rev: 6.00

#ifndef MemoComponentUnitHPP
#define MemoComponentUnitHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Menus.hpp>	// Pascal unit
#include <ObjList.hpp>	// Pascal unit
#include <StdCtrls.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Memocomponentunit
{
//-- type declarations -------------------------------------------------------
typedef DynamicArray<TCustomFormattedRange* >  TFormattedRangeArray;

#pragma pack(push, 4)
struct TTextCell
{
	int Row;
	int Col;
} ;
#pragma pack(pop)

struct TUndoOperation;
typedef TUndoOperation *PUndoOperation;

#pragma pack(push, 4)
struct TUndoOperation
{
	int RStart;
	int REnd;
	AnsiString NewText;
	TUndoOperation *NextItem;
} ;
#pragma pack(pop)

typedef void __fastcall (__closure *TReplaceEvent)(System::TObject* Sender, int Pos, int Change);

class DELPHICLASS TMemoComponent;
class DELPHICLASS TIntegerList;
class PASCALIMPLEMENTATION TIntegerList : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	Classes::TList* FList;
	int __fastcall GetCount(void);
	int __fastcall GetItem(int ItemIndex);
	void __fastcall SetItem(int ItemIndex, const int Value);
	void __fastcall SetCount(const int Value);
	
public:
	__fastcall TIntegerList(void);
	__fastcall virtual ~TIntegerList(void);
	int __fastcall Add(int Item);
	void __fastcall Insert(int Index, int Item);
	void __fastcall Delete(int Index);
	DYNAMIC void __fastcall Clear(void);
	__property int Items[int ItemIndex] = {read=GetItem, write=SetItem};
	__property int Count = {read=GetCount, write=SetCount, nodefault};
};


class DELPHICLASS TMCRanges;
typedef TMetaClass*TRangeClass;

class DELPHICLASS TCustomRange;
class PASCALIMPLEMENTATION TMCRanges : public Objlist::TFastObjectContainer 
{
	typedef Objlist::TFastObjectContainer inherited;
	
private:
	TMetaClass*FItemClass;
	TMemoComponent* __fastcall NewGetOwner(void);
	
protected:
	TCustomRange* __fastcall NewGetItem(int ItemIndex);
	
public:
	bool FDestroying;
	__fastcall TMCRanges(TMemoComponent* AOwner);
	__fastcall virtual ~TMCRanges(void);
	HIDESBASE TCustomRange* __fastcall Add(void)/* overload */;
	HIDESBASE TCustomRange* __fastcall Add(int Start, int Count)/* overload */;
	__property TMetaClass* ItemClass = {read=FItemClass, write=FItemClass};
	__property TCustomRange* Items[int ItemIndex] = {read=NewGetItem};
	__property TMemoComponent* Owner = {read=NewGetOwner};
};


class DELPHICLASS TVisibleRange;
class PASCALIMPLEMENTATION TCustomRange : public Objlist::TFastContainerItem 
{
	typedef Objlist::TFastContainerItem inherited;
	
private:
	TMemoComponent* FEditor;
	int FChanging;
	Classes::TNotifyEvent FOnOverwrite;
	Classes::TNotifyEvent FOnChange;
	Types::TPoint __fastcall GetEndPoint();
	Types::TPoint __fastcall GetStartPoint();
	
protected:
	virtual void __fastcall SetRStart(const int Value);
	virtual void __fastcall SetREnd(const int Value);
	virtual void __fastcall SetRLength(const int Value);
	virtual int __fastcall GetRStart(void) = 0 ;
	virtual int __fastcall GetREnd(void) = 0 ;
	virtual int __fastcall GetRLength(void);
	virtual TTextCell __fastcall GetEndRowCol();
	virtual TTextCell __fastcall GetStartRowCol();
	virtual void __fastcall SetEndRowCol(const TTextCell &Value);
	virtual void __fastcall SetStartRowCol(const TTextCell &Value);
	virtual void __fastcall SetText(const AnsiString Value);
	virtual AnsiString __fastcall GetText();
	DYNAMIC void __fastcall Changing(void);
	DYNAMIC void __fastcall Change(void);
	DYNAMIC void __fastcall DiscardChanges(void);
	virtual void __fastcall InternalDoMove(int RangeStart, int RangeEnd, int LC);
	
public:
	__fastcall virtual TCustomRange(Objlist::TFastObjectContainer* Collection);
	virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
	DYNAMIC void __fastcall NotifyOverwrite(void);
	void __fastcall DoChanging(void);
	void __fastcall DoChange(void);
	void __fastcall DoDiscardChanges(void);
	virtual void __fastcall Clear(void);
	bool __fastcall CharInRange(int CharIdx);
	virtual void __fastcall DrawRange(void);
	virtual void __fastcall ScrollInView(int FromBorder);
	__property TMemoComponent* Editor = {read=FEditor, write=FEditor};
	__property TTextCell StartRowCol = {read=GetStartRowCol, write=SetStartRowCol};
	__property TTextCell EndRowCol = {read=GetEndRowCol, write=SetEndRowCol};
	__property Types::TPoint StartPoint = {read=GetStartPoint};
	__property Types::TPoint EndPoint = {read=GetEndPoint};
	__property AnsiString Text = {read=GetText, write=SetText};
	
__published:
	__property int RStart = {read=GetRStart, write=SetRStart, nodefault};
	__property int REnd = {read=GetREnd, write=SetREnd, nodefault};
	__property int RLength = {read=GetRLength, write=SetRLength, nodefault};
	__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
	__property Classes::TNotifyEvent OnOverwrite = {read=FOnOverwrite, write=FOnOverwrite};
public:
	#pragma option push -w-inl
	/* TFastContainerItem.Destroy */ inline __fastcall virtual ~TCustomRange(void) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TVisibleRange : public TCustomRange 
{
	typedef TCustomRange inherited;
	
private:
	int FLeftCol;
	int FTopRow;
	void __fastcall SetLeftCol(const int Value);
	void __fastcall SetRightCol(const int Value);
	int __fastcall GetRightCol(void);
	void __fastcall SetTopRow(const int Value);
	void __fastcall SetBottomRow(const int Value);
	int __fastcall GetBottomRow(void);
	
protected:
	#pragma pack(push, 1)
	Types::TRect VisibleTextRect;
	#pragma pack(pop)
	
	virtual void __fastcall SetRStart(const int Value);
	virtual void __fastcall SetREnd(const int Value);
	virtual void __fastcall SetRLength(const int Value);
	virtual int __fastcall GetRStart(void);
	virtual int __fastcall GetREnd(void);
	virtual TTextCell __fastcall GetStartRowCol();
	virtual TTextCell __fastcall GetEndRowCol();
	virtual void __fastcall SetStartRowCol(const TTextCell &Value);
	virtual void __fastcall SetEndRowCol(const TTextCell &Value);
	DYNAMIC void __fastcall Changing(void);
	DYNAMIC void __fastcall Change(void);
	void __fastcall Update(void);
	
public:
	__fastcall virtual TVisibleRange(Objlist::TFastObjectContainer* Collection);
	
__published:
	__property int LeftCol = {read=FLeftCol, write=SetLeftCol, nodefault};
	__property int RightCol = {read=GetRightCol, write=SetRightCol, nodefault};
	__property int TopRow = {read=FTopRow, write=SetTopRow, nodefault};
	__property int BottomRow = {read=GetBottomRow, write=SetBottomRow, nodefault};
public:
	#pragma option push -w-inl
	/* TFastContainerItem.Destroy */ inline __fastcall virtual ~TVisibleRange(void) { }
	#pragma option pop
	
};


class DELPHICLASS TSelectionRange;
class DELPHICLASS TMCRange;
class PASCALIMPLEMENTATION TMCRange : public TCustomRange 
{
	typedef TCustomRange inherited;
	
private:
	int FRStart;
	int FREnd;
	
protected:
	virtual void __fastcall SetREnd(const int Value);
	virtual void __fastcall SetRStart(const int Value);
	virtual int __fastcall GetREnd(void);
	virtual int __fastcall GetRStart(void);
	virtual void __fastcall InternalDoMove(int RangeStart, int RangeEnd, int LC);
	
public:
	__fastcall virtual TMCRange(Objlist::TFastObjectContainer* Collection);
public:
	#pragma option push -w-inl
	/* TFastContainerItem.Destroy */ inline __fastcall virtual ~TMCRange(void) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TSelectionRange : public TMCRange 
{
	typedef TMCRange inherited;
	
private:
	TCustomRange* FOldSel;
	bool FBackwards;
	bool FHidden;
	bool FCaretShowing;
	int FScrCol;
	int __fastcall GetCursorPos(void);
	void __fastcall SetCursorPos(const int Value);
	void __fastcall SetHidden(const bool Value);
	int __fastcall GetScrCol(void);
	
protected:
	DYNAMIC void __fastcall Changing(void);
	DYNAMIC void __fastcall Change(void);
	DYNAMIC void __fastcall DiscardChanges(void);
	virtual void __fastcall SetText(const AnsiString Value);
	
public:
	virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
	void __fastcall NoSelAtPos(int Pos);
	void __fastcall UpdateCaretPos(void);
	void __fastcall ShowCaret(void);
	void __fastcall HideCaret(void);
	int __fastcall ScrColToCol(int Row);
	__property int CursorPos = {read=GetCursorPos, write=SetCursorPos, nodefault};
	__property int ScrCol = {read=GetScrCol, write=FScrCol, nodefault};
	
__published:
	__property bool Backwards = {read=FBackwards, write=FBackwards, nodefault};
	__property bool Hidden = {read=FHidden, write=SetHidden, nodefault};
public:
	#pragma option push -w-inl
	/* TMCRange.Create */ inline __fastcall virtual TSelectionRange(Objlist::TFastObjectContainer* Collection) : TMCRange(Collection) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TFastContainerItem.Destroy */ inline __fastcall virtual ~TSelectionRange(void) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TMemoComponent : public Controls::TCustomControl 
{
	typedef Controls::TCustomControl inherited;
	
private:
	bool FHasFocus;
	bool FCaretCreated;
	bool FSelecting;
	bool FDragging;
	bool FStartDrag;
	bool FDblClicked;
	TIntegerList* FLineStarts;
	Stdctrls::TScrollStyle FScrollBars;
	Forms::TFormBorderStyle FBorderStyle;
	bool FReadOnly;
	Classes::TNotifyEvent FOnChange;

⌨️ 快捷键说明

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