Delphi. Analog of Memo/RichEdit

假装没事ソ 提交于 2019-12-10 22:23:28

问题


Does anybody know if there is an analog of Memo/RichEdit? Demand: to number lines, to load big files (more than 5 MB) from a stream.


回答1:


Developer Express have an extensive set of VCL components, among them a Memo replacement (TcxMemo) and a RTF edit (I don't know about the feature set, though).




回答2:


TMS Software has a very good TAdvMemo with a lot of syntax highlighters. And also has a TRichEdit "replacement". In addition to the syntax highlighting their memo supports line numbers. Don't know about large files, but 5MB doesn't sound like anywhere near any limits they c/would have.

TRichView is another highly recommended TRichEdit replacement with a large feature set.




回答3:


Our SynMemoEx component was designed to be light and fast. It loads and handles 50 MB text content with no problem, including word wrap.

But it's only for Delphi 6 up to 2007 (not unicode yet). But it's free and Open Source.

We use this component in our SynProject tool, for both file versioning display and documentation edition. And you've highlighting for .pas .c .cs .h .xml .html .dfm files (and more).

It has line numbering, and other nice features. See some screenshots from here.




回答4:


TRichView is a popular component specifically designed for displaying, editing and printing hypertext documents. There is also a TRichView addon providing WYSIWYG editing. It has Unicode, RTF import and export, HTML export, data aware versions and more.

I use it as a main component in my genealogy program and have used it to load very large files (e.g. 100 MB or more). It can read or write directly to/from streams.




回答5:


Killer component : Synedit - http://sourceforge.net/apps/mediawiki/synedit/index.php?title=SynEdit_Home_Page

check it out :)




回答6:


Does exist any component that can have content linked that looks like a TMemo?

Need (cosider it as a must be able to do):

  • Put two of them with a TSplitter between them
  • Load content only once, but show it on both (to be able to see two parts at the same time), not like TMemo that you must copy on ram all the content
  • Time to load a 100MiB TXT plain text file in less than a second (I/O time from read media excluded), in other words like if you have data on RAM and want to display it on both in less than one second
  • Application must be RunAble (so no component that requieres a separated dll, i know how to inyect dll to the exe and extract them on run) and must run form a read only media in a forensic way (no write anywhere).

Wanted:

  • Not limited to 3GiB on a 32Bits system (not the whole file loaded at once like on ugly ram demand TMemo, only the parts shown)
  • Unicode and UTF-8/UTF-16 with/without BOM header, etc
  • Choose font to show the text, better if could select for all fonts the boolean of mono spaced or normal
  • No limit on line length (TMemo is limited to 4KiB-1 per line), if you have a line with more than one million charcters, see it in one line with correct scroll bar scroll, etc.

Not needed:

  • Sintax, color, etc... just for plain text
  • WordWrap (each line is a line)

Ok, what i am pretending? short answer: simultaneous linked views of a plain text file.

Explained it a little more:

  • Imagine you have a GUI where user can add "separators"
  • Each separator divides the view (not the file) in two parts... so if you have N separators you can see N+1 parts of the file at the same time
  • Each view has its own vertical scrollbar, but there is only one horizontal scroll bar for all (all views are horizontally in sync when scrolling)
  • So user can see first lines on one view, while other parts at the same time without the need to scroll up and down each time

Why? Easy answer: imagine that the file is a log and has more than a million lines... again imagine it is like a historical log... and user wants to see some lines of day X and Day Y and Day # ... etc at the same time (to compare or whatever reason).

If you do it with TMemo, you need to copy all data on all of them... and also 32 bits app are limited to 2GiB of ram on a 32Bits processor and to 3GiB of ram on a 64Bits processor (f compiled with a special directive).

Remember, the app must run on both 32Bits and 64Bits processors without needing to compile different versions... and must be RunAble and need no write at all (anywhere) on run (forensic style).

I thought on a possible way to create it... based on TStringList, but again i am so limited... and it is so much work from scratch.

Maybe there is a component out there since i have seen some apps that can show you a big file without loading it, are all of them with its own implementation from scratch? or they use a component i do not know about?, most of them are for hex editing a big binary file, some can edit files of a lot of GiB, and just a few of them can insert and delete really fast till they save (I/O for copying the whole file while doing pending insert/delete operations can take a really long time, more than one hour, but doing the insert/delete on screen is pretty fast, less than a tenth of a second).

I can do all want i want if i found a component that:

  • Looks like a TMemo
  • By code can be simulated vertical & horizontal scrolls without touching selected text selection (i can hide scrollbar with a smaller TPanel container, so no need for the control to let hide the scrollbars)
  • Really Very Important: Do not load the whole file (only read the part shown)
  • Have LoadFromFile (but not really load the whole file, just internally store file reference)
  • Not needed but desired: user be able to edit like on a TMemo
  • Not needed but desired: have SaveToFile to save user changes

Is out there anyone?

Added: Free of Charge (for any use) and OpenSource is a must.



来源:https://stackoverflow.com/questions/6284630/delphi-analog-of-memo-richedit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!