Ver Mensaje Individual
  #3  
Antiguo 07-02-2019
ramonigimenez ramonigimenez is offline
Miembro
 
Registrado: ago 2015
Posts: 11
Reputación: 0
ramonigimenez Va por buen camino
Hola,
desbajo de la seccion "implementation"
cree estas funciones
Código Delphi [-]
{ Tfuente }

constructor Tfuente.Create;
begin
  fColorFondo:=clWhite;
  fFuente:=TFont.Create;
end;

procedure TFuente.Assign(const aSource: TFuente);
begin
  fFuente.Assign(asource.Fuente);
  fColorFondo:=aSource.ColorFondo;
end;

destructor Tfuente.Destroy;
begin
  fFuente.Free;
  inherited;
end;

procedure TFuente.LoadFromStream(const aSource: TStream);
begin
  fColorFondo:=ReadInt(aSource);
  fFuente.Name:=ReadStr(aSource);
  fFuente.Size:=ReadInt(aSource);
  fFuente.Color:=ReadInt(aSource);
  if ReadBool(aSource) then
    fFuente.Style:=fFuente.Style+[fsBold]
  else
    fFuente.Style:=fFuente.Style-[fsBold];
  if ReadBool(aSource) then
    fFuente.Style:=fFuente.Style+[fsItalic]
  else
    fFuente.Style:=fFuente.Style-[fsItalic];
  if ReadBool(aSource) then
    fFuente.Style:=fFuente.Style+[fsUnderline]
  else
    fFuente.Style:=fFuente.Style-[fsUnderline];
end;

procedure TFuente.SaveToStream(const aDest: Tstream);
begin
  WriteInt(aDest,fColorFondo);
  WriteStr(aDest,fFuente.Name);
  WriteInt(aDest,fFuente.Size);
  WriteInt(aDest,fFuente.Color);
  WriteBool(aDest,fsBold in fFuente.Style);
  WriteBool(aDest,fsItalic in fFuente.Style);
  WriteBool(aDest,fsUnderline in fFuente.Style);
end;
Lo que creo que esta haciendo es crear el constructor y las funciones que defini antes.

Última edición por Casimiro Notevi fecha: 07-02-2019 a las 17:35:07. Razón: Poner etiquetas delphi
Responder Con Cita