The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,714 other followers

Actual source for DisableAlignPropertyEditor

Posted by jpluimers on 2016/11/30

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

2 Responses to “Actual source for DisableAlignPropertyEditor”

  1. Fritz said

    you should change the

    procedure NewRegisterPropertyEditor(PropertyType: PTypeInfo; ComponentClass: TClass; const PropertyName: string; EditorClass: TPropertyEditorClass);
    begin
    if EditorClass <> nil then
    begin
    if not SameText(‘TAlignProperty’, EditorClass.ClassName) then
    LastRegisterPropertyEditorProc(PropertyType, ComponentClass, PropertyName, EditorClass);
    end
    else
    LastRegisterPropertyEditorProc(PropertyType, ComponentClass, PropertyName, EditorClass);
    end;

    because the EditorClass can be nil
    greetings Fritz

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: