How to refresh Delphi IDE after applying a different value IDE SizeFont using ToolsApi?

149 Views Asked by At

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 ?

0

There are 0 best solutions below