Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   MUI_PAGE_COMPONENTS + group controls (http://forums.winamp.com/showthread.php?t=379500)

hanen.jomaa 9th October 2014 08:48

MUI_PAGE_COMPONENTS + group controls
 
Hi,

I use MUI_PAGE_COMPONENTS to 4 for sections, it works very well.

Just I want to have two groups in my page section, can I disable 3 sections if the fourth section was checked or disable the fourth section if the other sections are checked ?

please can you help me

thx :)

jiake 21st November 2014 06:07

I don't understand what you want.

1. If you want to disable one section by settings on a previous page, e.g. createing a custom page that show some options, and one of them make a component will be shown. Set the section name start with a minus sign, it will be hidden by default.
code:
Section /o "-dummy_sec_name" DUMMY_SEC_ID
; Some script
SectionEnd


In the pre-function of components page, if the condition is established, using SectionSetText to set ${DUMMY_SEC_ID} a name without prefixed minus sign, it will show.
code:
Page components Components.Pre
Function Components.Pre
${If} ...
SectionGetFlags ${DUMMY_SEC_ID} $R0
IntOp $R0 $R0 | ${SF_SELECTED}
SectionSetFlags ${DUMMY_SEC_ID} $R0
SectionSetText ${DUMMY_SEC_ID} "New Section Name"
${EndIf}
FunctionEnd


2. If you want to change the state of a section when other setions' state are changing, you can use SectionGetFlags and SectionSetFlags in function .onSelChange.
code:
Section "dummy_sec_1" DUMMY_SEC_1
; Some script
SectionEnd

Section "dummy_sec_2" DUMMY_SEC_2
; Some script
SectionEnd

Function .onSelChange
Push $R0
Push $R1
SectionGetFlags ${DUMMY_SEC_1} $R0
SectionGetFlags ${DUMMY_SEC_2} $R1
IntOp $R0 $R0 & ${SF_SELECTED}
${If} $R0 <> 0
IntOp $R1 $R1 | ${SF_SELECTED}
${Else}
IntOp $R1 $R1 & ${SECTION_OFF}
${EndIf}
SectionSetFlags ${DUMMY_SEC_2} $R1
Pop $R1
Pop $R0
FunctionEnd



All times are GMT. The time now is 17:20.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.