CallForSelectedText CurrAttr stimmt nicht

  • Hallo ich habe ein Frage, wie schaffe ich es das nach einem Aufruf von CallForSelectedText der CurrAttr weider stimmt.

    In meinem Fall habe ich eine Funktion die die Schriftgröße berechent und setzt, nach dem Aufruf, ist aber im CurrAttr die Size noch auf dem alten wert.

    Setze ich dann zB die Schriftart auf Bold, dann wird auch die Size aktualisiert - wie kann ich das manuell anstossen?

    • Offizieller Beitrag

    Die Funktion GetCharAttr liest die Attribute an der Cursor Position aus.

    Code
        {:: When you modify the cursor position in code (CPMoveNext) you can
          use this procedure to update the current writing attribute.
          <br>
          If you pass Lock as tsTrue, the value will be read and kept until
          the function is called with tsFalse. Then the lock will be disabled
          but the attribute will not be actualized.<br>
          Using GetCharAttr(tsTrue) can be useful to preserve the attribute before 
          calling LoadFromFile. }
        procedure GetCharAttr(Lock : TThreeState = tsIgnore);