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

@ -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