Old 7th September 2011, 12:52   #1
benjohnson
Junior Member
 
Join Date: Dec 2010
Posts: 7
Dialogs - go to certain pages

Hi All,

Having a bit of trouble getting along with nsDialogs. I want a page to show up at the start (no trouble) and then only display a certain page if a specific button is pressed.

My code will become quite complex at the end with lots of different pathways depending on what you click so I thought I would start off simple but I can't get it going. I've attached my code. The code compiles OK but when I run the file and press the button I get 'Dialogs.exe has stopped working'.

I want to use nsDialogs because it gives lots of control over the layout.

I'm sure that I'm doing something daft, I started from the examples but may be trying to do things the wrong way.

Thanks for any help.
Cheers,
Ben
Attached Files
File Type: nsi Dialogs.nsi (922 Bytes, 206 views)
benjohnson is offline   Reply With Quote
Old 7th September 2011, 14:25   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can't show a nsDialogs page just by calling a show function. It doesn't work that way.

http://nsis.sourceforge.net/Go_to_a_NSIS_page

Stu
Afrow UK is offline   Reply With Quote
Old 7th September 2011, 15:01   #3
benjohnson
Junior Member
 
Join Date: Dec 2010
Posts: 7
Great, thanks, I knew I was doing something daft.

So using RelGotoPage will take me forward or back a number of pages by using certain number, is there anyway to do it by name?
benjohnson is offline   Reply With Quote
Old 7th September 2011, 16:06   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,321
Quote:
Originally Posted by benjohnson View Post
Great, thanks, I knew I was doing something daft.

So using RelGotoPage will take me forward or back a number of pages by using certain number, is there anyway to do it by name?
Name? Pages don't have names (You can use a page type multiple times)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th September 2011, 16:47   #5
benjohnson
Junior Member
 
Join Date: Dec 2010
Posts: 7
Each nsDialog page has a name though, is there any way to jump to those particular pages?
benjohnson is offline   Reply With Quote
Old 7th September 2011, 17:45   #6
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
No, you can only make relative jumps. What you can do is add a !define page_components 1 etc for each page, and then calculate the relative distance by subtracting the two defines. This way whenever you change the page order, or add/remove pages from your script, you only need to make changes to the defines, not to every single page jump command in your script.
MSG is offline   Reply With Quote
Old 7th September 2011, 22:57   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,321
Quote:
Originally Posted by benjohnson View Post
Each nsDialog page has a name though...
No?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th September 2011, 12:41   #8
benjohnson
Junior Member
 
Join Date: Dec 2010
Posts: 7
Solution, kind of

Just thought I would update how I managed to solve this in case it might help someone else.

I put a bit of code in before I created my nsDialogs page which would abort the page if a value wasn't met, it would then move on to the next one. It was a bit of a bodge, but it did the trick.

code:
Function PageName
${If} $pageRequested != "PageName" ; if $pageRequested doesn't match the title of the page, don't show the page, move onto next page.
Abort
${EndIf}
nsDialogs::Create 1018
.....



I would use StrCpy to define the variable before loading the next page, using the page Leave function.
benjohnson is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
nsdialogs, pages

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