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

📄 petag.pas

📁 Delphi高级开发指南是开发程序的好帮手
💻 PAS
字号:
unit PeTag;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages,
  Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, DsgnIntf;

type
  TTagMultiProperty = class (TIntegerProperty)
  public
    function GetAttributes: TPropertyAttributes; override;
    procedure Edit; override;
  end;

procedure Register;

implementation

uses
  PefTag;

{property editor methods}

function TTagMultiProperty.GetAttributes:
  TPropertyAttributes;
begin
  Result := [paDialog, paMultiSelect];
end;

procedure TTagMultiProperty.Edit;
var
  PeForm: TTagForm;
begin
  PeForm := TTagForm.Create (Application);
  PeForm.Pe := self;
  try
    // update the list
    PeForm.UpdateList;
    // select and show the first item
    PeForm.ListBoxTags.ItemIndex := 0;
    PeForm.ListBoxTagsClick (self);
    // show the form
    PeForm.ShowModal;
  finally
    PeForm.Free;
  end;
end;

procedure Register;
begin
  RegisterPropertyEditor (TypeInfo(LongInt),
    TComponent, 'Tag', TTagMultiProperty);
end;

end.

⌨️ 快捷键说明

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