代码之家  ›  专栏  ›  技术社区  ›  this

准备安装对话框中的自定义消息包装

  •  3
  • this  · 技术社区  · 6 年前

    我们有一个自定义安装程序 Rubberduck 同时支持按用户和按计算机安装的项目。选择一个或另一个有一些分支。因此,我们在“准备安装”页中插入一条自定义消息: Ready to Install image

    我们还支持4种语言的本地化。这里最大的烦恼是对话框中的文本区域没有包装文本,这意味着如果我们不插入手动换行符,它将在屏幕上作为一个长行运行,需要使用水平滚动条。

    我们希望能够自动包装文本,这样就不必为每个本地化插入手动换行符。有办法吗?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Martin Prikryl    6 年前

    WizardForm.ReadyMemo.WordWrap True . 你还必须设置 WizardForm.ReadyMemo.ScrollBars ssVertical ,对于 WordWrap 产生效果。

    procedure InitializeWizard();
    begin
      WizardForm.ReadyMemo.ScrollBars := ssVertical;
      WizardForm.ReadyMemo.WordWrap := True;
    end;
    
    function UpdateReadyMemo(
      Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo,
      MemoGroupInfo, MemoTasksInfo: String): String;
    begin
      Result :=
        'Rubber duck Add-In will be available to all users.' + NewLine + NewLine +
        'NOTE: each user individually must register the Rubberduck Add-In ' +
          'as this is a per-user setting and cannot be deployed to all users.' + NewLine;
    end;
    

    enter image description here