⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dxribbongallery.pas

📁 胜天进销存源码,国产优秀的进销存
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    property ItemImageSize;
    property ItemTextKind;
    property ItemSize;
    property ItemPullHighlighting;
    property SpaceAfterGroupHeader;
    property SpaceBetweenItemCaptionAndDescription;
    property SpaceBetweenItemImageAndText;
    property SpaceBetweenItemsHorizontally;
    property SpaceBetweenItemsVertically;
  end;

  { TdxRibbonGalleryOptions }

  TdxRibbonGalleryOptions = class(TdxRibbonGalleryCustomOptions)
  private
    FCanCollapse: Boolean;
    FCollapsed: Boolean;
    FColumnCount: Integer;
    FEqualItemSizeInAllGroups: Boolean;
    FItemAllowDeselect: Boolean;
    FItemSelectionMode: TdxRibbonGalleryItemSelectionMode;
    FMinColumnCount: Integer;
    FRowCount: Integer;
    FShowScrollbar: Boolean; // deprecated
    FSpaceBetweenGroups: Integer;
    FSpaceBetweenItemsAndBorder: Integer;
    FSubMenuResizing: TdxRibbonGallerySubMenuResizing;
    procedure SetCanCollapse(Value: Boolean);
    procedure SetCollapsed(Value: Boolean);
    procedure SetColumnCount(Value: Integer);
    procedure SetSpaceBetweenGroups(Value: Integer);
    procedure SetEqualItemSizeInAllGroups(Value: Boolean);
    procedure SetItemSelectionMode(Value: TdxRibbonGalleryItemSelectionMode);
    procedure SetMinColumnCount(Value: Integer);
    procedure SetRowCount(Value: Integer);
    procedure SetSpaceBetweenItemsAndBorder(Value: Integer);
  public
    constructor Create(AOwner: TdxRibbonGalleryItem);
    procedure Assign(Source: TPersistent); override;
  published
    property CanCollapse: Boolean read FCanCollapse write SetCanCollapse default True;
    property Collapsed: Boolean read FCollapsed write SetCollapsed default False;
    property ColumnCount: Integer read FColumnCount write SetColumnCount
      default dxRibbonGalleryDefaultColumnCount;
    property EqualItemSizeInAllGroups: Boolean read FEqualItemSizeInAllGroups
      write SetEqualItemSizeInAllGroups default True;
    property Images;
    property ItemAllowDeselect: Boolean read FItemAllowDeselect
      write FItemAllowDeselect default False;
    property ItemImagePosition;
    property ItemImageSize;
    property ItemSelectionMode: TdxRibbonGalleryItemSelectionMode
      read FItemSelectionMode write SetItemSelectionMode default gsmSingle;
    property ItemSize;
    property ItemPullHighlighting;
    property ItemTextKind;
    property MinColumnCount: Integer read FMinColumnCount
      write SetMinColumnCount default dxRibbonGalleryMinColumnCount;
    property RowCount: Integer read FRowCount write SetRowCount default 0;
    property ShowScrollbar: Boolean read FShowScrollbar write FShowScrollbar stored False; // deprecated
    property SpaceAfterGroupHeader;
    property SpaceBetweenGroups: Integer read FSpaceBetweenGroups
      write SetSpaceBetweenGroups default 0;
    property SpaceBetweenItemCaptionAndDescription;
    property SpaceBetweenItemImageAndText;
    property SpaceBetweenItemsHorizontally;
    property SpaceBetweenItemsVertically;
    property SpaceBetweenItemsAndBorder: Integer read FSpaceBetweenItemsAndBorder
      write SetSpaceBetweenItemsAndBorder default 1;
    property SubMenuResizing: TdxRibbonGallerySubMenuResizing read FSubMenuResizing
      write FSubMenuResizing default gsrWidthAndHeight;
  end;

  { TdxRibbonGalleryGroupHeader }

  TdxRibbonGalleryGroupHeader = class(TPersistent)
  private
    FAlignment: TAlignment;
    FCaption: string;
    FOwner: TdxRibbonGalleryGroup;
    FVisible: Boolean;
    procedure SetAlignment(Value: TAlignment);
    procedure SetCaption(const Value: string);
    procedure SetVisible(Value: Boolean);
  protected
    procedure Changed;
  public
    constructor Create(AOwner: TdxRibbonGalleryGroup);
    procedure Assign(Source: TPersistent); override;
  published
    property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
    property Caption: string read FCaption write SetCaption;
    property Visible: Boolean read FVisible write SetVisible default False;
  end;

  { TdxRibbonGalleryGroupItem }

  TdxRibbonGalleryGroupItem = class(TCollectionItem)
  private
    FActionLink: TdxRibbonGalleryGroupItemActionLink;
    FCaption: string;
    FDescription: string;
    FGlyph: TBitmap;
    FImageIndex: TImageIndex;
    FSelected: Boolean;
    FTag: TcxTag;
    FOnClick: TNotifyEvent;
    procedure DoActionChange(Sender: TObject);
    function GetAction: TBasicAction;
    function GetGalleryItem: TdxRibbonGalleryItem;
    function GetGroup: TdxRibbonGalleryGroup;
    function GetSelected: Boolean;
    function GetSelectionMode: TdxRibbonGalleryItemSelectionMode;
    procedure GlyphChanged(Sender: TObject);
    function IsCaptionStored: Boolean;
    function IsDesigning: Boolean;
    function IsImageIndexStored: Boolean;
    function IsOnClickStored: Boolean;
    function IsSelectedStored: Boolean;
    procedure Notification(AComponent: TComponent; Operation: TOperation);
    procedure SetAction(Value: TBasicAction);
    procedure SetCaption(const Value: string);
    procedure SetDescription(const Value: string);
    procedure SetGlyph(Value: TBitmap);
    procedure SetImageIndex(Value: TImageIndex);
    procedure SetSelected(Value: Boolean);
  protected
    procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); dynamic;
    procedure DoClick; dynamic;
    procedure DrawImage(DC: HDC; const ARect: TRect);
    function GetActionLinkClass: TdxRibbonGalleryGroupItemActionLinkClass; dynamic;
    function GetImageSize: TSize;
    function IsImageAssigned: Boolean;
    property GalleryItem: TdxRibbonGalleryItem read GetGalleryItem;
    property LoadedSelected: Boolean read FSelected write FSelected;
    property SelectionMode: TdxRibbonGalleryItemSelectionMode read GetSelectionMode;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    property Group: TdxRibbonGalleryGroup read GetGroup;
  published
    property Action: TBasicAction read GetAction write SetAction;
    property Caption: string read FCaption write SetCaption stored IsCaptionStored;
    property Description: string read FDescription write SetDescription;
    property Glyph: TBitmap read FGlyph write SetGlyph;
    property ImageIndex: TImageIndex read FImageIndex write SetImageIndex
      stored IsImageIndexStored default -1;
    property Selected: Boolean read GetSelected write SetSelected
      stored IsSelectedStored default False;
    property Tag: TcxTag read FTag write FTag default 0;
    property OnClick: TNotifyEvent read FOnClick write FOnClick stored IsOnClickStored;
  end;

  { TdxRibbonGalleryGroupItems }

  TdxRibbonGalleryGroupItems = class(TCollection)
  private
    FGroup: TdxRibbonGalleryGroup;
    function GetItem(Index: Integer): TdxRibbonGalleryGroupItem;
    procedure SetItem(Index: Integer; Value: TdxRibbonGalleryGroupItem);
  protected
    function GetOwner: TPersistent; override;
    procedure Update(Item: TCollectionItem); override;

    property Group: TdxRibbonGalleryGroup read FGroup;
  public
    constructor Create(AGroup: TdxRibbonGalleryGroup); virtual;
    function Add: TdxRibbonGalleryGroupItem;
    function Insert(Index: Integer): TdxRibbonGalleryGroupItem;
    property Items[Index: Integer]: TdxRibbonGalleryGroupItem read GetItem write SetItem; default;
  end;

  { TdxRibbonGalleryGroup }

  TdxRibbonGalleryGroup = class(TCollectionItem)
  private
    FHeader: TdxRibbonGalleryGroupHeader;
    FItems: TdxRibbonGalleryGroupItems;
    FOptions: TdxRibbonGalleryGroupOptions;
    FVisible: Boolean;
    function GetGalleryItem: TdxRibbonGalleryItem;
    function GetImages: TCustomImageList;
    procedure ImagesChange(Sender: Tobject);
    procedure Notification(AComponent: TComponent; Operation: TOperation);
    procedure NotifyItems(AComponent: TComponent; Operation: TOperation);
    procedure SetHeader(Value: TdxRibbonGalleryGroupHeader);
    procedure SetItems(Value: TdxRibbonGalleryGroupItems);
    procedure SetOptions(Value: TdxRibbonGalleryGroupOptions);
    procedure SetVisible(Value: Boolean);
  protected
    property Images: TCustomImageList read GetImages;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;

    property GalleryItem: TdxRibbonGalleryItem read GetGalleryItem;
  published
    property Header: TdxRibbonGalleryGroupHeader read FHeader write SetHeader;
    property Items: TdxRibbonGalleryGroupItems read FItems write SetItems;
    property Options: TdxRibbonGalleryGroupOptions read FOptions write SetOptions;
    property Visible: Boolean read FVisible write SetVisible default True;
  end;

  { TdxRibbonGalleryGroups }

  TdxRibbonGalleryGroups = class(TCollection)
  private
    FGalleryItem: TdxRibbonGalleryItem;
    function GetItem(Index: Integer): TdxRibbonGalleryGroup;
    procedure RemoveFromFilter(AItem: TCollectionItem);
    procedure SetItem(Index: Integer; Value: TdxRibbonGalleryGroup);
  protected
    function GetOwner: TPersistent; override;
    procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); override;
    procedure Update(Item: TCollectionItem); override;
    property GalleryItem: TdxRibbonGalleryItem read FGalleryItem;
  public
    constructor Create(AGalleryItem: TdxRibbonGalleryItem); virtual;
    function Add: TdxRibbonGalleryGroup;
    function Insert(Index: Integer): TdxRibbonGalleryGroup;
    property Items[Index: Integer]: TdxRibbonGalleryGroup read GetItem write SetItem; default;
  end;

  { TdxRibbonGalleryFilterCategoryGroups }

  TdxRibbonGalleryFilterCategoryGroups = class(TList)
  private
    FFilterCategory: TdxRibbonGalleryFilterCategory;
    function CanAddGroup(AGroup: TdxRibbonGalleryGroup): Boolean;
    function GetItem(Index: Integer): TdxRibbonGalleryGroup;
  protected
    procedure Notify(Ptr: Pointer; Action: TListNotification); override;
  public
    constructor Create(AFilterCategory: TdxRibbonGalleryFilterCategory);
    procedure Assign(ASource: TdxRibbonGalleryFilterCategoryGroups);
    function Add(AGroup: TdxRibbonGalleryGroup): Integer;
    procedure Insert(AIndex: Integer; AGroup: TdxRibbonGalleryGroup);
    property FilterCategory: TdxRibbonGalleryFilterCategory read FFilterCategory;
    property Items[Index: Integer]: TdxRibbonGalleryGroup read GetItem; default;
  end;

  { TdxRibbonGalleryFilterCategory }

  TdxRibbonGalleryFilterCategory = class(TCollectionItem)
  private
    FCaption: string;
    FGroups: TdxRibbonGalleryFilterCategoryGroups;
    function GetGalleryItem: TdxRibbonGalleryItem;
    procedure ReadCategoryGroups(AReader: TReader);
    procedure WriteCategoryGroups(AWriter: TWriter);
  protected
    procedure DefineProperties(Filer: TFiler); override;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    property GalleryItem: TdxRibbonGalleryItem read GetGalleryItem;
  published
    property Caption: string read FCaption write FCaption;
    property Groups: TdxRibbonGalleryFilterCategoryGroups read FGroups stored False;
  end;

  { TdxRibbonGalleryFilterCategories }

  TdxRibbonGalleryFilterCategories = class(TCollection)
  private
    FGalleryFilter: TdxRibbonGalleryFilter;
    function GetItem(Index: Integer): TdxRibbonGalleryFilterCategory;
    procedure SetItem(Index: Integer; Value: TdxRibbonGalleryFilterCategory);
  protected
    procedure DeleteGroup(AGroup: TdxRibbonGalleryGroup);
    function GetOwner: TPersistent; override;
    procedure Update(Item: TCollectionItem); override;

    property GalleryFilter: TdxRibbonGalleryFilter read FGalleryFilter;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -