组件页面说明-框滚动条

时间:2018-11-19 13:55:26

标签: nsis

我正在寻找一种解决方案,以实现对MUI2组件页面上的“描述”框的滚动条。因为我要填写大文本。

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

1 个答案:

答案 0 :(得分:0)

对此没有本地支持,但是在其中放置一个编辑框并修改一下更改通知似乎可以正常进行:

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 '*$0(i.r1,i.r2,i.r3,i.r4)'
    IntOp $3 $3 - $1
    IntOp $4 $4 - $2
    System::Call 'USER32::MapWindowPoints(p0, pss, pr0, i1)'
    System::Call '*$0(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 $0
    SendMessage $ScrollWindow ${WM_SETFONT} $0 1
${EndIf}

${NSD_GetText} $mui.ComponentsPage.DescriptionText $0
System::Call 'USER32::IsWindowEnabled(p$mui.ComponentsPage.DescriptionText)i.r1'
${If} $1 <> 0 ; No hover text?
    StrCpy $LastText $0
${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} $0 = $1
    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
相关问题