destructor TDBPanel.Destroy; begin FreeEditors; Inherited Destroy; end;
function TDBPanel.Editor(Index: Integer): TDBComboBox; begin if Index$#@60;Length(Editors) then Result := Editors[Index] else Result := nil; end;
procedure TDBPanel.FreeEditors; var i,n: Integer; begin
{ 内存的释放是要有顺序的!必须以创建的相反的顺序进行!尤其是当组件之间有父子关系时}
if OkButton$#@60;$#@62;nil then OkButton.Free; if Editors$#@60;$#@62;nil then begin n := Length(Editors); for i:=0 to n-1 do Editors[i].free; Editors := nil; n := Length(Labels); for i:=0 to n-1 do Labels[i].Free; Labels := nil; end;
if FScrollBox$#@60;$#@62;nil then begin FScrollBox.Free; FScrollBox := nil; end; end; end.