New MUI2 bitmap stretch modes: FitControl, NoStretchNoCrop[NoAlign] and AspectFitHeight. *_NOSTRETCH is now deprecated.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6524 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
481d383c76
commit
efbdf196f2
9 changed files with 273 additions and 76 deletions
|
@ -5,6 +5,21 @@ Deprecated code - display warnings
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
!macro MUI_LEGACY_MAP_NOSTRETCH NAME R
|
||||||
|
!if "${R}" != ""
|
||||||
|
!ifdef ${NAME}NOSTRETCH
|
||||||
|
!define /IfNDef ${NAME}STRETCH NoStretchNoCropNoAlign
|
||||||
|
!endif
|
||||||
|
!else
|
||||||
|
!insertmacro ${__MACRO__} ${NAME}BITMAP_ 1
|
||||||
|
!insertmacro ${__MACRO__} ${NAME}BITMAP_RTL_ 1
|
||||||
|
!insertmacro ${__MACRO__} ${NAME}UNBITMAP_ 1
|
||||||
|
!insertmacro ${__MACRO__} ${NAME}UNBITMAP_RTL_ 1
|
||||||
|
!endif
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;InstallOptions
|
;InstallOptions
|
||||||
|
|
||||||
|
@ -66,7 +81,6 @@ Deprecated code - display warnings
|
||||||
|
|
||||||
!macro MUI_RESERVEFILE_INSTALLOPTIONS
|
!macro MUI_RESERVEFILE_INSTALLOPTIONS
|
||||||
|
|
||||||
!define MUI_DOLLAR "$"
|
!error `MUI_RESERVEFILE_INSTALLOPTIONS is no longer supported as InstallOptions is no longer used by MUI2. Instead, use "ReserveFile /plugin InstallOptions.dll". It is also recommended to upgrade to nsDialogs.`
|
||||||
!error "MUI_RESERVEFILE_INSTALLOPTIONS is no longer supported as InstallOptions is no longer used by MUI2. Instead, use ReserveFile '${MUI_DOLLAR}{NSISDIR}\Plugins\InstallOptions.dll'. It is also recommended to upgrade to nsDialogs."
|
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
|
@ -50,24 +50,27 @@ Var mui.Button.Back
|
||||||
!insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
!insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
||||||
!insertmacro MUI_DEFAULT MUI_BGCOLOR "FFFFFF"
|
!insertmacro MUI_DEFAULT MUI_BGCOLOR "FFFFFF"
|
||||||
|
|
||||||
|
;Map *_NOSTRETCH legacy define to the correct *_STRETCH value
|
||||||
|
!insertmacro MUI_LEGACY_MAP_NOSTRETCH MUI_HEADERIMAGE_ ""
|
||||||
|
!insertmacro MUI_LEGACY_MAP_NOSTRETCH MUI_WELCOMEFINISHPAGE_ ""
|
||||||
|
!insertmacro MUI_LEGACY_MAP_NOSTRETCH MUI_UNWELCOMEFINISHPAGE_ ""
|
||||||
|
|
||||||
;Default header images
|
;Default header images
|
||||||
!ifdef MUI_HEADERIMAGE
|
!ifdef MUI_HEADERIMAGE
|
||||||
|
|
||||||
!insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
|
!insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
|
||||||
|
!insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP_STRETCH "FitControl"
|
||||||
|
!insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP_RTL_STRETCH ${MUI_HEADERIMAGE_BITMAP_STRETCH}
|
||||||
|
|
||||||
!ifndef MUI_HEADERIMAGE_UNBITMAP
|
!ifndef MUI_HEADERIMAGE_UNBITMAP
|
||||||
!define MUI_HEADERIMAGE_UNBITMAP "${MUI_HEADERIMAGE_BITMAP}"
|
!define MUI_HEADERIMAGE_UNBITMAP "${MUI_HEADERIMAGE_BITMAP}"
|
||||||
!ifdef MUI_HEADERIMAGE_BITMAP_NOSTRETCH
|
!insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_STRETCH ${MUI_HEADERIMAGE_BITMAP_STRETCH}
|
||||||
!insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH ""
|
|
||||||
!endif
|
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef MUI_HEADERIMAGE_BITMAP_RTL
|
!ifdef MUI_HEADERIMAGE_BITMAP_RTL
|
||||||
!ifndef MUI_HEADERIMAGE_UNBITMAP_RTL
|
!ifndef MUI_HEADERIMAGE_UNBITMAP_RTL
|
||||||
!define MUI_HEADERIMAGE_UNBITMAP_RTL "${MUI_HEADERIMAGE_BITMAP_RTL}"
|
!define MUI_HEADERIMAGE_UNBITMAP_RTL "${MUI_HEADERIMAGE_BITMAP_RTL}"
|
||||||
!ifdef MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH
|
!insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_RTL_STRETCH ${MUI_HEADERIMAGE_BITMAP_RTL_STRETCH}
|
||||||
!insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH ""
|
|
||||||
!endif
|
|
||||||
!endif
|
!endif
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
@ -133,7 +136,53 @@ Var mui.Button.Back
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Initialization of GUI
|
;Initialization of GUI
|
||||||
|
|
||||||
!macro MUI_HEADERIMAGE_INIT UNINSTALLER
|
!macro MUI_HEADERIMAGE_INITHELPER_LOADIMAGEWITHMACRO MACRO
|
||||||
|
|
||||||
|
!ifdef MUI_HEADERIMAGE_RIGHT
|
||||||
|
!ifndef MUI_OPTIMIZE_ALWAYSLTR ; Undocumented
|
||||||
|
${if} $(^RTL) == 1
|
||||||
|
!insertmacro ${MACRO} $mui.Header.Image "${PATH}" Left Leak
|
||||||
|
${Else}
|
||||||
|
!insertmacro ${MACRO} $mui.Header.Image "${PATH}" Right Leak
|
||||||
|
${EndIf}
|
||||||
|
!else
|
||||||
|
!insertmacro ${MACRO} $mui.Header.Image "${PATH}" Right Leak
|
||||||
|
!endif
|
||||||
|
!else
|
||||||
|
!insertmacro ${MACRO} $mui.Header.Image "${PATH}" Auto Leak
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
!macro MUI_HEADERIMAGE_INITHELPER_LOADIMAGE UN RTL IMGRESID PATH
|
||||||
|
|
||||||
|
GetDlgItem $mui.Header.Image $HWNDPARENT ${IMGRESID} ; Every mode doesn't use this variable but we have to reference it to avoid a compiler warning.
|
||||||
|
|
||||||
|
!if "${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}" == "NoStretchNoCropNoAlign"
|
||||||
|
|
||||||
|
SetBrandingImage /IMGID=${IMGRESID} "${PATH}"
|
||||||
|
|
||||||
|
!else if "${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}" == "NoStretchNoCrop"
|
||||||
|
|
||||||
|
!insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGEWITHMACRO \
|
||||||
|
MUI_LOADANDXALIGNIMAGE
|
||||||
|
|
||||||
|
!else if "${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}" == "AspectFitHeight"
|
||||||
|
|
||||||
|
!insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGEWITHMACRO \
|
||||||
|
MUI_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT
|
||||||
|
|
||||||
|
!else
|
||||||
|
|
||||||
|
!if "${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}" != "FitControl"
|
||||||
|
!warning 'MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH set to unknown value, defaulting to FitControl'
|
||||||
|
!endif
|
||||||
|
SetBrandingImage /IMGID=${IMGRESID} /RESIZETOFIT "${PATH}"
|
||||||
|
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro MUI_HEADERIMAGE_INIT UN IMGRESID
|
||||||
|
|
||||||
;Load and display header image
|
;Load and display header image
|
||||||
|
|
||||||
|
@ -141,34 +190,20 @@ Var mui.Button.Back
|
||||||
|
|
||||||
InitPluginsDir
|
InitPluginsDir
|
||||||
|
|
||||||
!ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL
|
!ifdef MUI_HEADERIMAGE_${UN}BITMAP_RTL
|
||||||
|
|
||||||
${if} $(^RTL) == 1
|
${if} $(^RTL) == 1
|
||||||
|
|
||||||
File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL}"
|
File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UN}BITMAP_RTL}"
|
||||||
|
!insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGE "${UN}" "_RTL" ${IMGRESID} "$PLUGINSDIR\modern-header.bmp"
|
||||||
!ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL_NOSTRETCH
|
|
||||||
SetBrandingImage /IMGID=1046 /RESIZETOFIT "$PLUGINSDIR\modern-header.bmp"
|
|
||||||
!else
|
|
||||||
SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp"
|
|
||||||
!endif
|
|
||||||
|
|
||||||
${else}
|
${else}
|
||||||
|
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP}"
|
File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UN}BITMAP}"
|
||||||
|
!insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGE "${UN}" "" ${IMGRESID} "$PLUGINSDIR\modern-header.bmp"
|
||||||
!ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_NOSTRETCH
|
|
||||||
SetBrandingImage /IMGID=1046 /RESIZETOFIT "$PLUGINSDIR\modern-header.bmp"
|
|
||||||
!else
|
|
||||||
SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp"
|
|
||||||
!endif
|
|
||||||
|
|
||||||
!ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL
|
|
||||||
|
|
||||||
|
!ifdef MUI_HEADERIMAGE_${UN}BITMAP_RTL
|
||||||
${endif}
|
${endif}
|
||||||
|
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!endif
|
!endif
|
||||||
|
@ -195,15 +230,17 @@ Var mui.Button.Back
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
;Header image
|
;Header image
|
||||||
!insertmacro MUI_HEADERIMAGE_INIT "${UNINSTALLER}"
|
!insertmacro MUI_HEADERIMAGE_INIT "${UNINSTALLER}" 1046
|
||||||
|
|
||||||
;Header background
|
;Header background
|
||||||
GetDlgItem $mui.Header.Background $HWNDPARENT 1034
|
GetDlgItem $mui.Header.Background $HWNDPARENT 1034
|
||||||
SetCtlColors $mui.Header.Background "" "${MUI_BGCOLOR}"
|
SetCtlColors $mui.Header.Background "" "${MUI_BGCOLOR}"
|
||||||
|
|
||||||
;Header image background
|
;Header icon image background
|
||||||
GetDlgItem $mui.Header.Image $HWNDPARENT 1039
|
!ifndef MUI_HEADERIMAGE
|
||||||
SetCtlColors $mui.Header.Image "" "${MUI_BGCOLOR}"
|
GetDlgItem $mui.Header.Image $HWNDPARENT 1039
|
||||||
|
SetCtlColors $mui.Header.Image "" "${MUI_BGCOLOR}"
|
||||||
|
!endif
|
||||||
|
|
||||||
;Branding text
|
;Branding text
|
||||||
GetDlgItem $mui.Branding.Background $HWNDPARENT 1028
|
GetDlgItem $mui.Branding.Background $HWNDPARENT 1028
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
NSIS Modern User Interface - Version 2.0
|
NSIS Modern User Interface - Version 2.0
|
||||||
Copyright 2002-2014 Joost Verburg
|
Copyright 2002-2014 Joost Verburg
|
||||||
|
Contributors: Amir Szekely, Anders Kjersem
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -166,3 +166,159 @@ Support code for all pages
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
!macro MUI_INTERNAL_FULLWINDOW_LOADWIZARDIMAGE _un _hwndImg _ImgPath _RetImgHandle
|
||||||
|
|
||||||
|
!ifdef MUI_${_un}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
|
||||||
|
!insertmacro MUI_DEFAULT MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH NoStretchNoCropNoAlign ; Legacy compatibility
|
||||||
|
!endif
|
||||||
|
!insertmacro MUI_DEFAULT MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH FitControl
|
||||||
|
|
||||||
|
!if "${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}" == "NoStretchNoCropNoAlign"
|
||||||
|
|
||||||
|
${NSD_SetImage} ${_hwndImg} "${_ImgPath}" "${_RetImgHandle}"
|
||||||
|
|
||||||
|
!else if "${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}" == "NoStretchNoCrop"
|
||||||
|
|
||||||
|
!insertmacro MUI_LOADANDXALIGNIMAGE ${_hwndImg} "${_ImgPath}" Auto "${_RetImgHandle}"
|
||||||
|
|
||||||
|
!else if "${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}" == "AspectFitHeight"
|
||||||
|
|
||||||
|
!insertmacro MUI_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT ${_hwndImg} "${_ImgPath}" Auto "${_RetImgHandle}"
|
||||||
|
|
||||||
|
!else
|
||||||
|
|
||||||
|
!if "${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}" != "FitControl"
|
||||||
|
!warning 'MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH set to unknown value, defaulting to FitControl'
|
||||||
|
!endif
|
||||||
|
${NSD_SetStretchedImage} ${_hwndImg} "${_ImgPath}" "${_RetImgHandle}"
|
||||||
|
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Helper macros
|
||||||
|
|
||||||
|
!include Util.nsh
|
||||||
|
|
||||||
|
!macro MUI_INTERNAL_LOADANDSIZEIMAGE _macro _hwndImg _ImgPath _XAlign _RetImgHandle
|
||||||
|
!if "${_XAlign}" == "Auto"
|
||||||
|
${if} $(^RTL) == 1
|
||||||
|
Push "*${_ImgPath}"
|
||||||
|
${Else}
|
||||||
|
Push "${_ImgPath}"
|
||||||
|
${EndIf}
|
||||||
|
!else if "${_XAlign}" == "Right"
|
||||||
|
Push "*${_ImgPath}"
|
||||||
|
!else
|
||||||
|
Push "${_ImgPath}"
|
||||||
|
!endif
|
||||||
|
Push "${_hwndImg}"
|
||||||
|
${CallArtificialFunction} ${_macro}
|
||||||
|
!if "${_RetImgHandle}" == "Leak"
|
||||||
|
!insertmacro _LOGICLIB_TEMP
|
||||||
|
Pop $_LOGICLIB_TEMP
|
||||||
|
!else if "${_RetImgHandle}" != "Stack"
|
||||||
|
Pop ${_RetImgHandle}
|
||||||
|
!endif
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro MUI_LOADANDXALIGNIMAGE _hwndImg _ImgPath _XAlign _RetImgHandle
|
||||||
|
!insertmacro MUI_INTERNAL_LOADANDSIZEIMAGE \
|
||||||
|
MUI_INTERNAL_LOADANDXALIGNIMAGE "${_hwndImg}" "${_ImgPath}" "${_XAlign}" "${_RetImgHandle}"
|
||||||
|
!macroend
|
||||||
|
!macro MUI_INTERNAL_LOADANDXALIGNIMAGE
|
||||||
|
System::Store "S"
|
||||||
|
System::Call 'USER32::GetWindowRect(psr0,@r1)'
|
||||||
|
System::Call 'USER32::MapWindowPoints(p0,p$hwndparent,pr1,i2)' ; Note: Assuming control is not in inner dialog
|
||||||
|
System::Call '*$1(i.r5,i.r6,i.r7,i.r8)'
|
||||||
|
IntOp $7 $7 - $5
|
||||||
|
IntOp $8 $8 - $6
|
||||||
|
|
||||||
|
Pop $1
|
||||||
|
StrCpy $3 $1 1
|
||||||
|
${If} $3 == "*" ; Move control to the right?
|
||||||
|
StrCpy $1 $1 "" 1
|
||||||
|
${Endif}
|
||||||
|
System::Call 'USER32::LoadImage(p0,tr1,i${IMAGE_BITMAP},i0,i0,i${LR_LOADFROMFILE})p.r2'
|
||||||
|
SendMessage $0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $2 $1
|
||||||
|
Push $2 ; Return value
|
||||||
|
System::Call 'GDI32::DeleteObject(pr1)' ; Note: Assuming the previous image (if any) was a bitmap
|
||||||
|
System::Call 'USER32::GetClientRect(pr0,@r1)'
|
||||||
|
System::Call '*$1(i,i,i.r1,i.r2)'
|
||||||
|
|
||||||
|
${If} $3 == "*"
|
||||||
|
${AndIf} $1 < $7 ; ImgW < CtlW
|
||||||
|
IntOp $3 $7 - $1
|
||||||
|
IntOp $5 $5 + $3
|
||||||
|
System::Call 'USER32::SetWindowPos(pr0,p0,ir5,ir6,i,i,i0x15)'
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
System::Store "L"
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro MUI_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT _hwndImg _ImgPath _XAlign _RetImgHandle
|
||||||
|
!insertmacro MUI_INTERNAL_LOADANDSIZEIMAGE \
|
||||||
|
MUI_INTERNAL_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT "${_hwndImg}" "${_ImgPath}" "${_XAlign}" "${_RetImgHandle}"
|
||||||
|
!macroend
|
||||||
|
!macro MUI_INTERNAL_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT
|
||||||
|
System::Store "S"
|
||||||
|
System::Call 'USER32::GetWindowRect(psr0,@r1)'
|
||||||
|
System::Call 'USER32::MapWindowPoints(p0,p$hwndparent,pr1,i2)' ; Note: Assuming control is not in inner dialog
|
||||||
|
System::Call '*$1(i.r5,i.r6,i.r7,i.r8)'
|
||||||
|
IntOp $7 $7 - $5
|
||||||
|
IntOp $8 $8 - $6
|
||||||
|
|
||||||
|
Pop $1
|
||||||
|
StrCpy $3 $1 1
|
||||||
|
${If} $3 == "*" ; Move control to the right?
|
||||||
|
StrCpy $1 $1 "" 1
|
||||||
|
${Endif}
|
||||||
|
System::Call 'USER32::LoadImage(p0,tr1,i${IMAGE_BITMAP},i0,i0,i${LR_LOADFROMFILE})p.r2'
|
||||||
|
SendMessage $0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $2 $1
|
||||||
|
Push $2 ; Return value
|
||||||
|
System::Call 'GDI32::DeleteObject(pr1)' ; Note: Assuming the previous image (if any) was a bitmap
|
||||||
|
System::Call 'USER32::GetClientRect(pr0,@r1)'
|
||||||
|
System::Call '*$1(i,i,i.r1,i.r2)'
|
||||||
|
|
||||||
|
IntOp $R7 $7 * 10000
|
||||||
|
IntOp $R8 $8 * 10000
|
||||||
|
IntOp $R1 $1 * 10000
|
||||||
|
IntOp $R2 $2 * 10000
|
||||||
|
IntOp $R3 $R1 / $2
|
||||||
|
StrCpy $R4 10000
|
||||||
|
${If} $R1 > $R2
|
||||||
|
StrCpy $R3 10000
|
||||||
|
IntOp $R4 $R2 / $1
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
${DoWhile} $R2 > $R8 ; ImgH > CtlH
|
||||||
|
IntOp $R1 $R1 - $R3
|
||||||
|
IntOp $R2 $R2 - $R4
|
||||||
|
${Loop}
|
||||||
|
${DoWhile} $R2 < $R8 ; ImgH < CtlH
|
||||||
|
IntOp $R1 $R1 + $R3
|
||||||
|
IntOp $R2 $R2 + $R4
|
||||||
|
${Loop}
|
||||||
|
IntOp $1 $R1 / 10000
|
||||||
|
IntOp $2 $R2 / 10000
|
||||||
|
|
||||||
|
${If} $1 < $7
|
||||||
|
${AndIf} $3 == "*"
|
||||||
|
IntOp $R3 $7 - $1
|
||||||
|
IntOp $5 $5 + $R3
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
${DoWhile} $2 > $8 ; Non-aspect-maintained stretch to make it a pixel perfect match
|
||||||
|
IntOp $2 $2 - 1
|
||||||
|
IntOp $1 $1 - 1
|
||||||
|
${IfThen} $3 == "*" ${|} IntOp $5 $5 + 1 ${|}
|
||||||
|
${Loop}
|
||||||
|
|
||||||
|
System::Call 'USER32::SetWindowPos(pr0,p0,ir5,ir6,ir1,ir2,i0x14)'
|
||||||
|
System::Store "L"
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -264,11 +264,7 @@ Finish page (implemented using nsDialogs)
|
||||||
;Image control
|
;Image control
|
||||||
${NSD_CreateBitmap} 0u 0u 109u 193u ""
|
${NSD_CreateBitmap} 0u 0u 109u 193u ""
|
||||||
Pop $mui.FinishPage.Image
|
Pop $mui.FinishPage.Image
|
||||||
!ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
|
!insertmacro MUI_INTERNAL_FULLWINDOW_LOADWIZARDIMAGE "${MUI_PAGE_UNINSTALLER_PREFIX}" $mui.FinishPage.Image $PLUGINSDIR\modern-wizard.bmp $mui.FinishPage.Image.Bitmap
|
||||||
${NSD_SetStretchedImage} $mui.FinishPage.Image $PLUGINSDIR\modern-wizard.bmp $mui.FinishPage.Image.Bitmap
|
|
||||||
!else
|
|
||||||
${NSD_SetImage} $mui.FinishPage.Image $PLUGINSDIR\modern-wizard.bmp $mui.FinishPage.Image.Bitmap
|
|
||||||
!endif
|
|
||||||
|
|
||||||
;Positiong of controls
|
;Positiong of controls
|
||||||
|
|
||||||
|
|
|
@ -126,11 +126,7 @@ Welcome page (implemented using nsDialogs)
|
||||||
;Image control
|
;Image control
|
||||||
${NSD_CreateBitmap} 0u 0u 109u 193u ""
|
${NSD_CreateBitmap} 0u 0u 109u 193u ""
|
||||||
Pop $mui.WelcomePage.Image
|
Pop $mui.WelcomePage.Image
|
||||||
!ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
|
!insertmacro MUI_INTERNAL_FULLWINDOW_LOADWIZARDIMAGE "${MUI_PAGE_UNINSTALLER_PREFIX}" $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
|
||||||
${NSD_SetStretchedImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
|
|
||||||
!else
|
|
||||||
${NSD_SetImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
|
|
||||||
!endif
|
|
||||||
|
|
||||||
;Positiong of controls
|
;Positiong of controls
|
||||||
|
|
||||||
|
|
|
@ -282,11 +282,23 @@
|
||||||
<em>Default: ${NSISDIR}\Contrib\Graphics\Header\nsis.bmp</em></p>
|
<em>Default: ${NSISDIR}\Contrib\Graphics\Header\nsis.bmp</em></p>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_HEADERIMAGE_BITMAP_NOSTRETCH</strong><br />
|
<strong>MUI_HEADERIMAGE_BITMAP_STRETCH</strong> <span class="parameter">mode</span><br />
|
||||||
Do not stretch the installer header bitmap to fit the size of the field. Use this
|
<ul>
|
||||||
option only if you have an image that does not use the whole space. If you have
|
<li><p><strong>FitControl</strong> (Default)<br />
|
||||||
a full size bitmap that fits exactly, you should not use this option because the
|
Stretch the image to fit the image control.</p>
|
||||||
size of the field will be different if the user has a custom DPI setting.</p>
|
<li><p><strong>NoStretchNoCropNoAlign</strong><br />
|
||||||
|
Do not stretch the image to fit the size of the image control.
|
||||||
|
You should not use this option if you have a full size bitmap that fits exactly because
|
||||||
|
the size of the field will be different if the user has a custom DPI setting or
|
||||||
|
if the installer is using a CJK language.</p>
|
||||||
|
<li><p><strong>NoStretchNoCrop</strong><br />
|
||||||
|
This is similar to NoStretchNoCropNoAlign but will align the image to the right edge when
|
||||||
|
using a RTL language or if MUI_HEADERIMAGE_RIGHT is defined.</p>
|
||||||
|
<li><p><strong>AspectFitHeight</strong><br />
|
||||||
|
Scale the image up or down until it is the same height as the image control while
|
||||||
|
maintaining the image aspect ratio.</p>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_HEADERIMAGE_BITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
|
<strong>MUI_HEADERIMAGE_BITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
|
||||||
Bitmap image to display on the header of installers pages when using a RTL language
|
Bitmap image to display on the header of installers pages when using a RTL language
|
||||||
|
@ -294,12 +306,8 @@
|
||||||
<em>Default: Non-RTL bitmap</em></p>
|
<em>Default: Non-RTL bitmap</em></p>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH</strong><br />
|
<strong>MUI_HEADERIMAGE_BITMAP_RTL_STRETCH</strong> <span class="parameter">mode</span><br />
|
||||||
Do not stretch the installer header bitmap when using a RTL language to fit the
|
See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>
|
||||||
size of the field. Use this option only if you have an image that does not use the
|
|
||||||
whole space. If you have a full size bitmap that fits exactly, you should not use
|
|
||||||
this option because the size of the field will be different if the user has a custom
|
|
||||||
DPI setting.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
|
@ -309,11 +317,8 @@
|
||||||
<em>Default: Installer header bitmap</em></p>
|
<em>Default: Installer header bitmap</em></p>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH</strong><br />
|
<strong>MUI_HEADERIMAGE_UNBITMAP_STRETCH</strong> <span class="parameter">mode</span><br />
|
||||||
Do not stretch the uninstaller header bitmap to fit the size of the field. Use this
|
See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>
|
||||||
option only if you have an image that does not use the whole space. If you have
|
|
||||||
a full size bitmap that fits exactly, you should not use this option because the
|
|
||||||
size of the field will be different if the user has a custom DPI setting.</p>
|
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
|
<strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
|
||||||
Bitmap image to display on the header of uninstallers pages when using a RTL language
|
Bitmap image to display on the header of uninstallers pages when using a RTL language
|
||||||
|
@ -321,12 +326,8 @@
|
||||||
<em>Default: Installer RTL header bitmap</em></p>
|
<em>Default: Installer RTL header bitmap</em></p>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH</strong><br />
|
<strong>MUI_HEADERIMAGE_UNBITMAP_RTL_STRETCH</strong> <span class="parameter">mode</span><br />
|
||||||
Do not stretch the uninstaller header bitmap when using a RTL language to fit the
|
See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>
|
||||||
size of the field. Use this option only if you have an image that does not use the
|
|
||||||
whole space. If you have a full size bitmap that fits exactly, you should not use
|
|
||||||
this option because the size of the field will be different if the user has a custom
|
|
||||||
DPI setting.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
|
@ -385,11 +386,8 @@
|
||||||
<em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
|
<em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
|
<strong>MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH</strong> <span class="parameter">mode</span><br />
|
||||||
Do not stretch the bitmap for the Welcome and Finish page to fit the size of the
|
See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>
|
||||||
field. Use this option only if you have an image that does not use the whole space.
|
|
||||||
If you have a full size bitmap that fits exactly, you should not use this option
|
|
||||||
because the size of the field will be different if the user has a custom DPI setting.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<h3>
|
||||||
|
@ -403,11 +401,8 @@
|
||||||
<em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
|
<em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<p>
|
<p>
|
||||||
<strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
|
<strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH</strong> <span class="parameter">mode</span><br />
|
||||||
Do not stretch the bitmap for the Welcome and Finish page to fit the size of the
|
See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>
|
||||||
field. Use this option only if you have an image that does not use the whole space.
|
|
||||||
If you have a full size bitmap that fits exactly, you should not use this option
|
|
||||||
because the size of the field will be different if the user has a custom DPI setting.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<h3>
|
||||||
|
|
|
@ -501,7 +501,7 @@ Header file for creating custom installer pages with nsDialogs
|
||||||
|
|
||||||
|
|
||||||
!macro __NSD_LoadAndSetImage _LIHINSTMODE _IMGTYPE _LIHINSTSRC _LIFLAGS CONTROL IMAGE HANDLE
|
!macro __NSD_LoadAndSetImage _LIHINSTMODE _IMGTYPE _LIHINSTSRC _LIFLAGS CONTROL IMAGE HANDLE
|
||||||
|
|
||||||
Push $0
|
Push $0
|
||||||
Push $R0
|
Push $R0
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@ Released on ?, 2014
|
||||||
|
|
||||||
\b Added \R{makensis}{!makensis} command
|
\b Added \R{makensis}{!makensis} command
|
||||||
|
|
||||||
|
\b Added new MUI2 bitmap stretch modes, *_NOSTRETCH is now deprecated (\W{http://sf.net/p/nsis/feature-requests/521}{RFE #521})
|
||||||
|
|
||||||
\b InitiateShutdown is used to reboot the machine if available (\W{http://sf.net/p/nsis/patches/247}{patch #247})
|
\b InitiateShutdown is used to reboot the machine if available (\W{http://sf.net/p/nsis/patches/247}{patch #247})
|
||||||
|
|
||||||
\b Added PPO and SafePPO preprocess-only compiler switches
|
\b Added PPO and SafePPO preprocess-only compiler switches
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue