Quantcast
Channel: Delphi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 1445

Actual source for DisableAlignPropertyEditor

$
0
0

Since Uwe Schuster only published a screenshot, I NewOCR-ed it and created the accompanying .dproj file (only because it’s an easy way for the DLL to require the designide package so you can use the DesignIntf and ToolsAPI units.

Uwe only posted these:

Anyway, the sources are at gist.github.com/881d4eacbcec2a9e1e6b0181f900fd7a, but the main source is this:

library DisableAlignPropertyEditor;

{
  Originally only as jpg image by Uwe Schuster.

  https://web.archive.org/web/20161117154454/https://pbs.twimg.com/media/Cxaoi-DXEAAMF03.jpg:large
  https://web.archive.org/web/20161117154450/https:/twitter.com/UScLE/status/799011392703647744
  https://web.archive.org/web/20161117154501/https://plus.google.com/107811538224738992137/posts/hTXUwkCe1TV
}

uses
  System.SysUtils,
  System.TypInfo,
  DesignIntf,
  ToolsAPI;

var
  LastRegisterPropertyEditorProc: TRegisterPropertyEditorProc = nil;

procedure NewRegisterPropertyEditor(PropertyType: PTypeInfo; ComponentClass: TClass; const PropertyName: string; EditorClass: TPropertyEditorClass);
begin
  if Assigned(EditorClass) then
  begin
    if SameText('TAlignProperty', EditorClass.ClassName) then
      Exit;
  end;
  LastRegisterPropertyEditorProc(PropertyType, ComponentClass, PropertyName, EditorClass);
end;

procedure wizardTerminate;
begin
  RegisterPropertyEditorProc := LastRegisterPropertyEditorProc;
end;

function wizardInit(const BorlandIDEServices: IBorlandIDEServices; RegisterProc: TWizardRegisterProc; var Terminate: TWizardTerminateProc): Boolean; stdcall;
begin
  LastRegisterPropertyEditorProc := RegisterPropertyEditorProc;
  RegisterPropertyEditorProc := NewRegisterPropertyEditor;
  Terminate := wizardTerminate;
  Result := True;
end;

exports
  wizardInit name WizardEntryPoint;

begin
end.

–jeroen


Filed under: Delphi, Delphi 10.1 Berlin (BigBen), Development, Software Development

Viewing all articles
Browse latest Browse all 1445

Trending Articles