![]() |
Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie IOTA-mäßig abfragen?
Hallo,
mit Delphi 10.4 kam die Neuerung, die Schriftgröße des IDE-Editors frei wählbar zu machen. Weiß eventuell jemand, wo man IOTA-mäßig an diese Einstellung herankommt bzw. diese auslesen kann? Da es dieses Feature noch nicht lange gibt, nehme ich mal an, wird man in ToolsAPI.pas danach vergeblich suchen? Thx im Voraus .. |
AW: IOTA-Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie abfragen?
Ich nehme an, du meinst diese neue Möglichkeit mit der TTrackbar und den beiden TButtons für kleiner und größer unterhalb des Editorsfensters.
Das sind ja nur Controls, die auf die bisherige Schrifteinstellung über Tools | Options | IDE | User Interface | Editor | Display mappen. Da die Wizards vom CnPack das schon gefühlt schon immer konnten, lohnt sich ein Blick ins öffentliche GitHub-Repository: ![]() ![]() Daraus folgt für größer:
Delphi-Quellcode:
procedure TCnEditorFontInc.Execute;
var Option: IOTAEditOptions; begin Option := CnOtaGetEditOptions; if Assigned(Option) then Option.FontSize := Round(Option.FontSize * 1.1); end; Und für kleiner:
Delphi-Quellcode:
procedure TCnEditorFontDec.Execute;
var Option: IOTAEditOptions; begin Option := CnOtaGetEditOptions; if Assigned(Option) then Option.FontSize := Round(Option.FontSize / 1.1); end; Natürlich mithilfe von:
Delphi-Quellcode:
QuerySvcs ist hier nur ein Wrapper mit Logmöglichkeit für das normale Supports() und kann damit ersetzt werden.
function CnOtaGetEditOptions: IOTAEditOptions;
var Svcs: IOTAEditorServices; begin QuerySvcs(BorlandIDEServices, IOTAEditorServices, Svcs); if Assigned(Svcs) then begin {$IFDEF COMPILER7_UP} if Assigned(Svcs.GetTopBuffer) then Result := Svcs.GetTopBuffer.EditOptions else if Svcs.EditOptionsCount > 0 then Result := Svcs.GetEditOptionsIndex(0) else Result := nil; {$ELSE} Result := Svcs.GetEditOptions; {$ENDIF} end else Result := nil; end; |
AW: Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie IOTA-mäßig abfragen?
Ja, thx, ich werde mir das nachher mal ansehen.
Ich hatte mich jetzt allerdings auch zu einer Lösung durchgewühlt: Im Zitat:
Delphi-Quellcode:
CellSize.CX ist da die Pixelzahl was ein Char breit ist.
procedure PaintLine(const View: IOTAEditView; LineNumber: Integer;
const LineText: PAnsiChar; const TextWidth: Word; const LineAttributes: TOTAAttributeArray; const Canvas: TCanvas; const TextRect: TRect; const LineRect: TRect; const CellSize: TSize); CellSize.CY ist da die Pixelzahl was ein Char hoch ist. Wird nun die Schriftgrößte per IDE-Schriftgrößtenregler geändert, spiegelt sich das also sofort auch in diesem Parameter wieder. Muss ja auch :stupid: |
AW: IOTA-Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie abfragen?
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:06 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz