patch #1900588 - More nsDialogs macros

- NSD_AddStyle
 - NSD_AddExStyle
 - NSD_SetTextLimit
 - NSD_CB_AddString
 - NSD_CB_SelectString
 - NSD_LB_AddString
 - NSD_LB_SelectString

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5581 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-03-29 17:32:24 +00:00
parent 35187d2230
commit 2bb286bfe4
2 changed files with 122 additions and 0 deletions

View file

@ -63,12 +63,19 @@ code
<li><a href="#mref-onchange">NSD_OnChange</a></li>
<li><a href="#mref-onclick">NSD_OnClick</a></li>
<li><a href="#mref-onnotify">NSD_OnNotify</a></li>
<li><a href="#mref-addstyle">NSD_AddStyle</a></li>
<li><a href="#mref-addexstyle">NSD_AddExStyle</a></li>
<li><a href="#mref-gettext">NSD_GetText</a></li>
<li><a href="#mref-settext">NSD_SetText</a></li>
<li><a href="#mref-settextlimit">NSD_SetTextLimit</a></li>
<li><a href="#mref-getstate">NSD_GetState</a></li>
<li><a href="#mref-setstate">NSD_SetState</a></li>
<li><a href="#mref-check">NSD_Check</a></li>
<li><a href="#mref-uncheck">NSD_Uncheck</a></li>
<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-lbselectstring">NSD_LB_SelectString</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>
@ -636,6 +643,22 @@ SectionEnd</pre></blockquote>
<p>See <a href="#ref-onnotify">OnNotify</a> for more details.</p>
<h3><a name="mref-addstyle"></a>NSD_AddStyle</h3>
<p><code>${NSD_AddStyle} <i>control_HWND</i> <i>style</i></code></p>
<p>Adds one or more window style to a control. Multiple styles should be separated with pipes `|'.</p>
<p>See MSDN for style description.</p>
<h3><a name="mref-addexstyle"></a>NSD_AddExStyle</h3>
<p><code>${NSD_AddExStyle} <i>control_HWND</i> <i>style</i></code></p>
<p>Adds one or more extended window style to a control. Multiple styles should be separated with pipes `|'.</p>
<p>See MSDN for style description.</p>
<h3><a name="mref-gettext"></a>NSD_GetText</h3>
<p><code>${NSD_GetText} <i>control_HWND</i> <i>output_variable</i></code></p>
@ -650,6 +673,12 @@ SectionEnd</pre></blockquote>
<p>Sets the text of a control.</p>
<h3><a name="mref-settextlimit"></a>NSD_SetTextLimit</h3>
<p><code>${NSD_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>
<p>Sets input size limit for a text control.</p>
<h3><a name="mref-getstate"></a>NSD_GetState</h3>
<p><code>${NSD_GetState} <i>control_HWND</i> <i>output_variable</i></code></p>
@ -680,6 +709,30 @@ SectionEnd</pre></blockquote>
<p>See <a href="#step-memory">Memory</a> for usage example.</p>
<h3><a name="mref-cbaddstring"></a>NSD_CB_AddString</h3>
<p><code>${NSD_CB_AddString} <i>combo_HWND</i> <i>string</i></code></p>
<p>Adds a string to a combo box.</p>
<h3><a name="mref-cbselectstring"></a>NSD_CB_SelectString</h3>
<p><code>${NSD_CB_SelectString} <i>combo_HWND</i> <i>string</i></code></p>
<p>Selects a string in a combo box.</p>
<h3><a name="mref-lbaddstring"></a>NSD_LB_AddString</h3>
<p><code>${NSD_LB_AddString} <i>combo_HWND</i> <i>string</i></code></p>
<p>Adds a string to 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-setfocus"></a>NSD_SetFocus</h3>
<p><code>${NSD_SetFocus} <i>control_HWND</i></code></p>

View file

@ -171,6 +171,9 @@ Header file for creating custom installer pages with nsDialogs
!define IMAGE_CURSOR 2
!define IMAGE_ENHMETAFILE 3
!define GWL_STYLE -16
!define GWL_EXSTYLE -20
!define DEFAULT_STYLES ${WS_CHILD}|${WS_VISIBLE}|${WS_CLIPSIBLINGS}
!define __NSD_HLine_CLASS STATIC
@ -301,6 +304,32 @@ Header file for creating custom installer pages with nsDialogs
!insertmacro __NSD_DefineCallback Notify
!insertmacro __NSD_DefineCallback Back
!macro _NSD_AddStyle CONTROL STYLE
Push $0
System::Call "user32::GetWindowLong(i ${CONTROL}, i ${GWL_STYLE}) i .r0"
System::Call "user32::SetWindowLong(i ${CONTROL}, i ${GWL_STYLE}, i $0|${STYLE})"
Pop $0
!macroend
!define NSD_AddStyle "!insertmacro _NSD_AddStyle"
!macro _NSD_AddExStyle CONTROL EXSTYLE
Push $0
System::Call "user32::GetWindowLong(i ${CONTROL}, i ${GWL_EXSTYLE}) i .r0"
System::Call "user32::SetWindowLong(i ${CONTROL}, i ${GWL_EXSTYLE}, i $0|${EXSTYLE})"
Pop $0
!macroend
!define NSD_AddExStyle "!insertmacro _NSD_AddExStyle"
!macro __NSD_GetText CONTROL VAR
System::Call user32::GetWindowText(i${CONTROL},t.s,i${NSIS_MAX_STRLEN})
@ -318,6 +347,14 @@ Header file for creating custom installer pages with nsDialogs
!define NSD_SetText `!insertmacro __NSD_SetText`
!macro _NSD_SetTextLimit CONTROL LIMIT
SendMessage ${CONTROL} ${EM_SETLIMITTEXT} ${LIMIT} 0
!macroend
!define NSD_SetTextLimit "!insertmacro _NSD_SetTextLimit"
!macro __NSD_GetState CONTROL VAR
SendMessage ${CONTROL} ${BM_GETCHECK} 0 0 ${VAR}
@ -358,6 +395,38 @@ Header file for creating custom installer pages with nsDialogs
!define NSD_SetFocus `!insertmacro __NSD_SetFocus`
!macro _NSD_CB_AddString CONTROL STRING
SendMessage ${CONTROL} ${CB_ADDSTRING} 0 `STR:${STRING}`
!macroend
!define NSD_CB_AddString "!insertmacro _NSD_CB_AddString"
!macro _NSD_CB_SelectString CONTROL STRING
SendMessage ${CONTROL} ${CB_SELECTSTRING} -1 `STR:${STRING}`
!macroend
!define NSD_CB_SelectString "!insertmacro _NSD_CB_SelectString"
!macro _NSD_LB_AddString CONTROL STRING
SendMessage ${CONTROL} ${LB_ADDSTRING} 0 `STR:${STRING}`
!macroend
!define NSD_LB_AddString "!insertmacro _NSD_LB_AddString"
!macro _NSD_LB_SelectString CONTROL STRING
SendMessage ${CONTROL} ${LB_SELECTSTRING} -1 `STR:${STRING}`
!macroend
!define NSD_LB_SelectString "!insertmacro _NSD_LB_SelectString"
!macro __NSD_SetImage CONTROL IMAGE HANDLE
Push $0