📄 iwhtmlde.pas
字号:
{***************************************************************************}
{ TMS IntraWeb Component Pack Pro }
{ for Delphi & C++Builder }
{ version 2.2 }
{ }
{ written by TMS Software }
{ copyright ?2002 - 2004 }
{ Email : info@tmssoftware.com }
{ Web : http://www.tmssoftware.com }
{ }
{ The source code is given as is. The author is not responsible }
{ for any possible damage done due to the use of this code. }
{ The component can be freely used in any application. The complete }
{ source code remains property of the author and may not be distributed, }
{ published, given or sold in any form as such. No parts of the source }
{ code can be included in any other component or application without }
{ written authorization of the author. }
{***************************************************************************}
unit IWHTMLDE;
{$I TMSDEFS.INC}
interface
uses
IWHTMLProp, Classes, Forms,Dialogs, Controls, Windows, TypInfo, Graphics,
Sysutils, IWPicCntnr,DesignIntf, DesignEditors;
//{$IFDEF DELPHI6_LVL}
// DesignIntf, DesignEditors
//{$ELSE}
//,DsgnIntf
//{$ENDIF}
type
TIWHTMLDefaultEditor = class(TDefaultEditor)
protected
// {$IFNDEF DELPHI6_LVL}
// procedure EditProperty(PropertyEditor: TPropertyEditor;var Continue, FreeEditor: Boolean); override;
// {$ELSE}
// procedure EditProperty(const Prop:IProperty; var Continue:Boolean); override;
// {$ENDIF}
public
function GetVerb(index:integer):string; override;
function GetVerbCount:integer; override;
procedure ExecuteVerb(Index:integer); override;
end;
TIWHTMLStringProperty = class(TClassProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure Edit; override;
procedure SetValue(const Value: String); override;
function GetValue: String; override;
end;
implementation
function TIWHTMLStringProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog];
end;
procedure TIWHTMLStringProperty.Edit;
var
HTMLEditor: THTMLEditor;
PropInfo: PPropInfo;
S: string;
i: Integer;
begin
HTMLEditor := THTMLEditor.Create(Application);
try
PropInfo:= typInfo.GetPropInfo(GetComponent(0).ClassInfo,'BaseDir');
if (PropInfo <> nil) then
HTMLEditor.HTMLStaticText1.BaseDir := GetStrProp(GetComponent(0),PropInfo);
PropInfo:= typInfo.GetPropInfo(GetComponent(0).ClassInfo,'DesignLive');
if (PropInfo <> nil) then
HTMLEditor.HTMLStaticText1.DesignLive := Boolean(GetOrdProp(GetComponent(0),PropInfo));
HTMLEditor.Memo1.Lines.Clear;
s := GetStrValue;
if s <> '' then
HTMLEditor.Memo1.Lines.Add(s);
if HTMLEditor.Showmodal = mrOK then
begin
s := '';
for i := 1 to HTMLEditor.Memo1.Lines.Count do
s := s + HTMLEditor.Memo1.Lines[i-1];
SetStrValue(s);
Designer.Modified;
end;
finally
HTMLEditor.Free;
end;
end;
procedure TIWHTMLStringProperty.SetValue(const Value: String);
begin
end;
function TIWHTMLStringProperty.GetValue: String;
begin
Result := '(HTMLString)';
end;
{ TIWHTMLDefaultEditor }
//{$IFDEF DELPHI6_LVL}
//procedure TIWHTMLDefaultEditor.EditProperty(const Prop:IProperty; var Continue:Boolean);
//{$ELSE}
//procedure TIWHTMLDefaultEditor.EditProperty(PropertyEditor: TPropertyEditor;
// var Continue, FreeEditor: Boolean);
//{$ENDIF}
//var
// PropName: string;
//begin
// {$IFDEF DELPHI6_LVL}
// PropName := Prop.GetName;
// {$ELSE}
// PropName := PropertyEditor.GetName;
// {$ENDIF}
// if (CompareText(PropName, 'HTMLTEXT') = 0) then
// begin
// {$IFDEF DELPHI6_LVL}
// Prop.Edit;
// {$ELSE}
// PropertyEditor.Edit;
// {$ENDIF}
// Continue := False;
// end;
//end;
procedure TIWHTMLDefaultEditor.ExecuteVerb(Index: integer);
var
compiler:string;
begin
case Index of
0: Edit;
1: begin
{$IFDEF VER130}
{$IFDEF BCB}
compiler:='C++Builder 5';
{$ELSE}
compiler:='Delphi 5';
{$ENDIF}
{$ENDIF}
{$IFDEF VER140}
{$IFDEF BCB}
compiler:='C++Builder 6';
{$ELSE}
compiler:='Delphi 6';
{$ENDIF}
{$ENDIF}
{$IFDEF VER150}
compiler:='Delphi 7';
{$ENDIF}
MessageDlg(Component.ClassName + ' for ' + Compiler + #13#10#13#10'?2002 - 2003 by TMS software'#13#10'http://www.tmssoftware.com',
mtInformation,[mbok],0);
end;
end;
end;
function TIWHTMLDefaultEditor.GetVerb(index: integer): string;
begin
Result := '';
case Index of
0:Result := 'HTML Editor';
1:Result := 'About';
end;
end;
function TIWHTMLDefaultEditor.GetVerbCount: integer;
begin
Result := 2;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -