applied patch #2500960 - NSD_SetIcon support
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5908 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
a8d988b5c0
commit
5a9bbbb021
2 changed files with 68 additions and 11 deletions
|
@ -87,8 +87,12 @@ code
|
|||
<li><a href="#mref-setfocus">NSD_SetFocus</a></li>
|
||||
<li><a href="#mref-setimage">NSD_SetImage</a></li>
|
||||
<li><a href="#mref-setsimage">NSD_SetStretchedImage</a></li>
|
||||
<li><a href="#mref-seticon">NSD_SetIcon</a></li>
|
||||
<li><a href="#mref-seticonfrominstaller">NSD_SetIconFromInstaller</a></li>
|
||||
<li><a href="#mref-clearimage">NSD_ClearImage</a></li>
|
||||
<li><a href="#mref-clearicon">NSD_ClearIcon</a></li>
|
||||
<li><a href="#mref-freeimage">NSD_FreeImage</a></li>
|
||||
<li><a href="#mref-freeicon">NSD_FreeIcon</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#faq">FAQ</a></li>
|
||||
|
@ -862,18 +866,43 @@ SectionEnd</pre></blockquote>
|
|||
|
||||
<p>Loads and displays a bitmap just like <a href="#mref-setimage">${NSD_SetImage}</a>, but stretched the image to fit the control.</p>
|
||||
|
||||
<h3><a name="mref-seticon"></a>NSD_SetIcon</h3>
|
||||
|
||||
<p><code>${NSD_SetIcon} <i>control_HWND</i> <i>image_path</i> <i>output_variable</i></code></p>
|
||||
|
||||
<p>Same as <a href="#mref-setimage">${NSD_SetImage}</a>, but used for loading and setting an icon in a control created by <a href="#mref-create">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freeicon">${NSD_FreeIcon}</a> once no longer necessary.</p>
|
||||
|
||||
<h3><a name="mref-seticonfrominstaller"></a>NSD_SetIconFromInstaller</h3>
|
||||
|
||||
<p><code>${NSD_SetIconFromInstaller} <i>control_HWND</i> <i>output_variable</i></code></p>
|
||||
|
||||
<p>Loads the icon used in the isntaller and displays it on <i>control_HWND</i> created by <a href="#mref-create">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freeicon">${NSD_FreeIcon}</a> once no longer necessary.</p>
|
||||
|
||||
<h3><a name="mref-clearimage"></a>NSD_ClearImage</h3>
|
||||
|
||||
<p><code>${NSD_ClearImage} <i>control_HWND</i></code></p>
|
||||
|
||||
<p>Clears an image from a control.</p>
|
||||
|
||||
<h3><a name="mref-clearicon"></a>NSD_ClearIcon</h3>
|
||||
|
||||
<p><code>${NSD_ClearIcon} <i>control_HWND</i></code></p>
|
||||
|
||||
<p>Clears an icon from a control.</p>
|
||||
|
||||
<h3><a name="mref-freeimage"></a>NSD_FreeImage</h3>
|
||||
|
||||
<p><code>${NSD_FreeImage} <i>image_handle</i></code></p>
|
||||
|
||||
<p>Frees an image handle previously loaded with <a href="#mref-setimage">${NSD_SetImage}</a> or <a href="#mref-setsimage">${NSD_SetStretchedImage}</a>.</p>
|
||||
|
||||
<h3><a name="mref-freeicon"></a>NSD_FreeIcon</h3>
|
||||
|
||||
<p><code>${NSD_FreeIcon} <i>icon_handle</i></code></p>
|
||||
|
||||
<p>Frees an icon handle previously loaded with <a href="#mref-seticon">${NSD_SetIcon}</a> or <a href="#mref-seticonfrominstaller">${NSD_SetIconFromInstaller}</a>.</p>
|
||||
|
||||
|
||||
<h2><a name="faq"></a>FAQ</h2>
|
||||
|
||||
<div>
|
||||
|
@ -892,4 +921,4 @@ SectionEnd</pre></blockquote>
|
|||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -510,16 +510,21 @@ Header file for creating custom installer pages with nsDialogs
|
|||
!define NSD_LB_GetSelection `!insertmacro __NSD_LB_GetSelection`
|
||||
|
||||
|
||||
!macro __NSD_SetImage CONTROL IMAGE HANDLE
|
||||
|
||||
!macro __NSD_LoadAndSetImage _LIHINSTMODE _IMGTYPE _LIHINSTSRC _LIFLAGS CONTROL IMAGE HANDLE
|
||||
|
||||
Push $0
|
||||
Push $R0
|
||||
|
||||
StrCpy $R0 ${CONTROL} # in case ${CONTROL} is $0
|
||||
|
||||
System::Call 'user32::LoadImage(i0, ts, i ${IMAGE_BITMAP}, i0, i0, i${LR_LOADFROMFILE}) i.s' "${IMAGE}"
|
||||
Pop $0
|
||||
SendMessage $R0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $0
|
||||
|
||||
!if "${_LIHINSTMODE}" == "exeresource"
|
||||
System::Call 'kernel32::GetModuleHandle(i0) i.r0'
|
||||
!undef _LIHINSTSRC
|
||||
!define _LIHINSTSRC r0
|
||||
!endif
|
||||
|
||||
System::Call 'user32::LoadImage(i ${_LIHINSTSRC}, ts, i ${_IMGTYPE}, i0, i0, i${_LIFLAGS}) i.r0' "${IMAGE}"
|
||||
SendMessage $R0 ${STM_SETIMAGE} ${_IMGTYPE} $0
|
||||
|
||||
Pop $R0
|
||||
Exch $0
|
||||
|
@ -528,7 +533,21 @@ Header file for creating custom installer pages with nsDialogs
|
|||
|
||||
!macroend
|
||||
|
||||
!define NSD_SetImage `!insertmacro __NSD_SetImage`
|
||||
!macro __NSD_SetIconFromExeResource CONTROL IMAGE HANDLE
|
||||
!insertmacro __NSD_LoadAndSetImage exeresource ${IMAGE_ICON} 0 ${LR_DEFAULTSIZE} "${CONTROL}" "${IMAGE}" ${HANDLE}
|
||||
!macroend
|
||||
|
||||
!macro __NSD_SetIconFromInstaller CONTROL HANDLE
|
||||
!insertmacro __NSD_SetIconFromExeResource "${CONTROL}" "#103" ${HANDLE}
|
||||
!macroend
|
||||
|
||||
!define NSD_SetImage `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_BITMAP} 0 "${LR_LOADFROMFILE}"`
|
||||
!define NSD_SetBitmap `${NSD_SetImage}`
|
||||
|
||||
!define NSD_SetIcon `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_ICON} 0 "${LR_LOADFROMFILE}|${LR_DEFAULTSIZE}"`
|
||||
!define NSD_SetIconFromExeResource `!insertmacro __NSD_SetIconFromExeResource`
|
||||
!define NSD_SetIconFromInstaller `!insertmacro __NSD_SetIconFromInstaller`
|
||||
|
||||
|
||||
!macro __NSD_SetStretchedImage CONTROL IMAGE HANDLE
|
||||
|
||||
|
@ -581,14 +600,23 @@ Header file for creating custom installer pages with nsDialogs
|
|||
!macroend
|
||||
|
||||
!define NSD_FreeImage `!insertmacro __NSD_FreeImage`
|
||||
!define NSD_FreeBitmap `${NSD_FreeImage}`
|
||||
|
||||
!macro __NSD_ClearImage CONTROL
|
||||
!macro __NSD_FreeIcon IMAGE
|
||||
System::Call user32::DestroyIcon(is) ${IMAGE}
|
||||
!macroend
|
||||
|
||||
SendMessage ${CONTROL} ${STM_SETIMAGE} ${IMAGE_BITMAP} 0
|
||||
!define NSD_FreeIcon `!insertmacro __NSD_FreeIcon`
|
||||
|
||||
!macro __NSD_ClearImage _IMGTYPE CONTROL
|
||||
|
||||
SendMessage ${CONTROL} ${STM_SETIMAGE} ${_IMGTYPE} 0
|
||||
|
||||
!macroend
|
||||
|
||||
!define NSD_ClearImage `!insertmacro __NSD_ClearImage`
|
||||
!define NSD_ClearImage `!insertmacro __NSD_ClearImage ${IMAGE_BITMAP}`
|
||||
!define NSD_ClearIcon `!insertmacro __NSD_ClearImage ${IMAGE_ICON}`
|
||||
|
||||
|
||||
!define DEBUG `System::Call kernel32::OutputDebugString(ts)`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue