Ver Mensaje Individual
  #2  
Antiguo 10-02-2004
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.932
Reputación: 27
delphi.com.ar Va por buen camino
Aclaremos que TFontStyles no es un array, es un "set of" muchas veces nombrados como "conjuntos".
Lo que podrías hacer es descomponer este "conjunto", e ir agregando valores a una variable, y a la inversa por ejemplo:
Código:
function FontStyleToInteger(AStyle: TFontStyles): Integer;
begin
  Result := 0;

  if fsBold in AStyle Then
    Result := Result or $1;

  if fsItalic in AStyle Then
    Result := Result or $2;

  if fsUnderline in AStyle Then
    Result := Result or $4;

  if fsStrikeOut in AStyle Then
    Result := Result or $8;
end;

function IntegerToFontStyle(Value: Integer): TFontStyles;
begin
  Result := [];

  if (Value and $1) = $1 Then
    Include(Result, fsBold);

  if (Value and $2) = $2 Then
    Include(Result, fsItalic);

  if (Value and $4) = $4 Then
    Include(Result, fsUnderline);

  if (Value and $8) = $8 Then
    Include(Result, fsStrikeOut);
end;
Otras ideas que se me ocurren, es copiar el dato de en memoria a un string, o utilizar las WinApi´s para obtener este tipo de valor del dato de la fuente.

Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita