I've added numbering support to my application, and after SaveTo/LoadFrom stream it should look like this:
Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
Line 6
Line 7
But this happens:
Loaded first time:
Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
4. Line 6
Line 7
Loaded second time:
Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
4. 4. Line 6
Line 7
Loaded third time:
Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
4. 4. 4. Line 6
Line 7
And so on...
And please, telling me how to remove this bug in RICHED32.DLL whould be nice, but, i really want a newer version of TRichEdit.
And... I don't want links to components, the componenet should be self-written or built into delphi.
It is fairly simple to write a TRichedit descendent that loads Riched20.
unit pbRichEdit20;
interface
uses
SysUtils, Classes, Controls, StdCtrls, ComCtrls;
type
TPBRichEdit20 = class(TRichEdit)
protected
Procedure CreateParams( Var params: TCreateParams ); override;
end;
procedure Register;
implementation
uses windows, richedit;
procedure Register;
begin
RegisterComponents('PBGoodies', [TPBRichEdit20]);
end;
{ TPBRichEdit20 }
Var
FRichEditModule: THandle;
procedure TPBRichEdit20.CreateParams(var params: TCreateParams);
const
RichEditModuleName = 'RICHED20.DLL';
begin
if FRichEditModule = 0 then
begin
FRichEditModule := LoadLibrary(RichEditModuleName);
if FRichEditModule <= HINSTANCE_ERROR then FRichEditModule := 0;
end;
inherited CreateParams(Params);
CreateSubClass(Params, RICHEDIT_CLASS);
params.WindowClass.style := params.WindowClass.style and not (CS_HREDRAW or CS_VREDRAW);
end;
initialization
finalization
if FRichEditModule <> 0 then FreeLibrary(FRichEditModule);
end.
> And... I don't want links to components, the componenet should be self-written or
> built into delphi.
The above gives you a V2 or 3 richedit, but to access features not available in
V1 you need to use API methods (send messages to the control). A more complete
wrapper that exposes the new features as methods and properties can be found
in the JEDI VCL (see http://sourceforge.net/jvcl ). Comes with full source and is
free.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be