applied patch #2041919 - nsDialogs: controls for listboxes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5695 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-08-15 17:07:14 +00:00
parent 695530d8ae
commit bbebb7cef4
2 changed files with 63 additions and 0 deletions

View file

@ -75,7 +75,11 @@ code
<li><a href="#mref-cbaddstring">NSD_CB_AddString</a></li>
<li><a href="#mref-cbselectstring">NSD_CB_SelectString</a></li>
<li><a href="#mref-lbaddstring">NSD_LB_AddString</a></li>
<li><a href="#mref-lbdelstring">NSD_LB_DelString</a></li>
<li><a href="#mref-lbclear">NSD_LB_Clear</a></li>
<li><a href="#mref-lbgetcount">NSD_LB_GetCount</a></li>
<li><a href="#mref-lbselectstring">NSD_LB_SelectString</a></li>
<li><a href="#mref-lbgetselection">NSD_LB_GetSelection</a></li>
<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>
@ -727,12 +731,36 @@ SectionEnd</pre></blockquote>
<p>Adds a string to a list box.</p>
<h3><a name="mref-lbdelstring"></a>NSD_LB_DelString</h3>
<p><code>${NSD_LB_DelString} <i>combo_HWND</i> <i>string</i></code></p>
<p>Deletes a string from a list box.</p>
<h3><a name="mref-lbcleqar">NSD_LB_Clear</a></h3>
<p><code>${NSD_LB_Clear} <i>combo_HWND</i></code></p>
<p>Deletes all strings from a list box.</p>
<h3><a name="mref-lbgetcount">NSD_LB_GetCount</a></h3>
<p><code>${NSD_LB_GetCount} <i>combo_HWND</i> <i>output_variable</i></code></p>
<p>Retrieves the number of strings from a list box.</p>
<h3><a name="mref-lbselectstring"></a>NSD_LB_SelectString</h3>
<p><code>${NSD_LB_SelectString} <i>combo_HWND</i> <i>string</i></code></p>
<p>Selects a string in a list box.</p>
<h3><a name="mref-lbgetselection">NSD_LB_GetSelection</a></h3>
<p><code>${NSD_LB_GetSelection} <i>combo_HWND</i> <i>output_variable</i></code></p>
<p>Retrieves the selected stringed from a list box. Returns an empty string if no string is selected.</p>
<h3><a name="mref-setfocus"></a>NSD_SetFocus</h3>
<p><code>${NSD_SetFocus} <i>control_HWND</i></code></p>

View file

@ -436,6 +436,30 @@ Header file for creating custom installer pages with nsDialogs
!define NSD_LB_AddString "!insertmacro _NSD_LB_AddString"
!macro __NSD_LB_DelString CONTROL STRING
SendMessage ${CONTROL} ${LB_DELETESTRING} 0 `STR:${STRING}`
!macroend
!define NSD_LB_DelString `!insertmacro __NSD_LB_DelString`
!macro __NSD_LB_Clear CONTROL VAR
SendMessage ${CONTROL} ${LB_RESETCONTENT} 0 0 ${VAR}
!macroend
!define NSD_LB_Clear `!insertmacro __NSD_LB_Clear`
!macro __NSD_LB_GetCount CONTROL VAR
SendMessage ${CONTROL} ${LB_GETCOUNT} 0 0 ${VAR}
!macroend
!define NSD_LB_GetCount `!insertmacro __NSD_LB_GetCount`
!macro _NSD_LB_SelectString CONTROL STRING
SendMessage ${CONTROL} ${LB_SELECTSTRING} -1 `STR:${STRING}`
@ -444,6 +468,17 @@ Header file for creating custom installer pages with nsDialogs
!define NSD_LB_SelectString "!insertmacro _NSD_LB_SelectString"
!macro __NSD_LB_GetSelection CONTROL VAR
SendMessage ${CONTROL} ${LB_GETCURSEL} 0 0 ${VAR}
System::Call 'user32::SendMessage(i ${CONTROL}, i ${LB_GETTEXT}, i ${VAR}, t .s)'
Pop ${VAR}
!macroend
!define NSD_LB_GetSelection `!insertmacro __NSD_LB_GetSelection`
!macro __NSD_SetImage CONTROL IMAGE HANDLE
Push $0