Old 9th October 2014, 08:48   #1
hanen.jomaa
Junior Member
 
Join Date: Mar 2013
Posts: 23
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
hanen.jomaa is offline   Reply With Quote
Old 21st November 2014, 06:07   #2
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
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


Contact me: 137729898@qq.com
jiake 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