Can't help with HTML editing, but if you do find a way please let me know.

ps: Can you send me some code or examples to use the MS DHTML editer
control....

But try this for getting and setting the RTF directly.

unit AdrockRichEdit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ComCtrls;

type
  TAdrockRichEdit = class(TRichEdit)
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
    Procedure SetRTFText(Str :String);
    Function GetRTFText : String;
  published
    { Published declarations }
    property RTFText : String
             Read  GetRTFText
             Write SetRTFText;
  end;

procedure Register;

implementation

Function TAdrockRichEdit.GetRTFText : String;
Var
  fStringList : TStringList;
  FMemoryStream : TMemoryStream;
Begin
  fStringList := TStringList.Create;
  try
    fMemoryStream := TMemoryStream.Create;
    try
      Lines.SaveToStream(fMemoryStream);
      fMemoryStream.Position := 0;
      fStringList.LoadfromStream(fmemoryStream);
      Result := fStringList.text;
    finally
      FMemoryStream.Free;
    end;
  finally
    fStringList.Free;
  end;
end;

Procedure TAdrockRichEdit.SetRTFText(Str :String);
Var
  fStringList : TStringList;
  FMemoryStream : TMemoryStream;
Begin
  fStringList := TStringList.Create;
  try
    fMemoryStream := TMemoryStream.Create;
    try
      PlainText := FALSE;
      Lines.BeginUpdate;
      try
        Lines.Clear;
        fStringList.Add(Str);
        fStringList.SaveToStream(fMemoryStream);
        fMemoryStream.Position := 0;
        Lines.LoadFromStream(fMemoryStream);
      finally
        Lines.EndUpdate;
      End;
    finally
      FMemoryStream.Free;
    end;
  finally
    fStringList.Free;
  end;
end;

procedure Register;
begin
  RegisterComponents('Adrock', [TAdrockRichEdit]);
end;

end.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Nic Wise
Sent: Tuesday, 8 February 2000 20:02
To: Multiple recipients of list delphi
Subject: [DUG]: HTML EDITING


Hi people,

does anyone do WYSIWYG HTML editing in their apps? If so, what do you use?
I'm currently using the MS DHTML editer control, which is MASSIVE overkill,
but it does work (just).

Anyone know of anything better? RichText with HTML->Richtext->HTML
converter??? (more to the point, anyone know how to get at the RichText
as-is in a richedit control!?!?)

Ta.

Nic.



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to