TMemo .. I need an enhanced TMemo.. anyone here have one? or know where one is?

I need a memo that can hold more text then the standard one seems capable of...
I also want to know where the little cursor thingie is in the memo...what line is being viewed?? is there a way to do this?  I can't figure it out.
I found one free component at Torrys  .. TJumpMemo by Alexander Kuznetsov for D2 and D3  it is supposed to be able to hold 8mb of text... but this component won't install... all I get is an error about a 16bit res file :(
LVL 5
GwenaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
intheConnect With a Mentor Commented:
hi
this question comes up regulary and
as you may know its a windows limit not delphi on te ammount of text..same as listboxes etc..
i see some few "virtual" memo components that say can handle more than the windows amount for memos but are not free
(turbopower make one i think and there stuff is not cheap <g>)

the easiest solution is too use a richedit..

Regards Barry
0
 
intheCommented:
to get posisition of caret you can use  

var
Blink :Integer;
begin
Blink := Memo1.Perform(EM_LINEFROMCHAR,$FFFF, 0);

this work on richedits etc as well

also can use EM_CHARFROMPOS etc type messages to find posistions of characters and carets
0
 
intheCommented:
as a side note;

i found this once in a news group:

to get ove 64k text limits :


procedure TForm1.FormCreate(Sender: TObject);
const EM_EXLIMITTEXT  = WM_USER + 53;
begin
sendmessage(listbox1.handle,EM_EXLIMITTEXT,0, $7FFFFFF);
end;

you can try it but i doubt it work

Here the tip from Borland Techinfo help to show a messagebox with current selected line number:
 
 
procedure TMyForm.BitBtn1Click(Sender: TObject);
var
  iLine : Integer ;
begin
  iLine := Memo1.Perform(em_LineFromChar, $FFFF, 0);
 
  { Note: First line is zero }
  messageDlg('Line Number: ' + IntToStr(iLine), mtInformation,
              [mbOK], 0 ) ;
end;
 


caret position example:

var
  P: TPoint;
  I: Integer;
begin
  P := Point(x, y);
  I := LOWORD(Richedit1.Perform(EM_CHARFROMPOS, 0, Integer(@P)));
end;
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
GwenaAuthor Commented:
Wow inthe!

You really have come through with some great stuff for me to try out  :-)

So a richedit can hold more data huh?

I will have to play with this tomorrow (it's very late as I type this)

0
 
LischkeCommented:
Hi Gwena,

I'd strongly recommend NOT to use a rich edit. It is derived from the same class as TMemo (namely TCustomMemo) and is MUCH slower. You can get all you need here much easier. There's a totally rewritten edit control called mwEdit. I can't find the source link anymore, but can send you the sources if you give me your eMail address. Btw: This edit can syntax highlighting. I have improved this edit a lot and created my TSyntaxEdit, but it is not ready yet to be published, so take mwEdit for a while. Check my homepage (www.lischke-online.de) regulary to see when the new edit is out (I'm just working on it...).

Ciao, Mike
0
 
MotazCommented:
Hello Gewna,
 I advice you to use TRichEdit instead of TMemo,
in TRichEdit you can any thing that can be done with TMemo,
- TRichEdit can hold more text
- You can access line and column number using GetCaretPos which exists in Rich editor

Motaz
0
 
intheCommented:
yes mwedit is ok too
here is link from my database but it should still work:

http://www.eccentrica.org/gabr/mw/mwedit.htm

it has an amazing amount of syntax 's available ,i never worked with files that couldnt fit in richedit98 so i didnt realise there was such a speed difference but as always i bet mike is correct :-)
cheers Barry
0
 
LischkeCommented:
Barry, thanks for the link :-) My statement about the speed is not only based on file/lines loading (which is still ways too slow and might be as slow as TMemo, I haven't compared it), but also on experiences I made (also using RichEdit98 btw.). E.g. heavy flickering due to slow and unoptimized painting, buggy implementation (!) e.g. unicode and very uncomfortable handling regarding text formatting etc. But rich edit is close to a word processor and one has probably no other choice than using it...

Ciao, Mike
0
 
GwenaAuthor Commented:
Hi all :-)

Lischke... I eagerly await your TSyntaxEdit .... Thanks a bunch for the Mwedit info.. I went and got an exe demo and it looks
VERY good! ... I wonder what versions of delphi it works on..hmm I will find out I guess....  thanks inthe for the link :)



You guys have all been so much help I don't know who to give the 50 points to?

...Gwen..

0
 
LischkeCommented:
Hi Gwen,

my syntax edit will only work with D4 and up while mwEdit should do it also with D3...

Who you give the points is totally up to you, but I vote for Barry :-) as he acted fastest with good info.

Ciao, Mike
0
 
rarigoCommented:
Open the file dcr which came with that component you got at Torry's with ImageEditor and resave. You'll stop get that 16bit error.
0
 
GwenaAuthor Commented:
hi rarigo :)

Thanks!!  I will try that :)
0
 
GwenaAuthor Commented:
Thanks for all the great help inthe :-)


(and thanks to all the rest of you that made comments:- )
0
 
intheCommented:
No probs ;-)
0
All Courses

From novice to tech pro — start learning today.