Конференция "Компоненты" » Не отображается редактор TCollection
 
  • Strangermx (17.10.12 12:08) [0]
    Доброго времени. Не могу понять что не так.


    unit UDocOper;

    interface

    uses
     messages,dialogs,SysUtils, adodb,db, windows, forms,Classes, Controls, cxControls, cxPC;

    type
    TopParametr = class (TCollectionItem)
    private
      FDate: TDateTime;
      FCaption: string;
      FImageIndex: Integer;
      procedure SetCaption(const Value: string);
    published
      property Caption: string read FCaption write SetCaption;
    end;

    // ---------------   тип операции документа (новый, редактирование) -----------
    Type
     TTypeOperation=class (TPersistent)
     private
       FProcedureName:String;
       FParametrs:TCollection;
       Procedure SetParametrs(const Value: TCollection);
     public
        destructor Destroy; override;
        constructor Create(AOwner: TComponent);
     published
       property ProcedureName:string read FProcedureName write FProcedureName;
       property Parametrs:TCollection read FParametrs write FParametrs;

    end;

    //---------------------  форма документа ---------------------------------------
    type
     TDocumentOperation = class(TComponent)
     private
       FopInsert:TTypeOperation;
       Procedure Setpoperation(value:TTypeOperation);
     protected
     public
       constructor Create(AOwner: TComponent); override;
       destructor Destroy; override;
     published
       property opInsert:TTypeOperation read FopInsert write Setpoperation;
     end;

    procedure Register;

    implementation

    procedure Register;
    begin
     RegisterComponents('CxDataControls', [TDocumentOperation]);
    end;

    { TTypeOperations }

    procedure TopParametr.SetCaption(const Value: string);
    begin
    FCaption := Value;
    end;

    ////////////////////////////////////////////////////////////////////////////////
    constructor TTypeOperation.Create(AOwner: TComponent);
    begin
      FParametrs:=TOwnedCollection.Create(Self, TopParametr);

    end;

    destructor TTypeOperation.Destroy;
    begin
     inherited;
      FreeAndNil(FParametrs);
    end;

    procedure TTypeOperation.SetParametrs(const Value: TCollection);
    begin
    FParametrs.Assign(Value);
    end;

    { TDocumentOperations }

    constructor TDocumentOperation.Create(AOwner: TComponent);
    begin
     inherited;
      FopInsert:=TTypeOperation.Create(self);
    end;

    destructor TDocumentOperation.Destroy;
    begin
     inherited;
     FreeAndNil(FopInsert);
    end;

    procedure TDocumentOperation.Setpoperation(value: TTypeOperation);
    begin
     FopInsert:=value;
    end;

    end.



    В итоге при инсталяции компонента у свойства Parametrs не отображается редактор
  • DimaBr © (18.10.12 08:49) [1]

    TTypeOperation=class (TPersistent)
    private
      FProcedureName:String;
      FParametrs:TCollection;
      fOwner: TPersistent;
      Procedure SetParametrs(const Value: TCollection);
    public
       destructor Destroy; override;
       constructor Create(AOwner: TComponent);
       function GetOwner: TPersistent;override;
    published
      property ProcedureName:string read FProcedureName write FProcedureName;
      property Parametrs:TCollection read FParametrs write FParametrs;
    end;

    constructor TTypeOperation.Create(AOwner: TComponent);
    begin
     inherited Create;
     fOwner := AOwner;
     FParametrs:=TOwnedCollection.Create(Self, TopParametr);
    end;

    function TTypeOperation.GetOwner: TPersistent;
    begin
     Result := fOwner;
    end;

  • Strangermx (19.10.12 06:55) [2]
    спасибо
 
Конференция "Компоненты" » Не отображается редактор TCollection
Есть новые Нет новых   [118608   +43][b:0][p:0.002]