Components.nsh 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /*
  2. NSIS Modern User Interface
  3. Components page
  4. */
  5. ;--------------------------------
  6. ;Page interface settings and variables
  7. !macro MUI_COMPONENTSPAGE_INTERFACE
  8. !ifndef MUI_COMPONENTSPAGE_INTERFACE
  9. !define MUI_COMPONENTSPAGE_INTERFACE
  10. Var mui.ComponentsPage
  11. Var mui.ComponentsPage.Text
  12. Var mui.ComponentsPage.InstTypesText
  13. Var mui.ComponentsPage.ComponentsText
  14. Var mui.ComponentsPage.InstTypes
  15. Var mui.ComponentsPage.Components
  16. Var mui.ComponentsPage.DescriptionTitle
  17. Var mui.ComponentsPage.DescriptionText.Info
  18. Var mui.ComponentsPage.DescriptionText
  19. Var mui.ComponentsPage.SpaceRequired
  20. !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
  21. !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_SMALLDESC "${NSISDIR}\Contrib\UIs\modern_smalldesc.exe"
  22. !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_NODESC "${NSISDIR}\Contrib\UIs\modern_nodesc.exe"
  23. ;Apply settings
  24. !ifdef MUI_COMPONENTSPAGE_SMALLDESC
  25. ChangeUI IDD_SELCOM "${MUI_UI_COMPONENTSPAGE_SMALLDESC}"
  26. !else ifdef MUI_COMPONENTSPAGE_NODESC
  27. ChangeUI IDD_SELCOM "${MUI_UI_COMPONENTSPAGE_NODESC}"
  28. !endif
  29. CheckBitmap "${MUI_COMPONENTSPAGE_CHECKBITMAP}"
  30. !endif
  31. !macroend
  32. ;--------------------------------
  33. ;Page declaration
  34. !macro MUI_PAGEDECLARATION_COMPONENTS
  35. !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}COMPONENTSPAGE ""
  36. !insertmacro MUI_COMPONENTSPAGE_INTERFACE
  37. !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_TOP ""
  38. !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_COMPLIST ""
  39. !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_INSTTYPE ""
  40. !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE)"
  41. !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO)"
  42. PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}components
  43. PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}
  44. Caption " "
  45. ComponentText "${MUI_COMPONENTSPAGE_TEXT_TOP}" "${MUI_COMPONENTSPAGE_TEXT_INSTTYPE}" "${MUI_COMPONENTSPAGE_TEXT_COMPLIST}"
  46. PageExEnd
  47. !insertmacro MUI_FUNCTION_COMPONENTSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}
  48. !undef MUI_COMPONENTSPAGE_TEXT_TOP
  49. !undef MUI_COMPONENTSPAGE_TEXT_COMPLIST
  50. !undef MUI_COMPONENTSPAGE_TEXT_INSTTYPE
  51. !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE
  52. !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO
  53. !macroend
  54. !macro MUI_PAGE_COMPONENTS
  55. !verbose push
  56. !verbose ${MUI_VERBOSE}
  57. !insertmacro MUI_PAGE_INIT
  58. !insertmacro MUI_PAGEDECLARATION_COMPONENTS
  59. !verbose pop
  60. !macroend
  61. !macro MUI_UNPAGE_COMPONENTS
  62. !verbose push
  63. !verbose ${MUI_VERBOSE}
  64. !insertmacro MUI_UNPAGE_INIT
  65. !insertmacro MUI_PAGEDECLARATION_COMPONENTS
  66. !verbose pop
  67. !macroend
  68. ;--------------------------------
  69. ;Page functions
  70. !macro MUI_FUNCTION_COMPONENTSPAGE PRE SHOW LEAVE
  71. Function "${PRE}"
  72. !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
  73. !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_SUBTITLE)
  74. FunctionEnd
  75. Function "${SHOW}"
  76. ;Get control hanldes
  77. FindWindow $mui.ComponentsPage "#32770" "" $HWNDPARENT
  78. GetDlgItem $mui.ComponentsPage.Text $mui.ComponentsPage 1006
  79. GetDlgItem $mui.ComponentsPage.InstTypesText $mui.ComponentsPage 1021
  80. GetDlgItem $mui.ComponentsPage.ComponentsText $mui.ComponentsPage 1022
  81. GetDlgItem $mui.ComponentsPage.InstTypes $mui.ComponentsPage 1017
  82. GetDlgItem $mui.ComponentsPage.Components $mui.ComponentsPage 1032
  83. GetDlgItem $mui.ComponentsPage.DescriptionTitle $mui.ComponentsPage 1042
  84. GetDlgItem $mui.ComponentsPage.DescriptionText $mui.ComponentsPage 1043
  85. GetDlgItem $mui.ComponentsPage.SpaceRequired $mui.ComponentsPage 1023
  86. ;Default text in description textbox
  87. SendMessage $mui.ComponentsPage.DescriptionTitle ${WM_SETTEXT} 0 "STR:${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE}"
  88. EnableWindow $mui.ComponentsPage.DescriptionText 0
  89. SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}"
  90. StrCpy $mui.ComponentsPage.DescriptionText.Info "${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}" ;Text for current components page
  91. !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
  92. FunctionEnd
  93. Function "${LEAVE}"
  94. !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
  95. FunctionEnd
  96. !macroend
  97. ;--------------------------------
  98. ;Script functions for components descriptions
  99. !macro MUI_DESCRIPTION_BEGIN
  100. ${if} $0 == -1
  101. ;No mouse hover over component in list
  102. SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:"
  103. EnableWindow $mui.ComponentsPage.DescriptionText 0
  104. SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:$mui.ComponentsPage.DescriptionText.Info"
  105. !macroend
  106. !macro MUI_DESCRIPTION_TEXT VAR TEXT
  107. !verbose push
  108. !verbose ${MUI_VERBOSE}
  109. ${elseif} $0 == ${VAR}
  110. SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:"
  111. EnableWindow $mui.ComponentsPage.DescriptionText 1
  112. SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:${TEXT}"
  113. !verbose pop
  114. !macroend
  115. !macro MUI_DESCRIPTION_END
  116. !verbose push
  117. !verbose ${MUI_VERBOSE}
  118. ${endif}
  119. !verbose pop
  120. !macroend
  121. !macro MUI_FUNCTION_DESCRIPTION_BEGIN
  122. !verbose push
  123. !verbose ${MUI_VERBOSE}
  124. Function .onMouseOverSection
  125. !insertmacro MUI_DESCRIPTION_BEGIN
  126. !verbose pop
  127. !macroend
  128. !macro MUI_FUNCTION_DESCRIPTION_END
  129. !verbose push
  130. !verbose ${MUI_VERBOSE}
  131. !insertmacro MUI_DESCRIPTION_END
  132. !ifdef MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION
  133. Call "${MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION}"
  134. !endif
  135. FunctionEnd
  136. !verbose pop
  137. !macroend
  138. !macro MUI_UNFUNCTION_DESCRIPTION_BEGIN
  139. !verbose push
  140. !verbose ${MUI_VERBOSE}
  141. Function un.onMouseOverSection
  142. !insertmacro MUI_DESCRIPTION_BEGIN
  143. !verbose pop
  144. !macroend
  145. !macro MUI_UNFUNCTION_DESCRIPTION_END
  146. !verbose push
  147. !verbose ${MUI_VERBOSE}
  148. !insertmacro MUI_DESCRIPTION_END
  149. !ifdef MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION
  150. Call "${MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION}"
  151. !endif
  152. FunctionEnd
  153. !verbose pop
  154. !macroend