E ai Pessoal,

Tenho essa classe... (abaixo)

Mas na paleta só aparece 1 dos componentes

o TedtNomeCondominio ...

alguem sabe como faço para aparecer os dois...

Valeu,

Thiago

///***Classe

unit Condominio;

interface

uses
  SysUtils, Classes, Controls, StdCtrls, DBCtrls, IBQuery, DB,
  IBDatabase, Graphics, Forms;

//TedtNomeCondominio

type
  TedtNomeCondominio = class(TDBLookupComboBox)
  private
    FOrder: String;
    FBancoDados: TIBDatabase;
    procedure SetOrder(const Value: String);
    procedure SetBancoDados(const Value: TIBDatabase);
  protected
   dsCondo : TDataSource;
   qCondo  : TIBQuery;
  public
   constructor Create(AOwner: TComponent); override;
   destructor Destroy; override;
   procedure Open;
  published
   property Order : String Read FOrder write SetOrder;
   property BancoDados : TIBDatabase read FBancoDados write SetBancoDados;
  end;

 //EdtCodCondominio

type
  TedtCodCondominio = class(TEdit)
  private
    FFantasia: TedtNomeCondominio;
    procedure SetFantasia(const Value: TedtNomeCondominio);

  protected
    procedure KeyPress(var Key: Char); override;
    procedure doExit; override;
  public
   constructor Create(AOwner: TComponent); override;
   destructor Destroy; override;
  published
   property Fantasia : TedtNomeCondominio read FFantasia write SetFantasia;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('ComponentesLCD', [TedtNomeCondominio]);
end;

{ TedtNomeCondominio }

constructor TedtNomeCondominio.Create(AOwner: TComponent);
begin
  inherited create(Aowner);

  ListField := 'FANTASIA';
  KeyField := 'CODCOND';

  //Comandos para Tabela
  FOrder := 'FANTASIA'; //DEFAULT

end;

destructor TedtNomeCondominio.Destroy;
begin
 inherited Destroy;

 qCondo.Free;
 dsCondo.Free;

end;

procedure TedtNomeCondominio.Open;
var
  i : Integer;
begin

 qCondo := TIBQuery.Create(nil);
 qCondo.Database := BancoDados;

 dsCondo := TDataSource.Create(nil);
 dsCondo.DataSet := qCondo;

 //Seta o Campo que vai buscar os Dados
 ListSource := dsCondo;

 with qCondo do
 begin
  Close;
  SQL.Clear;
  SQL.Add(' Select CODCOND, FANTASIA From CONDO ');
  SQL.Add(' Order by '+Order);
  Open;

  if RecordCount > 0 then
   for i := 0 to 5 do
    begin
     Next;
    end;

  First;

 end;


end;

procedure TedtNomeCondominio.SetBancoDados(const Value: TIBDatabase);
begin
  FBancoDados := Value;
end;

procedure TedtNomeCondominio.SetOrder(const Value: String);
begin
  FOrder := Value;
end;


{ TedtCodCondominio }

constructor TedtCodCondominio.Create(AOwner: TComponent);
begin
  inherited; create(Aowner);
  Text := '000';
  MaxLength :=  3;
  FFantasia := TedtNomeCondominio(Self);
end;

destructor TedtCodCondominio.Destroy;
begin

  inherited;
end;

procedure TedtCodCondominio.doExit;
begin
 inherited;
 if Trim(Text) = '' then
  Text := '000';
end;

procedure TedtCodCondominio.KeyPress(var Key: Char);
begin
 if NOT (Key in ['0'..'9',#8,#46]) then
  Key := #0

end;

procedure TedtCodCondominio.SetFantasia(const Value: TedtNomeCondominio);
begin
  FFantasia := Value;
end;

end.


[As partes desta mensagem que não continham texto foram removidas]

Responder a