• 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. Buttons - switches

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 2016
  • 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

Buttons - switches

Slawa
Slawa over 14 years ago

HI

How to create the button description, after pushing on which it changes color (picture). That is I have created two icons through
hiCreateColorArray
hiMatchColorByName
hiStringToIcon
The first of them is a "white square"
The second - a "white square with a tick"

Now I want to create the button on the basis of these icons that pushing it in a case if the icon - a "white square" it changed an icon for a "square with a tick", in a case if its icon - a" square with a tick" that reversely on an  "white square". I hope has clearly explained.

Well and at the same time I will ask as to describe such button as Virtuoso Layout Ediror-Options-Display-Array Display. That is the button the switch. And also how to create the button after pushing on which it it appears as though drowned (pushed) and repeated pushing it results it in initial position

 In advance thanks

 

Regards,

Slawa

  • Cancel
  • Austin CAD Guy
    Austin CAD Guy over 14 years ago

     I've not played with icons or colors but here is how to switch the text on a button:


    procedure( testForm2()

    hiCreateAppForm(
       ?name 'myForm
       ?fields list(

                  hiCreateButton(
                     ?name 'myButton
                     ?buttonText "Off"
                     ?callback "toggleButton( myForm 'myButton)"
                     ; ?buttonIcon
                     ; ?showTextWithIcon
                     ?enabled t
                                            ; ?invisible
                  )
               )
    )

    hiDisplayForm( 'myForm )
     
    ) ; ** procedure testForm2 **

    procedure( toggleButton( formId fieldId )
      let((
              curValue curField )
        curField =  get( formId 'myButton )
        curValue = get( curField '_buttonText )
        if( curValue == "Off" then
           putprop( curField "On" '_buttonText )
        else
           putprop( curField "Off" '_buttonText )
        ) ; ** if curValue **
      ) ; ** let **
    ) ; ** procedure toggleButton **


    You may possibly be able to do the same when switching icons. Look at the properties on the button while the form is displayed:

    myForm->myButton->??

     There is a property _buttonIcon which you may be able to change. If not, you would have to make two buttons and toggle the invisible property on  each.

    Ted

    • 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