Source Editor Component
=========================
for Borland Delphi 4 or later
may work in lower versions as well
Copyright (c) 2000 Sebastian Reichelt
SebastianR@gmx.de
TSourceEdit is a source editor control with several features that are
useful for IDE programmers with Delphi knowledge. It is based on
TMemoComponent, which is completely home-made from scratch. However,
many useful properties and methods of TMemo have been implemented.
All properties and methods should be self-explaining. If you have any
questions concerning their usage, feel free to ask me.
Note that you should use the property Text instead of Lines to access
the whole text. To modify a piece of text at runtime, use the
following code, or something similar:
with TMCRange.Create (nil) do
try
Editor := MyComponent; // or whatever the name is
RStart := S; // the first character
REnd := E; // the last character; can be < S
Text := NewText; // the new text;
finally
Free;
end;
Instead of RStart and REnd, you can also use StartRowCol, EndRowCol,
and RLength.
Line breaks are signaled by #13#10.
You also can track positions in your code using ranges. If you do the
following:
MyRange := TMCRange.Create (MyComponent.TrackedRanges);
with MyRange do begin
RStart := S;
REnd := E;
OnOverwrite := MyOverwriteHandle; // optional
end;
then MyRange will always be updated when the text changes, so that you
can easily jump to the correct position of an error, the definition of
an identifier, or wherever you want. Just use:
MyComponent.Selection.Assign (MyRange);
and the range will be selected.
For automatic saving and loading of TSyntaxColoring, a
TSyntaxColoringCopy class has been created, whose instances can be
passed to TStream.ReadComponent and TStream.WriteComponent. Note that
TStream is an abstract class; use TMemoryStream instead. Then you can,
for example, save your whole highlighting options in the registry.
That's all I want to write for now. Happy programming!
Sebastian Reichelt
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
SourceEdit.zip (40个子文件)
SourceEdit
RtfExport.dcu 14KB
ObjList.pas 19KB
MemoComponentUnit.dcu 84KB
RtfExport.~pas 19KB
UtilsDos.pas 19KB
UtilsDos.dcu 22KB
MyEdit
RtfExport.dcu 14KB
RtfExport.~pas 18KB
Unit1.ddp 51B
FindDlg.~ddp 51B
FindDlg.dfm 4KB
Project1.res 876B
Unit1.dcu 9KB
Unit1.~ddp 51B
FindDlg.dcu 5KB
Unit1.dfm 8KB
Project1.~dpr 196B
Project1.cfg 386B
Project1.dpr 188B
Unit1.~dfm 8KB
RtfExport.pas 18KB
Project1.exe 492KB
RtfExport.dfm 328B
FindDlg.ddp 51B
FindDlg.~dfm 4KB
FindDlg.pas 2KB
FindDlg.~pas 2KB
Project1.dof 1KB
Unit1.~pas 5KB
Unit1.pas 5KB
Readme.txt 2KB
ObjList.dcu 18KB
SourceEditUnit.dcu 64KB
UtilsWin.pas 4KB
MemoComponentUnit.pas 94KB
SourceEditUnit.~pas 69KB
RtfExport.pas 19KB
2ccc.com.txt 219B
UtilsSys.pas 552B
SourceEditUnit.pas 69KB
共 40 条
- 1
资源评论
- hero123568992012-07-08d7编译不过
普通网友
- 粉丝: 882
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功