git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.DevExpressVCL@21 05c56307-c608-d34a-929d-697000501d7a
104 lines
2.9 KiB
ObjectPascal
104 lines
2.9 KiB
ObjectPascal
unit dxRibbonGalleryReg;
|
|
|
|
{$I cxVer.inc}
|
|
|
|
interface
|
|
|
|
procedure Register;
|
|
|
|
implementation
|
|
|
|
uses
|
|
{$IFDEF DELPHI6}
|
|
DesignIntf, DesignEditors,
|
|
{$ELSE}
|
|
DsgnIntf,
|
|
{$ENDIF}
|
|
Classes, Graphics, ImgList, dxBar, cxLibraryReg, dxBarReg, dxRibbonGallery,
|
|
cxPropEditors, Controls, dxRibbonGalleryFilterEd;
|
|
|
|
type
|
|
{ TdxRibboGalleryImageIndexProperty }
|
|
|
|
TdxRibbonGalleryImageIndexProperty = class(TImageIndexProperty)
|
|
private
|
|
function GetGroup: TdxRibbonGalleryGroup;
|
|
protected
|
|
property Group: TdxRibbonGalleryGroup read GetGroup;
|
|
public
|
|
function GetImages: TCustomImageList; override;
|
|
end;
|
|
|
|
{ TdxRibbonGalleryFilterGroupsProperty }
|
|
|
|
TdxRibbonGalleryFilterGroupsProperty = class(TClassProperty)
|
|
protected
|
|
function GetAttributes: TPropertyAttributes; override;
|
|
function FilterCategory: TdxRibbonGalleryFilterCategory;
|
|
public
|
|
procedure Edit; override;
|
|
end;
|
|
|
|
TdxRibbonGalleryGroupAccess = class(TdxRibbonGalleryGroup);
|
|
|
|
{ TdxRibboGalleryImageIndexProperty }
|
|
|
|
function TdxRibbonGalleryImageIndexProperty.GetImages: TCustomImageList;
|
|
begin
|
|
Result := TdxRibbonGalleryGroupAccess(Group).Images;
|
|
end;
|
|
|
|
function TdxRibbonGalleryImageIndexProperty.GetGroup: TdxRibbonGalleryGroup;
|
|
begin
|
|
Result := (GetComponent(0) as TdxRibbonGalleryGroupItem).Group;
|
|
end;
|
|
|
|
{ TdxRibbonGalleryFilterGroupsProperty }
|
|
|
|
procedure TdxRibbonGalleryFilterGroupsProperty.Edit;
|
|
begin
|
|
with TfmGalleryFilterGroups.Create(nil) do
|
|
try
|
|
Init(FilterCategory);
|
|
if ShowModal = mrOk then
|
|
begin
|
|
Apply(FilterCategory);
|
|
dxBarDesignerModified(FilterCategory.GalleryItem.BarManager);
|
|
end;
|
|
finally
|
|
Free;
|
|
end;
|
|
end;
|
|
|
|
function TdxRibbonGalleryFilterGroupsProperty.GetAttributes: TPropertyAttributes;
|
|
begin
|
|
Result := [paDialog, paReadOnly{$IFDEF DELPHI9}, paValueEditable{$ENDIF}];
|
|
end;
|
|
|
|
function TdxRibbonGalleryFilterGroupsProperty.FilterCategory: TdxRibbonGalleryFilterCategory;
|
|
begin
|
|
Result := TdxRibbonGalleryFilterCategoryGroups(GetOrdValue).FilterCategory;
|
|
end;
|
|
|
|
procedure Register;
|
|
begin
|
|
RegisterComponents('ExpressBars', [TdxRibbonDropDownGallery]);
|
|
RegisterNoIcon([TdxRibbonGalleryItem]);
|
|
|
|
RegisterPropertyEditor(TypeInfo(TBitmap), TdxRibbonGalleryGroupItem,
|
|
'Glyph', TcxBitmapProperty);
|
|
RegisterPropertyEditor(TypeInfo(TImageIndex), TdxRibbonGalleryGroupItem,
|
|
'ImageIndex', TdxRibbonGalleryImageIndexProperty);
|
|
RegisterPropertyEditor(TypeInfo(TdxBarItemLinks), TdxRibbonGalleryItem,
|
|
'ItemLinks', TdxBarItemLinksPropertyEditor);
|
|
RegisterPropertyEditor(TypeInfo(TList), TdxRibbonGalleryFilterCategory,
|
|
'Groups', TdxRibbonGalleryFilterGroupsProperty);
|
|
HideClassProperties(TdxRibbonGalleryItem, ['Detachable', 'DetachingBar',
|
|
'OnDetaching']);
|
|
HideClassProperties(TdxRibbonDropDownGallery, ['BackgroundBitmap',
|
|
'BarManager', 'UseRecentItems']);
|
|
HideClassProperties(TdxRibbonGalleryOptions, ['ShowScrollBar']);
|
|
end;
|
|
|
|
end.
|