Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- nsd combo callback bug workaround
- ---------------------------------
- A normal combobox onchange callback fails if you do:
- 1) Select item from dropdown
- 2) Append something to the string
- Maybe nsdialogs needs to use CBN_EDITCHANGE and not CBN_EDITUPDATE?
- */
- !include nsDialogs.nsh
- var myCombo
- function oncbchange
- pop $0
- ${If} $0 = 0
- GetFunctionAddress $0 ${__FUNCTION__}
- nsDialogs::KillTimer $0
- pop $0
- ;in a bug free NSD world, this would be the real handler:
- ${If} $0 = $myCombo
- ${NSD_GetText} $0 $1
- MessageBox mb_ok combotext=$1
- ${EndIf}
- ${Else}
- ${If} $0 = $myCombo
- ;${OrIf} $0 = $myCombo2 etc...
- push $0
- push 0
- GetFunctionAddress $0 ${__FUNCTION__}
- nsDialogs::CreateTimer $0 1
- ${EndIf}
- ${EndIf}
- functionend
- function nsdPage
- nsDialogs::Create 1018
- Pop $0
- ${NSD_CreateComboBox} 0 13u 100% -13u "hello"
- Pop $myCombo
- ${NSD_CB_AddString} $myCombo foo
- ${NSD_CB_AddString} $myCombo bar
- ${NSD_OnChange} $myCombo oncbchange
- nsDialogs::Show
- functionend
- page custom nsdPage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement