git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.PNGComponents@6 a60baaea-e768-c94d-9a73-13206b75eb30
52 lines
1.6 KiB
ObjectPascal
52 lines
1.6 KiB
ObjectPascal
unit PngComponentsRegister;
|
|
|
|
{$I ..\Include\Thany.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, {$IFDEF THANY_COMPILER_6_UP} DesignIntf {$ELSE} DsgnIntf {$ENDIF},
|
|
PngSpeedButton, PngBitBtn, PngImageList, PngCheckListBox, PngComponentEditors,
|
|
TypInfo;
|
|
|
|
procedure Register;
|
|
|
|
implementation
|
|
|
|
{$IFNDEF THANY_COMPILER_7_UP}
|
|
|
|
procedure UnlistPublishedProperty(ComponentClass: TClass; const PropertyName: string);
|
|
var
|
|
LPropInfo: PPropInfo;
|
|
begin
|
|
LPropInfo := GetPropInfo(ComponentClass, PropertyName);
|
|
if LPropInfo <> nil
|
|
then RegisterPropertyEditor(LPropInfo^.PropType^, ComponentClass, PropertyName, nil);
|
|
end;
|
|
|
|
{$ENDIF}
|
|
|
|
procedure Register;
|
|
begin
|
|
//Register all components
|
|
RegisterComponents('Png', [TPngSpeedButton, TPngBitBtn, TPngImageList, TPngImageCollection, TPngCheckListBox]);
|
|
|
|
//Register component editors
|
|
RegisterComponentEditor(TPngImageList, TPngImageListEditor);
|
|
RegisterComponentEditor(TPngImageCollection, TPngImageCollectionEditor);
|
|
RegisterComponentEditor(TPngBitBtn, TPngButtonEditor);
|
|
RegisterComponentEditor(TPngSpeedButton, TPngButtonEditor);
|
|
|
|
//Register property editors
|
|
RegisterPropertyEditor(TypeInfo(TPngImageCollectionItems), TPngImageList, 'PngImages', TPngImageListImagesEditor);
|
|
RegisterPropertyEditor(TypeInfo(TPngImageCollectionItems), TPngImageCollection, 'Items', TPngImageCollectionItemsEditor);
|
|
|
|
//Hide properties that should be omitted
|
|
UnlistPublishedProperty(TPngSpeedButton, 'NumGlyphs');
|
|
UnlistPublishedProperty(TPngSpeedButton, 'Glyph');
|
|
UnlistPublishedProperty(TPngBitBtn, 'NumGlyphs');
|
|
UnlistPublishedProperty(TPngBitBtn, 'Glyph');
|
|
end;
|
|
|
|
end.
|