From 87269acd796c7d6c4d7ad3c2d5b32010471de94f Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 2 Oct 2002 16:59:40 +0000 Subject: [PATCH] Now with the new flag values git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1274 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/one-section.nsi | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/Examples/one-section.nsi b/Examples/one-section.nsi index b7591834..e09db3f5 100644 --- a/Examples/one-section.nsi +++ b/Examples/one-section.nsi @@ -3,6 +3,15 @@ OutFile setup.exe ComponentText "please choose just one but the default" +!define SF_SELECTED 1 +!define SF_SUBSEC 2 +!define SF_SUBSECEND 4 +!define SF_BOLD 8 +!define SF_RO 16 +!define SF_EXPAND 32 + +!define SECTION_OFF 0xFFFFFFFE + Section !Required SectionIn RO SectionEnd @@ -19,15 +28,12 @@ SectionEnd Section "optional #4" sec4 SectionEnd -!define SECTION_ON 0x80000000 -!define SECTION_OFF 0x7FFFFFFF - Function .onInit Push $0 StrCpy $1 ${sec1} ; Gotta remember which section we are at now... SectionGetFlags ${sec1} $0 - IntOp $0 $0 | ${SECTION_ON} + IntOp $0 $0 | ${SF_SELECTED} SectionSetFlags ${sec1} $0 SectionGetFlags ${sec2} $0 @@ -58,25 +64,25 @@ Function .onSelChange StrCpy $2 $1 SectionGetFlags ${sec1} $0 - IntOp $0 $0 & ${SECTION_ON} - IntCmp $0 ${SECTION_ON} 0 +2 +2 + IntOp $0 $0 & ${SF_SELECTED} + IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${sec1} SectionGetFlags ${sec2} $0 - IntOp $0 $0 & ${SECTION_ON} - IntCmp $0 ${SECTION_ON} 0 +2 +2 + IntOp $0 $0 & ${SF_SELECTED} + IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${sec2} SectionGetFlags ${sec3} $0 - IntOp $0 $0 & ${SECTION_ON} - IntCmp $0 ${SECTION_ON} 0 +2 +2 + IntOp $0 $0 & ${SF_SELECTED} + IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${sec3} SectionGetFlags ${sec4} $0 - IntOp $0 $0 & ${SECTION_ON} - IntCmp $0 ${SECTION_ON} 0 +2 +2 + IntOp $0 $0 & ${SF_SELECTED} + IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${sec4} StrCmp $2 $1 0 +4 ; selection hasn't changed SectionGetFlags $1 $0 - IntOp $0 $0 | ${SECTION_ON} + IntOp $0 $0 | ${SF_SELECTED} SectionSetFlags $1 $0 Pop $2 Pop $0