• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Disabling cyclic field based on the radio field input in...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 13606
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Disabling cyclic field based on the radio field input in a form

ssram
ssram over 6 years ago

Hi,

I've the following code where i'm trying to get the values of 

srMfgGridForm~>useMfgGridYN~>value

srMfgGridForm~>UserGridOptions~>value

through a form. The form has got a radio field (with "Yes" & "No") and a cyclic field. How can i disable the cyclic field when "Yes" is selected by the user on the radio field?

Thanks

Ram

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

procedure(srFixOffGridForm()

UseMfgGridYesNo = hiCreateGridLayout( 'UseMfgGridYesNo ;?frame "Select either one of the grids below"
?items list(
list( hiCreateLabel( ?name 'useMfgGridYNLabel ?labelText "Use Manufacturing Grid (Y/N) ? : " ) 'row 1 'col 0 )
list( hiCreateRadioField(
?name 'useMfgGridYN
?value ""
?defValue "Yes"
?choices list("Yes" "No")) 'row 1 'col 1)
list( 'col_stretch 1 1 )
))

UserGridOptions = hiCreateCyclicField(
?name 'UserGridOptions
?prompt "Custom Grid Options : "
?choices list( "" "0.01" "0.001" "0.0001" "0.00025" "0.005" "0.0005" )
?value ""
?defValue ""
?enabled t
?invisible nil
)

srMfgGridField = hiCreateFormLayout('page1 ?items list(UseMfgGridYesNo UserGridOptions) )

layout = hiCreateFormLayout(
'MyFormGridFix
?items list( srMfgGridField )
)

srMfgGridForm = hiCreateLayoutForm(
'srMfgGridForm "Fix Off Grid" layout
?unmapAfterCB nil
?initialSize '(100 100)
?callback "srFixOffGrid()"
?buttonLayout 'OKCancelDef
)

UseMfgGridYesNoValue = srMfgGridForm~>useMfgGridYN~>value
UserGridOptionsValue = srMfgGridForm~>UserGridOptions~>value

hiInstantiateForm( srMfgGridForm )
hiDisplayForm( srMfgGridForm )

);procedure

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  • Cancel
Parents
  • skillUser
    skillUser over 6 years ago

    Hi,

    Add a callback function like this:

    
    procedure(srMfgGridRadioCB(field form value)
      if(value=="Yes"
        putpropq(getq(form UserGridOptions) nil enabled)
        putpropq(getq(form UserGridOptions) t enabled)
      )
    )
    

    And also change the field definition to use it (and also make the default state of the other field match the default state of this field):

    
    UseMfgGridYesNo = hiCreateGridLayout( 'UseMfgGridYesNo ;?frame "Select either one of the grids below"
    ?items list(
    list( hiCreateLabel( ?name 'useMfgGridYNLabel ?labelText "Use Manufacturing Grid (Y/N) ? : " ) 'row 1 'col 0 )
    list( hiCreateRadioField(
    ?name 'useMfgGridYN 
    ?value "" 
    ?defValue "Yes"
    ?callback list('srMfgGridRadioCB)
    ?choices list("Yes" "No")) 'row 1 'col 1)
    list( 'col_stretch 1 1 )
    ))
    
    UserGridOptions = hiCreateCyclicField(
    ?name 'UserGridOptions
    ?prompt "Custom Grid Options : "
    ?choices list( "" "0.01" "0.001" "0.0001" "0.00025" "0.005" "0.0005" )
    ?value ""
    ?defValue ""
    ?enabled nil
    ?invisible nil
    )
    

    Hopefully this is what you want to do.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 6 years ago

    Hi,

    Add a callback function like this:

    
    procedure(srMfgGridRadioCB(field form value)
      if(value=="Yes"
        putpropq(getq(form UserGridOptions) nil enabled)
        putpropq(getq(form UserGridOptions) t enabled)
      )
    )
    

    And also change the field definition to use it (and also make the default state of the other field match the default state of this field):

    
    UseMfgGridYesNo = hiCreateGridLayout( 'UseMfgGridYesNo ;?frame "Select either one of the grids below"
    ?items list(
    list( hiCreateLabel( ?name 'useMfgGridYNLabel ?labelText "Use Manufacturing Grid (Y/N) ? : " ) 'row 1 'col 0 )
    list( hiCreateRadioField(
    ?name 'useMfgGridYN 
    ?value "" 
    ?defValue "Yes"
    ?callback list('srMfgGridRadioCB)
    ?choices list("Yes" "No")) 'row 1 'col 1)
    list( 'col_stretch 1 1 )
    ))
    
    UserGridOptions = hiCreateCyclicField(
    ?name 'UserGridOptions
    ?prompt "Custom Grid Options : "
    ?choices list( "" "0.01" "0.001" "0.0001" "0.00025" "0.005" "0.0005" )
    ?value ""
    ?defValue ""
    ?enabled nil
    ?invisible nil
    )
    

    Hopefully this is what you want to do.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • ssram
    ssram over 6 years ago in reply to skillUser

    Thanks Lawrence, this works.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information