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:
- [WayBack] Uwe Schuster on Twitter: “In order to remove the 10.1.2 Align editor do not register TAlignProperty. https://t.co/l6x8Db3lUw”
- [WayBack] Cxaoi-DXEAAMF03.jpg:large (820×518)
- [WayBack] No one asked for that very ugly and keyboard unfriendly Align editor in the Object Inspector and it is even not documented. – Uwe Schuster – Google+
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







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
jpluimers said
Thanks! I’ve updated the gist.