Link to home
Start Free TrialLog in
Avatar of cvbn
cvbn

asked on

DHTMLEdit problem

//DHTMLEdit problem

//Problem is when I try to free DHTMLEdit !
//Problem is as You see DHTMLEdit1DisplayChanged procedure.
//Can You fix it ?

//Thanks.

procedure TMainForm1.DHTMLEdit1DisplayChanged(Sender: TObject);
var
  ovFontName, ovFontStyle, ovFontStyles,ovFontSize, ovInVar: OleVariant;
  FontNameStatus: DWORD;
  FontSizeStatus: DWORD;
  StyleNameStatus: DWORD;
  vo: OleVariant;
  pValue: OleVariant;
begin
sasadhtmleditmess:='Pass';
if sasaclosecommand<>'Close' then
begin
  if not (TObject(Componentlist[ICount]) is TDHTMLEdit) then
  exit;
if TDHTMLEdit(ComponentList[ICount]).DOM.selection.type_ = 'Text' then
try
  ToolButton39.Down := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_BOLD) and DECMDF_LATCHED) = DECMDF_LATCHED);
  ToolButton40.Down := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_ITALIC) and DECMDF_LATCHED) = DECMDF_LATCHED);
  ToolButton41.Down := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_UNDERLINE) and DECMDF_LATCHED) = DECMDF_LATCHED);

  ToolButton5.Enabled := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_UNDO) and DECMDF_ENABLED) = DECMDF_ENABLED);
  ToolButton15.Enabled := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_REDO) and DECMDF_ENABLED) = DECMDF_ENABLED);

if ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_GETFONTNAME) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontName := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETFONTNAME, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox1.Text:=ovFontName;
end;


if ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_GETFONTSIZE) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontSIZE := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETFONTSIZE, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox3.Text:=ovFontSize;
end;


ovFontStyles := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETBACKCOLOR, OLECMDEXECOPT_DODEFAULT, ovInVar);

//showmessage(ovFontStyles);//ColorDialog1.Color:=ovFontStyles;

ovFontStyles := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETFORECOLOR, OLECMDEXECOPT_DODEFAULT, ovInVar);

//ColorDialog2.Color:=ovFontStyles;
if ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_GETBLOCKFMT) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontStyle := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETBLOCKFMT, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox2.Text:=ovFontStyle;
end;
except
end;
end;
sasadhtmleditmess:='';

end;
ASKER CERTIFIED SOLUTION
Avatar of vbmn
vbmn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial