Componentes.Terceros.PNGCom.../internal/1.0 RC3/1/Design/PngComponentsRegister.pas
2007-08-17 16:17:18 +00:00

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.