home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Examples / one-section.nsi < prev    next >
Text File  |  2003-12-24  |  2KB  |  78 lines

  1. ; one-section.nsi
  2. ;
  3. ; This example demonstrates how to control section selection.
  4. ; It allows only one of the sections of a group to be selected.
  5.  
  6. ;--------------------------------
  7.  
  8. ; Section define/macro header file
  9. ; See this header file for more info
  10.  
  11. !include "Sections.nsh"
  12.  
  13. ;--------------------------------
  14.  
  15. Name "One Section"
  16. OutFile "one-section.exe"
  17.  
  18. ;--------------------------------
  19.  
  20. ; Pages
  21.  
  22. Page components
  23.  
  24. ;--------------------------------
  25.  
  26. ; Sections
  27.  
  28. Section !Required
  29.   SectionIn RO
  30. SectionEnd
  31.  
  32. Section "Group 1 - Option 1" g1o1
  33. SectionEnd
  34.  
  35. Section /o "Group 1 - Option 2" g1o2
  36. SectionEnd
  37.  
  38. Section /o "Group 1 - Option 3" g1o3
  39. SectionEnd
  40.  
  41. Section "Group 2 - Option 1" g2o1
  42. SectionEnd
  43.  
  44. Section /o "Group 2 - Option 2" g2o2
  45. SectionEnd
  46.  
  47. Section /o "Group 2 - Option 3" g2o3
  48. SectionEnd
  49.  
  50. ;--------------------------------
  51.  
  52. ; Functions
  53.  
  54. ; $1 stores the status of group 1
  55. ; $2 stores the status of group 2
  56.  
  57. Function .onInit
  58.  
  59.   StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default
  60.   StrCpy $2 ${g2o1} ; Group 2 - Option 1 is selected by default
  61.  
  62. FunctionEnd
  63.  
  64. Function .onSelChange
  65.  
  66.   !insertmacro StartRadioButtons $1
  67.     !insertmacro RadioButton ${g1o1}
  68.     !insertmacro RadioButton ${g1o2}
  69.     !insertmacro RadioButton ${g1o3}
  70.   !insertmacro EndRadioButtons
  71.     
  72.   !insertmacro StartRadioButtons $2
  73.     !insertmacro RadioButton ${g2o1}
  74.     !insertmacro RadioButton ${g2o2}
  75.     !insertmacro RadioButton ${g2o3}
  76.   !insertmacro EndRadioButtons
  77.     
  78. FunctionEnd