zoukankan      html  css  js  c++  java
  • nsis RadioButton

    ; one-section.nsi
    ;
    ; This example demonstrates how to control section selection.
    ; It allows only one of the sections of a group to be selected.

    ;--------------------------------

    ; Section define/macro header file
    ; See this header file for more info

    !include "MUI.nsh"
    !include "Sections.nsh"

    Name "One Section"
    OutFile "one-section.exe"
    RequestExecutionLevel user

    ;--------------------------------

    BrandingText "Copyright (C) 2011 alex"


    ;--------------------------------

    ; Pages
    ; »¶Ó­Ò³Ãæ
    !insertmacro MUI_PAGE_WELCOME
    ; ×é¼þÑ¡ÔñÒ³Ãæ
    !insertmacro MUI_PAGE_COMPONENTS
    ;Page components

    ;--------------------------------

    ; Sections

    ;Section !Required
    ;  SectionIn RO
    ;SectionEnd

    SubSection "Group 1 - Option 1" g1o1
      Section "test1" o1t1
      SectionEnd
      Section "test2" o1t2
      SectionEnd
      Section "test3" o1t3
      SectionEnd
    SubSectionEnd


    Section /o "Group 1 - Option 2" g1o2
    SectionEnd

    Section /o "Group 1 - Option 3" g1o3
    SectionEnd

    Section "Group 2 - Option 1" g2o1
    SectionEnd

    Section /o "Group 2 - Option 2" g2o2
    SectionEnd

    Section /o "Group 2 - Option 3" g2o3
    SectionEnd

    ; °²×°Ä¿Â¼Ñ¡ÔñÒ³Ãæ
    !insertmacro MUI_PAGE_DIRECTORY
    ; °²×°¹ý³ÌÒ³Ãæ
    !insertmacro MUI_PAGE_INSTFILES
    ;!define MUI_PAGE_CUSTOMFUNCTION_SHOW Show
    ;!define MUI_PAGE_CUSTOMFUNCTION_LEAVE Leave
    ; °²×°Íê³ÉÒ³Ãæ
    !insertmacro MUI_PAGE_FINISH

    ; °²×°½çÃæ°üº¬µÄÓïÑÔÉèÖÃ
    !insertmacro MUI_LANGUAGE "SimpChinese"

    ;Function Show
    ;FunctionEnd

    ;Function Leave
    ;FunctionEnd

    Section -Setup
    SectionEnd

    Section -AdditionalIcons
    SectionEnd

    Section -Post
    SectionEnd

    Section Uninstall

      SetAutoClose true
    SectionEnd

    ;--------------------------------

    ; Functions

    ; $1 stores the status of group 1
    ; $2 stores the status of group 2

    Function .onInit
     #--ÉèÖÃg1o1Ϊֻ¶Á--
     SectionGetFlags "${g1o1}" $R0                 ; ȡԭ¸¸ÏîµÄ±êÖ¾Öµ
     IntOp $R0 $R0 + 15                             ; ¼ÓÉÏ 15£¬Ê¹¸¸Ïî±ä³ÉÖ»¶Á
     SectionSetFlags "${g1o1}" $R0


    ; SectionSetFlags ${o1t1} ${SF_SelectED}        ; ÉèÖÃÑ¡ÖÐ״̬
    ;  StrCpy $1 ${o1t1} ; Group 1 - Option 1 is selected by default
     SectionSetFlags ${g1o3} ${SF_SelectED}        ; ÉèÖÃÑ¡ÖÐ״̬
      StrCpy $1 ${g1o3} ; Group 1 - Option 1 is selected by default
      StrCpy $2 ${g2o2} ; Group 2 - Option 1 is selected by default

    FunctionEnd

    Function .onSelChange

      !insertmacro StartRadioButtons $1
        !insertmacro RadioButton ${g1o1}
        !insertmacro RadioButton ${g1o2}
        !insertmacro RadioButton ${g1o3}
      !insertmacro EndRadioButtons

      !insertmacro StartRadioButtons $1
        !insertmacro RadioButton ${o1t1}
        !insertmacro RadioButton ${o1t2}
        !insertmacro RadioButton ${o1t3}
      !insertmacro EndRadioButtons

     
      !insertmacro StartRadioButtons $2
        !insertmacro RadioButton ${g2o1}
        !insertmacro RadioButton ${g2o2}
        !insertmacro RadioButton ${g2o3}
      !insertmacro EndRadioButtons
     
    FunctionEnd

  • 相关阅读:
    Codeforces 845E Fire in the City 线段树
    Codeforces 542D Superhero's Job dp (看题解)
    Codeforces 797F Mice and Holes dp
    Codeforces 408D Parcels dp (看题解)
    Codeforces 464D World of Darkraft
    Codeforces 215E Periodical Numbers 容斥原理
    Codeforces 285E Positions in Permutations dp + 容斥原理
    Codeforces 875E Delivery Club dp
    Codeforces 888F Connecting Vertices 区间dp (看题解)
    Codeforces 946F Fibonacci String Subsequences dp (看题解)
  • 原文地址:https://www.cnblogs.com/zdxster/p/2013169.html
Copyright © 2011-2022 走看看