AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Die Delphi-IDE Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie IOTA-mäßig abfragen?
Thema durchsuchen
Ansicht
Themen-Optionen

Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie IOTA-mäßig abfragen?

Ein Thema von r29d43 · begonnen am 16. Jun 2021 · letzter Beitrag vom 17. Jun 2021
Antwort Antwort
TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.074 Beiträge
 
Delphi 10.4 Sydney
 
#1

AW: IOTA-Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie abfragen?

  Alt 17. Jun 2021, 07:31
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:
https://github.com/cnpack/cnwizards/...orFontZoom.pas
https://github.com/cnpack/cnwizards/...CnWizUtils.pas

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:
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;
QuerySvcs ist hier nur ein Wrapper mit Logmöglichkeit für das normale Supports() und kann damit ersetzt werden.
  Mit Zitat antworten Zitat
Benutzerbild von Stevie
Stevie

Registriert seit: 12. Aug 2003
Ort: Soest
4.045 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#2

AW: IOTA-Neuerung ab Delphi 10.4: Schriftgröße änderbar! Wie abfragen?

  Alt 17. Jun 2021, 17:09
Das sind ja nur Controls, die auf die bisherige Schrifteinstellung über Tools | Options | IDE | User Interface | Editor | Display mappen.
Bzw Strg + Num+/-
Stefan
“Simplicity, carried to the extreme, becomes elegance.” Jon Franklin

Delphi Sorcery - DSharp - Spring4D - TestInsight
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:23 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