diff --git a/Contrib/nsDialogs/Readme.html b/Contrib/nsDialogs/Readme.html index c2fd2031..a0dafc19 100644 --- a/Contrib/nsDialogs/Readme.html +++ b/Contrib/nsDialogs/Readme.html @@ -666,7 +666,7 @@ SectionEnd

Deletes a string from a list box.

NSD_LB_Clear

-

${NSD_LB_Clear} listbox_HWND $output

+

${NSD_LB_Clear} listbox_HWND

Deletes all strings from a list box.

NSD_LB_GetCount

diff --git a/Contrib/nsDialogs/example.nsi b/Contrib/nsDialogs/example.nsi index b03d3e56..51600745 100644 --- a/Contrib/nsDialogs/example.nsi +++ b/Contrib/nsDialogs/example.nsi @@ -130,7 +130,7 @@ Function LBAction ${EndIf} Return ${Case} "Clear" - ${NSD_LB_Clear} $1 "" + ${NSD_LB_Clear} $1 Return ${EndSelect} diff --git a/Contrib/nsDialogs/nsDialogs.nsh b/Contrib/nsDialogs/nsDialogs.nsh index c7867960..11c7cca8 100644 --- a/Contrib/nsDialogs/nsDialogs.nsh +++ b/Contrib/nsDialogs/nsDialogs.nsh @@ -596,18 +596,6 @@ SendMessage ${CONTROL} ${CB_INSERTSTRING} -1 `STR:${STRING}` !macroend -!define NSD_CB_Clear "!insertmacro _NSD_CB_Clear " -!macro _NSD_CB_Clear CONTROL STRING - SendMessage ${CONTROL} ${CB_RESETCONTENT} 0 0 -!macroend - - -!define NSD_CB_GetCount `!insertmacro __NSD_CB_GetCount ` -!macro __NSD_CB_GetCount CONTROL VAR - SendMessage ${CONTROL} ${CB_GETCOUNT} 0 0 ${VAR} -!macroend - - !define NSD_CB_GetSelectionIndex `!insertmacro __NSD_CB_GetSelectionIndex ` !macro __NSD_CB_GetSelectionIndex CONTROL VAR SendMessage ${CONTROL} ${CB_GETCURSEL} 0 0 ${VAR} @@ -633,6 +621,10 @@ SendMessage ${CONTROL} ${CB_SETITEMDATA} ${INDEX} ${DATA} !define NSD_CB_DelItem `${__NSD_MkCtlCmd_WP} CB_DELETESTRING 0 ` !define NSD_CB_LimitText `${__NSD_MkCtlCmd_WP} CB_LIMITTEXT 0 ` +!define /IfNDef NSD_CB_Clear `${__NSD_MkCtlCmd} CB_RESETCONTENT 0 0 ` +!define /IfNDef NSD_CB_GetCount `${__NSD_MkCtlCmd_RV} CB_RESETCONTENT 0 0 ` +;define /IfNDef NSD_CB_DelString ; /IfNDef to try to stay compatible with +;define /IfNDef NSD_CB_GetSelection ; the ListView header from the Wiki. ### ListBox ### @@ -661,10 +653,8 @@ SendMessage ${CONTROL} ${LB_INSERTSTRING} -1 `STR:${STRING}` !define NSD_LB_DelString `!insertmacro __NSD_LB_DelString ` !macro __NSD_LB_DelString CONTROL STRING - Push $0 - SendMessage ${CONTROL} ${LB_FINDSTRINGEXACT} -1 `STR:${STRING}` $0 - SendMessage ${CONTROL} ${LB_DELETESTRING} $0 0 - Pop $0 + System::Call 'USER32::SendMessage(p${CONTROL},i${LB_FINDSTRINGEXACT},p-1,ts)p.s' `${STRING}` + System::Call 'USER32::SendMessage(p${CONTROL},i${LB_DELETESTRING},ps,p0)' !macroend @@ -674,10 +664,7 @@ SendMessage ${CONTROL} ${LB_INSERTSTRING} -1 `STR:${STRING}` !macroend -!define NSD_LB_Clear `!insertmacro __NSD_LB_Clear ` -!macro __NSD_LB_Clear CONTROL VAR - SendMessage ${CONTROL} ${LB_RESETCONTENT} 0 0 ${VAR} -!macroend +!define NSD_LB_Clear `${__NSD_MkCtlCmd} LB_RESETCONTENT 0 0 ` !define NSD_LB_GetCount `!insertmacro __NSD_LB_GetCount ` diff --git a/Docs/src/history.but b/Docs/src/history.but index ec178702..ffef1332 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -10,6 +10,10 @@ Released on ??? ??rd, 20?? \b Added more NSD controls and macros (\W{http://sf.net/p/nsis/feature-requests/543}{RFE #543}) +\S2{} Minor Changes + +\b Removed unused NSD_LB_Clear macro parameter + \H{v3.02.1} 3.02.1 Released on July 31st, 2017