Old 23rd September 2008, 03:55   #1
chuckler
Junior Member
 
Join Date: Jun 2008
Posts: 7
Saving User Data on back

Hi,
I am wondering if anyone knows how I could set the values of text fields when the user presses the back button..
something like this:

code:

Function OnChange
Pop $0 ; HWND
System::Call user32::GetWindowText(i$Text_ccip,t.r0,i${NSIS_MAX_STRLEN})
Strcpy $CCIP $0
FunctionEnd

; on the bottom of my verification page i have the
; following code just before the end of the custom page
; function

; GetFunctionAddress $clnow clearnow
; nsDialogs::OnBack /NOUNLOAD $clnow
; nsDialogs::Show /NOUNLOAD
;FunctionEnd

Function clearnow
nsDialogs::SetUserData /NOUNLOAD $Text_ccip $CCIP
${NSD_SetText} $Text_ccip $CCIP
Strcpy $Text_ccip $CCIP

FunctionEnd




I am saving value entererd in the above text box into $CCIP.
when the user presses the back button the text fields (here text_ccip gets cleared. I want the user entered data to remain in the text box on pressing the back button. how could I use either the above or NSD_getstate? Any suggestions?
chuckler is offline   Reply With Quote
Old 23rd September 2008, 04:42   #2
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
this is taken from the Memory section of the nsDialogs section of the manual and modified with your vars (I think)
anyways it compiles fine and does save the text in the text box when they click back

code:

!include nsDialogs.nsh
!include LogicLib.nsh

Name "nsDialogs Example"
OutFile "nsDialogs Example.exe"


Var Text_ccip
Var Text_ccip_State

Page custom nsDialogsPage nsDialogsPageLeave
Page directory ;--need a page to go back from


Function nsDialogsPage

nsDialogs::Create /NOUNLOAD 1018
Pop $0

${NSD_CreateText} 10u 60u -20u 13u $Text_ccip_State
Pop $Text_ccip


nsDialogs::Show

FunctionEnd


Function nsDialogsPageLeave

${NSD_GetText} $Text_ccip $Text_ccip_State


FunctionEnd


Section
;blank section
SectionEnd

ZmAn3 is offline   Reply With Quote
Old 23rd September 2008, 05:29   #3
chuckler
Junior Member
 
Join Date: Jun 2008
Posts: 7
Hi, thx for your reply..
I tried the above code but it did not work..
Have attached the script i wrote...
it's a messy script so i apologize for the aesthetics/logic.

Suggestions are welcome.

Thanks
Attached Files
File Type: nsi service_install.nsi (26.4 KB, 372 views)
chuckler is offline   Reply With Quote
Old 23rd September 2008, 08:16   #4
chuckler
Junior Member
 
Join Date: Jun 2008
Posts: 7
Solved

Solved:

I was calling nsdialogs:: onback unecessarily in the script. @ZmAn3: your code works.
Thanks.

Faheem
chuckler is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump