⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shinteditor.pas

📁 AlphaControls是一个Delphi标准控件的集合
💻 PAS
字号:
unit sHintEditor;
{$I sDefs.inc}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, sConst, ExtCtrls, sGraphUtils, sUtils, ImgList,
  Consts, ComStrs, CommCtrl, menus, sFUnit,
  {$IFDEF DELPHI5}dsgnintf, {$ELSE}DesignEditors, DesignIntf, VCLEditors, {$ENDIF}sHintManager;

type

  TsHintEditor = class(TComponentEditor)
  protected
  public
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
  end;

  TsHintsDesigner = class(TComponentProperty)
  public
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
    function GetValue: string; override;
  end;

  { Open window with editor of hint design }
procedure RunHintsDesigner(sHintManager : TsHintManager);

procedure Register;

implementation

{ TsHintEditor }

procedure RunHintsDesigner(sHintManager : TsHintManager);
var
  shm : TsHintManager;
  hw : THintWindowClass;
begin

  hw := HintWindowClass;
  CreateEditorForm;
  shm := GetHintManager;

  shm.Assign(sHintManager);

  OpenDesigner;

  sHintManager.Assign(shm);

  KillForm;

  HintWindowClass := hw;
//  Application.
end;

procedure TsHintEditor.ExecuteVerb(Index: Integer);
begin
  inherited;
  case Index of
    0: begin // Hints designer
      RunHintsDesigner(TsHintManager(Component));
    end;
  end;
  if Designer <> nil then Designer.Modified;
end;

function TsHintEditor.GetVerb(Index: Integer): string;
begin
  case Index of
    0:  result := '&Hints Designer...';
    1:  result := '-';
  end;
end;

function TsHintEditor.GetVerbCount: Integer;
begin
  Result := 2;
end;

procedure Register;
begin
  RegisterComponentEditor(TsHintManager, TsHintEditor);
  RegisterPropertyEditor(TypeInfo(integer), TsHintManager, 'HintsDesigner', TsHintsDesigner);
end;

{ TsHintsDesigner }

procedure TsHintsDesigner.Edit;
begin
  inherited;
  RunHintsDesigner(TsHintManager(GetComponent(0)));
end;

function TsHintsDesigner.GetAttributes: TPropertyAttributes;
begin
  Result := [paDialog, paReadOnly];
end;

function TsHintsDesigner.GetValue: string;
begin
  Result := ' ';
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -