Old 19th February 2013, 14:48   #1
Niharika1588
Junior Member
 
Join Date: Jan 2013
Posts: 19
Data in Textbox

Hi All,

I want to develop an installer, where the user selects an item from the list and in the next page the item the user selects should appear in one of the textboxes. But I was unable to program it that way.

So please have a look at my code :

!include MUI.nsh
!include LogicLib.nsh
!include WinMessages.nsh
!include FileFunc.nsh
!include nsDialogs.nsh

Page custom Trying2print

OutFile "Word.exe"

Var Text
Var Txt1
Var TextBox1
Var b

Function Trying2print
nsDialogs::Create /NOUNLOAD 1018
Pop $0
${NSD_CreateLabel} 1 0 100% 12u "Plz enter the following values.."
Pop $Text
${NSD_CreateLabel} 0 17u 23% 10u "gReleaseNo. : "
Pop $Txt1
${NSD_CreateText} 85 17u 28% 10u ""
Strcpy $b "abc"
Strcpy $TextBox1 $b
Pop $TextBox1
nsDialogs::Show
FunctionEnd


Section ""
SectionEnd


This code works as below :
Takes a textbox and displays the item in the Variable b i..e "abc". But here also the value is not showing in the Textbox but showing it in the Message box if we add the line

MessageBox MB_OK "TextBox1 = $TextBox1"
Niharika1588 is offline   Reply With Quote
Old 19th February 2013, 16:08   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
you're mixing up the window handle with the actual text displayed:

code:
${NSD_CreateText} 85 17u 28% 10u ""
Pop $TextBox1

Strcpy $b "abc"
${NSD_SetText} $TextBox1 $b



but if you want the text to be taken from a dropdown list, you will need an additional onChange function to set the text
Yathosho is offline   Reply With Quote
Old 19th February 2013, 20:15   #3
Niharika1588
Junior Member
 
Join Date: Jan 2013
Posts: 19
Thanks that worked.

I need one more help. I need to get the description of the items that are extracted or copied like in the image

The below code does that :

# define installer name
outFile "installer.exe"

# set desktop as install directory
InstallDir $DESKTOP

# default section start
section

# define output path
setOutPath $INSTDIR

# specify file to go in output path
File forum.vbs

# define uninstaller name
writeUninstaller $INSTDIR\uninstaller.exe

#-------
# default section end
sectionEnd

# create a section to define what the uninstaller does.
# the section will always be named "Uninstall"
section "Uninstall"

# Always delete uninstaller first
delete $INSTDIR\uninstaller.exe

# now delete installed file
delete $INSTDIR\test.txt

sectionEnd


But I should use the below code, to get this done.

!include MUI.nsh
!include LogicLib.nsh
!include WinMessages.nsh
!include FileFunc.nsh
!include nsDialogs.nsh

installDir "C:\work\HUDSYSTEMS\"
Page custom show
Page instfiles

OutFile "POST.exe"

Function show
File forum.vbs
FunctionEnd

Section ""
SectionEnd


Can you please help me out??
Niharika1588 is offline   Reply With Quote
Old 19th February 2013, 21:01   #4
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
not sure if i fully understand what you're looking for, but if want full control over what's displayed in the details box take a look at DetailPrint and SetDetailsPrint

code:
SetDetailsPrint none #hides each File instruction in this example
DetailPrint "Extracting a bunch of files"
File /r *.boring
SetDetailsPrint both #let's show the File instruction again
File /r *.interesting

Yathosho 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