组件页面描述-框滚动条

Component Page Description-Box Scrollbar

我正在寻找一个解决方案来实现 MUI2 组件页面上描述框的滚动条。因为我有一大段文字要填写。

使 UI 变大是我要使用的最后一个选项。 我尝试使用选项 MUIEx 实现 UMUI 以使用大描述选项,但没有效果。

没有对此的本地支持,但在那里放置一个编辑框并修改一下更改通知似乎可以正常工作:

OutFile Test.exe
RequestExecutionLevel user

!define MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION myOnMouseOver
!include MUI2.nsh
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_PRE myCompPagePre
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"


Var LastText
Var ScrollWindow
!include LogicLib.nsh
!define /IfNDef SB_VERT 1

Function myCompPagePre
StrCpy $ScrollWindow ""
FunctionEnd

Function myOnMouseOver
${If} $ScrollWindow P= 0 
    System::Call 'USER32::GetWindowRect(p$mui.ComponentsPage.DescriptionText,@r0)' ; NSIS v3+
    System::Call 'USER32::GetParent(p$mui.ComponentsPage.DescriptionText)p.s'
    System::Call '*[=10=](i.r1,i.r2,i.r3,i.r4)'
    IntOp   - 
    IntOp   - 
    System::Call 'USER32::MapWindowPoints(p0, pss, pr0, i1)'
    System::Call '*[=10=](i.r1,i.r2)'
    System::Call 'USER32::CreateWindowEx(i0, t"EDIT", p0, i ${WS_VISIBLE}|${WS_CHILD}|${WS_VSCROLL}|${ES_MULTILINE}|${ES_READONLY}, i r1, i r2, i r3, i r4, ps, p0, p0, p0)p.s'
    Pop $ScrollWindow
    ShowWindow $mui.ComponentsPage.DescriptionText 0
    SendMessage $mui.ComponentsPage.DescriptionText ${WM_GETFONT} 0 0 [=10=]
    SendMessage $ScrollWindow ${WM_SETFONT} [=10=] 1
${EndIf}

${NSD_GetText} $mui.ComponentsPage.DescriptionText [=10=]
System::Call 'USER32::IsWindowEnabled(p$mui.ComponentsPage.DescriptionText)i.r1'
${If}  <> 0 ; No hover text?
    StrCpy $LastText [=10=]
${EndIf}
${NSD_SetText} $ScrollWindow $LastText

System::Call 'USER32::ShowScrollBar(p $ScrollWindow, i ${SB_VERT}, i 1)'
System::Call 'USER32::GetScrollRange(p $ScrollWindow, i ${SB_VERT}, *i.r0, *i.r1)'
${If} [=10=] = 
    System::Call 'USER32::ShowScrollBar(p $ScrollWindow, i ${SB_VERT}, i 0)'
${EndIf}
FunctionEnd

Section SecA SID_A
SectionEnd
Section SecB SID_B
SectionEnd

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${SID_A} "aaa a a aa a "
  !define longstr "Very looooooo o o o o o oo o o o o o ooo o o ng stri i i i i i in ng"
  !insertmacro MUI_DESCRIPTION_TEXT ${SID_B} "bbb b b b b b b b b b b b ${longstr} ${longstr} ${longstr} ${longstr} ${longstr} END"
!insertmacro MUI_FUNCTION_DESCRIPTION_END