3

I'm trying to refresh my IDE after applying a new font size. The code is:

procedure TEditorFontSizeController.ChangeFontSize(Delta: Integer);
var
  IdeServices: IOTAServices;
  EnvironmentOptions: IOTAEnvironmentOptions;
  CurValue: Integer;
  NewValue: Integer;
begin
  if not Supports(BorlandIDEServices, IOTAServices, IdeServices) then
    Exit;

  EnvironmentOptions := IdeServices.GetEnvironmentOptions;

  CurValue := EnvironmentOptions.Values['FontSize'];
  NewValue := CurValue + Delta;

  if (NewValue <= 7) or (NewValue >= 256) then
    Exit;

  EnvironmentOptions.Values['FontSize'] := NewValue;
  RefreshScreen;
end;

If I open the Editor Options from IDE I can see that the new values was applied correctly but it just reflect in the IDE when I click the OK button on the Tools Option Screen. How to apply it directly from the code ?

Rudy Velthuis
  • 28,387
  • 5
  • 46
  • 94
Rodrigo Farias Rezino
  • 2,687
  • 3
  • 33
  • 60
  • Possible duplicate of: https://stackoverflow.com/questions/9914559/how-instruct-to-the-delphi-ide-refresh-the-modified-syntax-highlight-colors-usin?rq=1 – Johan Oct 27 '17 at 11:50

0 Answers0