Componentes.Terceros.DevExp.../official/x.36/ExpressSkins Library/Sources/dxSkinsReg.pas
2008-06-02 17:37:37 +00:00

160 lines
5.2 KiB
ObjectPascal

{********************************************************************}
{ }
{ Developer Express Visual Component Library }
{ ExpressSkins Library }
{ }
{ Copyright (c) 2006-2008 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 EXPRESSSKINS 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 dxSkinsReg;
{$I cxVer.inc}
interface
uses
Windows, Classes, cxClasses, Forms,
{$IFDEF DELPHI6}
Types, DesignIntf, DesignEditors, VCLEditors,
{$ELSE}
DsgnWnds, DsgnIntf,
{$ENDIF}
SysUtils, TypInfo, cxLibraryReg, cxLookAndFeels, cxLookAndFeelPainters,
dxSkinsCore, dxSkinsLookAndFeelPainter, dxSkinsDefaultPainters, dxSkinsForm;
type
{ TdxSkinNameProperty }
TdxSkinNameProperty = class(TStringProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure GetValues(Proc: TGetStrProc); override;
end;
const
dxSkinsMajorVersion = '1';
dxSkinsProductName = 'ExpressSkins';
procedure Register;
implementation
uses
cxControls;
{ TdxSkinNameProperty }
function TdxSkinNameProperty.GetAttributes: TPropertyAttributes;
begin
Result := inherited GetAttributes - [paReadOnly] + [paValueList];
end;
procedure TdxSkinNameProperty.GetValues(Proc: TGetStrProc);
var
I: Integer;
begin
for I := 0 to GetExtendedStylePainters.Count - 1 do
Proc(GetExtendedStylePainters.Names[I]);
end;
type
{ TdxSkinControllerEditor }
TdxSkinControllerEditor = class(TcxComponentEditor)
protected
function GetProductMajorVersion: string; override;
function GetProductName: string; override;
public
procedure Edit; override;
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override;
end;
procedure TdxSkinControllerEditor.Edit;
begin
end;
procedure TdxSkinControllerEditor.ExecuteVerb(Index: Integer);
begin
case Index of
0:
begin
with TdxSkinController(Component) do
begin
Kind := cxDefaultLookAndFeelKind;
NativeStyle := cxDefaultLookAndFeelNativeStyle;
SkinName := '';
UseSkins := True;
end;
Designer.Modified;
end;
end;
end;
function TdxSkinControllerEditor.GetVerb(Index: Integer): string;
begin
case Index of
0: Result := 'Reset';
1: Result := '-';
else
Result := inherited GetVerb(Index);
end;
end;
function TdxSkinControllerEditor.GetVerbCount: Integer;
begin
Result := 1 + inherited GetVerbCount;
end;
function TdxSkinControllerEditor.GetProductMajorVersion: string;
begin
Result := dxSkinsMajorVersion;
end;
function TdxSkinControllerEditor.GetProductName: string;
begin
Result := dxSkinsProductName;
end;
procedure Register;
begin
IsDesigning := True;
{$IFDEF DELPHI9}
ForceDemandLoadState(dlDisable);
{$ENDIF}
RegisterComponents('Dev Express', [TdxSkinController]);
RegisterClasses([TdxSkinController]);
RegisterPropertyEditor(TypeInfo(TdxSkinName),
nil, 'SkinName', TdxSkinNameProperty);
RegisterComponentEditor(TdxSkinController, TdxSkinControllerEditor);
end;
end.