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

📄 cxvgridreg.pas

📁 delphi的的三方控件
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{********************************************************************}
{                                                                    }
{       Developer Express Visual Component Library                   }
{       ExpressVerticalGrid                                          }
{                                                                    }
{       Copyright (c) 1998-2007 Developer Express Inc.               }
{       ALL RIGHTS RESERVED                                          }
{                                                                    }
{   The entire contents of this file is protected by U.S. and        }
{   International Copyright Laws. Unauthorized reproduction,         }
{   reverse-engineering, and distribution of all or any portion of   }
{   the code contained in this file is strictly prohibited and may   }
{   result in severe civil and criminal penalties and will be        }
{   prosecuted to the maximum extent possible under the law.         }
{                                                                    }
{   RESTRICTIONS                                                     }
{                                                                    }
{   THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES            }
{   (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE     }
{   SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS    }
{   LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL           }
{   ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. }
{                                                                    }
{   THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED       }
{   FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE         }
{   COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE        }
{   AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT   }
{   AND PERMISSION FROM DEVELOPER EXPRESS INC.                       }
{                                                                    }
{   CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON        }
{   ADDITIONAL RESTRICTIONS.                                         }
{                                                                    }
{********************************************************************}
unit cxVGridReg;

{$I cxVer.inc}

interface

procedure Register;

implementation

uses
{$IFDEF DELPHI6}
  DesignEditors, DesignIntf,
  {$IFDEF VCL}
    VCLEditors,
  {$ELSE}
    QTypes,
  {$ENDIF}
{$ELSE}
  DsgnIntf,
{$ENDIF}
  Classes, Controls, ImgList, cxScrollBar, cxVGrid, cxEdit, cxStyles,
  cxEditRepositoryItems, cxEditPropEditors, cxVGridEditor, cxClasses,
  cxInplaceContainerReg, cxPropEditors, DB, cxDBVGrid, cxOI, SysUtils, Forms,
  cxVGridPredefinedStyles, cxVGridLayoutEditor, TypInfo,
  cxVGridConverter, cxImportDialog;

const
  cxVGridVersion = '3.22';
  UnitNamePrefix = {$IFDEF VCL}''{$ELSE}'Q'{$ENDIF};
  DXWebPage = 'www.devexpress.com';

type
  TcxCustomRowAccess = class(TcxCustomRow);

  { TcxVerticalGridStylesEventsProperty }

  TcxVerticalGridStylesEventsProperty = class(TcxNestedEventProperty)
  protected
    function GetInstance: TPersistent; override;
  end;

  { TcxEditorRowPropertiesEventsProperty }

  TcxEditorRowPropertiesEventsProperty = class(TcxNestedEventProperty)
  protected
    function GetInstance: TPersistent; override;
  end;

  { TcxEditPropertiesEventsProperty }

  TcxEditPropertiesEventsProperty = class(TcxNestedEventProperty)
  protected
    function GetInstance: TPersistent; override;
  end;

  { TcxCollectionItemEditPropertiesEventsProperty }

  TcxCollectionItemEditPropertiesEventsProperty = class(TcxNestedEventProperty)
  protected
    function GetInstance: TPersistent; override;
  end;

  { TcxCustomRowImageIndexProperty }

  TcxCustomRowPropertiesImageIndexProperty = class(TImageIndexProperty)
  public
    function GetImages: TCustomImageList; override;
  end;

  { TcxVerticalGridComponentEditor }

  TcxVerticalGridComponentEditor = class(TComponentEditor)
  private
    function GetVerticalGrid: TcxCustomVerticalGrid;
  public
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
    property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid;
  end;

  { TcxRTTIInspectorComponentEditor }

  TcxRTTIInspectorComponentEditor = class(TComponentEditor)
  private
    function GetInspector: TcxCustomRTTIInspector;
  public
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
  end;

  { TcxDBVerticalGridItemDataBindingFieldNameProperty }

  TcxDBVerticalGridItemDataBindingFieldNameProperty = class(TFieldNameProperty)
  public
    function GetDataSource: TDataSource; override;
  end;

  { TcxOIPropertyEditor }

  TcxOIPropertyEditor = class(TPropertyEditor)
  public
    function GetAttributes: TPropertyAttributes; override;
    procedure GetValues(Proc: TGetStrProc); override;
    function GetValue: string; override;
    procedure SetValue(const Value: string); override;
  end;

{ TcxVerticalGridStylesEventsProperty }

function TcxVerticalGridStylesEventsProperty.GetInstance: TPersistent;
begin
  if (GetComponent(0) is TcxCustomVerticalGrid) then
    Result := TcxCustomVerticalGrid(GetComponent(0)).Styles
  else
    Result := nil;
end;

{ TcxEditorRowPropertiesEventsProperty }

function TcxEditorRowPropertiesEventsProperty.GetInstance: TPersistent;
begin
  if (GetComponent(0) is TcxCustomEditorRow) then
    Result := TcxCustomRowAccess(GetComponent(0)).FProperties
  else
    Result := nil;
end;

{ TcxEditPropertiesEventsProperty }

function TcxEditPropertiesEventsProperty.GetInstance: TPersistent;
begin
  if (GetComponent(0) is TcxCustomEditorRow) then
    Result := TcxCustomEditorRowProperties(TcxCustomRowAccess(GetComponent(0)).FProperties).EditProperties
  else
    Result := nil;
end;

{ TcxCollectionItemEditPropertiesEventsProperty }

function TcxCollectionItemEditPropertiesEventsProperty.GetInstance: TPersistent;
begin
  if (GetComponent(0) is TcxCollectionItemEditorRowProperties) then
    Result := TcxCollectionItemEditorRowProperties(GetComponent(0)).EditProperties
  else
    Result := nil;
end;

{ TcxCustomRowImageIndexProperty }

function TcxCustomRowPropertiesImageIndexProperty.GetImages: TCustomImageList;
begin
  if GetComponent(0) is TcxCustomRowProperties then
    Result := TcxCustomRowProperties(GetComponent(0)).Row.VerticalGrid.Images
  else
    Result := nil;
end;

{ TcxVerticalGridComponentEditor }

procedure TcxVerticalGridComponentEditor.ExecuteVerb(Index: Integer);
begin
  case Index of
    0: ShowVerticalGridEditor(Designer, VerticalGrid);
    1: ShowVerticalGridLayoutEditor(VerticalGrid,
      Format('Layout editor - %s', [VerticalGrid.Name]));
    2: if Component is TcxDBVerticalGrid then
         ShowImportDialog(Designer, Component, cxDBVGGroupConverterName, False)
       else if Component is TcxUnboundVerticalGrid then
         ShowImportDialog(Designer, Component, cxVGGroupConverterName, False);
    3: VerticalGrid.RestoreDefaults;
    6: OpenWebPage(DXWebPage);
  end;
end;

function TcxVerticalGridComponentEditor.GetVerb(Index: Integer): string;
begin
  case Index of
    0: Result := 'Edit...';
    1: Result := 'Layout editor...';
    2: Result := 'Import...';
    3: Result := 'Restore default values';
    4: Result := '-';
    5: Result := 'ExpressVerticalGrid ' + cxVGridVersion;
    6: Result := DXWebPage;
  end;
end;

function TcxVerticalGridComponentEditor.GetVerbCount: Integer;
begin
  Result := 7;
end;

function TcxVerticalGridComponentEditor.GetVerticalGrid: TcxCustomVerticalGrid;
begin
  Result := Component as TcxCustomVerticalGrid;
end;

⌨️ 快捷键说明

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