delphi 编辑html,Delphi HTML Editor

29134890_1.png

Welcome to Delphi Dev HTML Editor

What is Delphi Dev HTML Editor ?

It is a component wrapper for TWebBrowser component, exposing “hidden” functionality of Microsoft IE.

Essentially is a text editor that produces HTML.

With it you can load HTML from a file , from clipboard or write your own as if you were writing inside a memo, edit it, format it and save it.

HTML editor has an data-aware version which can be used in database related applications.

29134890_2.png

As requested here you can download the demo source code.

I

tried the example shipped with your component but when I click on

“bold” or “center” button nothing happens. I tried to re-compile the

example but still nothing.

Am I doing anything wrong or is there a bug ?

Many thanks

Al

29134890_3 delphidev

Posted August 7, 2012 at 6:09 AM

Hi Al,

there is a possibility that the demo project has a bug.

Due to lack of time, i am unable at the moment to take a look. Sorry

29134890_4.gif

Maybe if you fix it you can post your fix here.

Thanks.

29134890_5 Al

Posted August 12, 2012 at 2:20 PM

I solved this too. The TddHTMLEditor.InternalOnActionExecute was incomplete: the full source is the following:

procedure TddHTMLEditor.InternalOnActionExecute(Sender: TObject);

var

ACmd : TddHTMLEditorCommand;

Idx : Integer;

ClrDlg : TColorDialog;

begin

Idx := FCommandList.IndexOfObject(Sender);

if Idx >= 0 then

begin

ACmd := TddHTMLEditorCommand(Idx);

case ACmd of

hecBulletList : Self.BulletList;

hecCopy : Self.Copy;

hecPaste : Self.Paste;

hecCut : Self.Cut;

hecRedo : Self.Redo;

hecUndo : Self.Undo;

hecForegroundColor,hecBackGroundColor:

begin

ClrDlg := TColorDialog.Create(nil);

try

ClrDlg.Options := [cdFullOpen,cdAnyColor];

if ClrDlg.Execute then

begin

Self.DoExecuteCommand(HTMLEditorCommands[Acmd],False,ClrDlg.Color);

// Self.SetForegroundColor(ClrDlg.Color);

end;

finally

FreeAndNil(ClrDlg);

end;

end;

hecSearch : Self.Search;

hecIdentLeft : Self.IdentLeft;

hecIdentRight : Self.IdentRight;

hecInsertImage : Self.InsertImage;

hecCreateLink : Self.CreateLink;

hecInsertTable : Self.InsertTable;

hecItalic : Self.Italic;

hecBold : Self.Bold;

hecNumberedList : Self.NumberedList;

hecUnderLine : Self.UnderLine;

hecAlignLeft : Self.AlignLeft;

hecAlignCenter : Self.AlignCenter;

hecAlignRight : Self.AlignRight;

end;

end;

end;

I have tried ti connect the data aware version to the Devart PostgreSQL DAC but it doesn’t show the field.

Anybody knows why ?

solved the Devart PostgreSQL DAC issue. As PostgreSQL has no BLOB

field type you have to amend the following line in

TddDBHTMLEditor.DataChange:

FROM if (Assigned(Self.Field)) and (Field.IsBlob) and (not FFromSave) then

TO if (Assigned(Self.Field)) and (not FFromSave) then

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值