//为全部的集合属性注册一个统一的属性编辑器 function SetMapper(Obj: TPersistent; PropInfo: PPropInfo): TPropertyEditorClass; begin if PropInfo.PropType^.Kind = tkSet then Result := TSetPropertyEx else Result := nil; end;
procedure Register; begin RegisterPropertyEditor(TypeInfo(TFont), nil, '', TVisualFontProperty); RegisterPropertyEditor(TypeInfo(TGraphic), nil, '', TVisualGraphicProperty); RegisterPropertyEditor(TypeInfo(TComponentName), TComponent, 'Name', TBoldComponentNameProperty); RegisterPropertyEditor(TypeInfo(Boolean), nil, '', TBooleanPropertyEx); RegisterPropertyEditor(TypeInfo(ByteBool), nil, '', TBoolPropertyEx); RegisterPropertyEditor(TypeInfo(WordBool), nil, '', TBoolPropertyEx); RegisterPropertyEditor(TypeInfo(LongBool), nil, '', TBoolPropertyEx); RegisterPropertyMapper(SetMapper); end;
|