Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Select Sections and SectionGroups (http://forums.winamp.com/showthread.php?t=249252)

Viesis 21st June 2006 07:20

Select Sections and SectionGroups
 
I have problem. I don't know how to better explain it.
OK, I'll start with section structure:

Section 1
SectionGroup
Section 2 (invisible)
Section 3 (optional)
SectionGroupEnd
Section 4

I have other sections too.

What I want to do is select "SectionGroup" when "Section 3" is selected. For now SectionGroup gets selected only partially (thus leaving "Section 2" unselected).

I tried to create .onSelChange function to check if "Section 3" is selected and if it is select "SectionGrop" as well.
code:

!include Sections.nsh
Function .onSelChange
!insertmacro SectionFlagIsSet "Section 3" SF_SELECTED set notset
set:
!insertmacro SelectSection SectionGroup
notset:
FunctionEnd



It didn't work. Can someone tell me what I am doing wrong?

Afrow UK 21st June 2006 09:30

"Section 3" is not a Section index define, but the Section caption right?
You define Section index constants like so:
Section "Section 3" Sec3
SectionGroup "My Group" SecGroup1

${Sec3} and ${SecGroup1} will contain the section indexes for those sections which you can use with all the Section instructions and macros.

Also make sure you place that Function below all your Sections.

Your code should look something like this:
code:

!include Sections.nsh
Function .onSelChange
!insertmacro SectionFlagIsSet ${Section3} SF_SELECTED set notset
set:
!insertmacro SelectSection ${SectionGroup}
notset:
FunctionEnd



-Stu

Viesis 21st June 2006 10:21

I didn't make myself clear for the first time, sorry for that.

It was meant as section index, I just wanted to make it more simple in this post.

I tried to put it into code like this: ${Index}, Index, "Index", ${"Index"}. None of them worked for me.

--Text deleted by user--

I had to put function below all sections, I skiped that in Your reply.

Thanks.

But now I can't unselect my section or section group...

Afrow UK 21st June 2006 11:05

Also you probably know this but SF_SELECTED -> ${SF_SELECTED}
To sort that out you'd probably have to check if the SectionGroup us selected first and then skip the code if it is.

-Stu

Viesis 21st June 2006 11:19

Thanks, it works (I checked if SectionGroup is partially selected)

Thank You for time You dedicated to me.


All times are GMT. The time now is 05:48.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.