在应用新的字体大小后,我正在尝试刷新我的 IDE。代码是:
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;
如果我从 IDE 打开编辑器选项,我可以看到新值已正确应用,但当我单击“工具选项”屏幕上的“确定”按钮时,它只会反映在 IDE 中。如何直接从代码中应用它?