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

📄 hexeditreg.pas

📁 === === === MiniHex 1.61 源程序说明 ============================== “$(MiniHex)Source”目录中的所有
💻 PAS
字号:
unit HexEditReg;

{$I Ver.inc}

interface

uses
  Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, Graphics;

procedure Register;

implementation

uses
  HexEdit,
{$IFDEF VER_COMPILER_6_UP}
  DesignIntf, DesignEditors;
{$ELSE}
  DsgnIntf;
{$ENDIF}

type

{ Property Editor }

  THexEditFontProperty = class(TClassProperty)
  public
    function GetAttributes: TPropertyAttributes; override;
    procedure Edit; override;
  end;

procedure Register;
begin
  RegisterComponents('DayDream', [THexEdit]);
  RegisterPropertyEditor(TypeInfo(TFont), THexEdit, 'Font', THexEditFontProperty);
end;

{ THexEditFontProperty }

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

procedure THexEditFontProperty.Edit;
var
  FontDialog: TFontDialog;
  AHexEdit: THexEdit;
begin
  AHexEdit := GetComponent(0) as THexEdit;
  FontDialog := TFontDialog.Create(Application);
  try
    FontDialog.Font := AHexEdit.Font;
    FontDialog.Options := FontDialog.Options + [fdFixedPitchOnly];
    if FontDialog.Execute then
    begin
      AHexEdit.Font := FontDialog.Font;
      AHexEdit.Invalidate;
      Modified;
    end;
  finally
    FontDialog.Free;
  end;
end;

end.

⌨️ 快捷键说明

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