if change value in textbox , click next button, click button page again, wanna keep new value changed in textbox. how can do?
this code :
acustompage.nsh
!macro create_acustompage app_name cus_fullname page custom create_acustompage leave_acustompage function create_acustompage push $0 strcpy $acustompage.firstopened 0 nsdialogs::create 1018 pop $acustompage getdlgitem $acustompage.button.next $hwndparent 1 system::call user32::getwindowtext(i$acustompage.button.next,t.s,i${nsis_max_strlen}) nsdialogs::createcontrol static ${ws_visible}|${ws_child}|${ws_clipsiblings} 0 0u 0u 100% 20u "${acustompage_title}" pop $acustompage.text ${nsd_creategroupbox} 0u 20u 100% 78% "acustompage setting" pop $acustompage.settingbox ${nsd_createlabel} 10u 50u 20u 11u "url:" pop $acustompage.fullname.label ${nsd_createtext} 60u 50u 60% 11u "" pop $0 ${nsd_onchange} $0 update_acustompage_next_button ${if} ${cus_fullname} != "" ${nsd_settext} $0 ${cus_fullname} ${endif} call update_acustompage_next_button nsdialogs::show functionend function leave_acustompage ${nsd_gettext} $0 $cus_fullname functionend function update_acustompage_next_button push $r5 ${nsd_gettext} $0 $r5 ${if} $r5 != "" enablewindow $acustompage.button.next 1 return ${endif} ${if} $r5 == "" enablewindow $acustompage.button.next 0 return ${endif} pop $r5 functionend !macroend
thanks,
you on right track saving text in $cus_fullname in leave callback never use $cus_fullname set text when creating page, seem try ${cus_fullname} instead!
it should more this:
${nsd_createtext} 60u 50u 60% 11u "${cus_fullname}" pop $0 ${if} $cus_fullname != "" ${nsd_settext} $0 $cus_fullname ${endif} ${nsd_onchange} $0 update_acustompage_next_button
here standalone example:
!include nsdialogs.nsh var hctlfullname var fullname function mypagecreate nsdialogs::create 1018 pop $0 ${nsd_createtext} 60u 30u 60% 11u "$fullname" pop $hctlfullname ${nsd_onchange} $hctlfullname mypage_verifyinput call mypage_verifyinput nsdialogs::show functionend function mypageleave ${nsd_gettext} $hctlfullname $fullname functionend function mypage_verifyinput call mypageleave ; loads text $fullname push $0 getdlgitem $0 $hwndparent 1 ${if} $fullname == "" enablewindow $0 0 ${else} enablewindow $0 1 ${endif} pop $0 functionend page custom mypagecreate mypageleave page components page instfiles section detailprint $fullname sectionend
Comments
Post a Comment