Prev Previous Post   Next Post Next
Old 14th November 2009, 12:39   #1
dougcvc
Junior Member
 
Join Date: May 2009
Posts: 16
nsdialogs browse for folder

I am trying to create a browse button which brings up a select folder dialog then returns and displays the selection in a text box next to the browse button.

Is there any way of refreshing the nsdialog page?

I have only just started using nsdialogs so theres a lot i still dont understand about it and i have been stuck on this for ages.

Here is some example code which is probably the easiest way to demonstrate it.



code:

Name test
OutFile test.exe
XPStyle on
!include nsDialogs.nsh
Page custom nsDialogsPage
Page instfiles

var /global SOURCE
var /global DEST
var /global BROWSESOURCE
var /global BROWSEDEST
var /global SOURCETEXT
var /global DESTTEXT
Var Dialog


Function nsDialogsPage

#Create Dialog and quit if error
nsDialogs::Create 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}


StrCpy $SOURCE "C:\"
StrCpy $DEST "C:\"

${NSD_CreateLabel} 0 10 100% 12u "Source"
${NSD_CreateText} 0 30 80% 12u "$SOURCE"
pop $SOURCETEXT
${NSD_CreateBrowseButton} 320 30 20% 12u "Browse"
pop $BROWSESOURCE

${NSD_CreateLabel} 0 60 100% 12u "Destination"
${NSD_CreateText} 0 80 80% 12u "$DEST"
pop $DESTTEXT
${NSD_CreateBrowseButton} 320 80 20% 12u "Browse"
pop $BROWSEDEST


${NSD_OnClick} $BROWSESOURCE Browsesource
${NSD_OnClick} $BROWSEDEST Browsedest

nsDialogs::Show
FunctionEnd

Function Browsesource
nsDialogs::SelectFolderDialog "Select Source Folder" "c:\"
pop $SOURCE
FunctionEnd

Function Browsedest
nsDialogs::SelectFolderDialog "Select Destination Folder" "c:\"
Pop $DEST
FunctionEnd

Section ""
SectionEnd



Any suggestions would be great thanks
dougcvc is offline   Reply With Quote
 
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