• 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. How to create dockable form in skill

Stats

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

How to create dockable form in skill

RushMehta
RushMehta over 14 years ago

Hello,

I am trying to create a dockable form so that it can be docked to existing schematic window.

I am able to create popup gui using hiCreateAppForm and hiDisplayForm. When hiDisplayForm is  executed skill code stays there till the form is closed using 'close' button.
However that's not true when I dock it.

I used hiCraeteDockWindow and hiDockWindow functions to successfully dock the form.  After executing hiDockWindow, skill code goes to next line and it will eventually exit the code. Which means the form is docked in schematic but its non-functional now as it can't reference any variables.

How do I keep the skill code alive after docking the form ? Or is there any other way to achieve the docked form ?

Thanks in advance,

Rushang 

 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Rushang,

    Try this modification of your code:

     procedure( popupform()
        let( (fileLocation loadFileButton )
            fileLocation = hiCreateFileSelectorField(
                    ?name           'fileLocation
                    ?mode           'existingFile
                    ?prompt         "Choose a file"
                    ?editable       t)

            loadFileButton = hiCreateButton(
                    ?name           'loadFileButton
                    ?buttonText     "Load File"
                    ?callback       "printf(\"Loading file from popup form %s\n\" myForm->fileLocation->value)")

            myForm = hiCreateAppForm(
                    ?name           'myForm
                    ?formTitle      "My Form which should be popup"
                    ?buttonLayout   'Close
            ?dontBlock t    ; with this your previous code would have failed
                    ?fields         list( list(fileLocation 10:10 400:20 100)
                                            list(loadFileButton 415:10 80:30))
                    ?unmapAfterCB           t)

            hiDisplayForm(myForm)
        ); let
    )

    procedure( dockform()
        let( (fileLocation loadFileButton swin dockForm myDock)
            fileLocation = hiCreateFileSelectorField(
                    ?name           'fileLocation
                    ?mode           'existingFile
                    ?prompt         "Choose a file"
                    ?editable       t)

            loadFileButton = hiCreateButton(
                    ?name           'loadFileButton
                    ?buttonText     "Load File"
                    ?callback       "printf(\"Loading file from docked form %s\n\" myForm2->fileLocation->value)")
            ; or this
                    ;?callback       "printf(\"Loading file from docked form %s\n\" hiGetCurrentForm()->fileLocation->value)")

            swin = hiGetSessionWindow(hiGetCurrentWindow())
            myForm2 = hiCreateAppForm(
                    ?name           'myForm2
                    ?formTitle      "My Form which should be docked"
                    ?buttonLayout   'Close
                    ?fields         list( list(fileLocation 10:10 400:20 100)
                                            list(loadFileButton 415:10 80:30))
                    ?unmapAfterCB           t)
            dockForm = hiCreateDockWindow(
                    ?appType        "Docked Form"
                    ?widgetType     "form"
                    ?handle         'dockedForm
                    ?title          "Docked Form"
                    ?form           myForm2)
            myDock = hiDockWindow(
                    ?window         dockForm
                    ?session        swin
                    ?side           'right)
        ); let
    )

     

    The key parts are that I've taken out myForm and myForm2 from the let() in each function, and changed the callback to either do:

    myForm->fileLocation->value

    or 

    hiGetCurrentForm()->fileLocation->value

    Either would be OK.

    In general top level user interface elements (e.g. forms, menus) must be in global variables. This is because the interactions with them must be accessible out of scope - particularly if they are non-blocking. There is no need for the form fields, or the dock window to be global.

    In your original popupform() function, it worked because the form was defined as being blocking - so the call to hiDisplayForm() meant that it was still within the scope of the popupform function. If you'd made the form non-blocking (as I've done in the modification above), or if the call to hiDisplayForm() had been outside of the function that created it, it also would not have worked. By ensuring the myForm and myForm2 are global - they are accessible everywhere. They also have to be global so that the CDS.log can record the updates to the form - so they are replayable.

    In the case of the dockform, it's always non-blocking - so you have to do this anyway.

    Provided you start from the global handle (or use hiGetCurrentForm()), you can retrieve the fields of anything on the form.

    Hope that helps!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Rushang,

    Try this modification of your code:

     procedure( popupform()
        let( (fileLocation loadFileButton )
            fileLocation = hiCreateFileSelectorField(
                    ?name           'fileLocation
                    ?mode           'existingFile
                    ?prompt         "Choose a file"
                    ?editable       t)

            loadFileButton = hiCreateButton(
                    ?name           'loadFileButton
                    ?buttonText     "Load File"
                    ?callback       "printf(\"Loading file from popup form %s\n\" myForm->fileLocation->value)")

            myForm = hiCreateAppForm(
                    ?name           'myForm
                    ?formTitle      "My Form which should be popup"
                    ?buttonLayout   'Close
            ?dontBlock t    ; with this your previous code would have failed
                    ?fields         list( list(fileLocation 10:10 400:20 100)
                                            list(loadFileButton 415:10 80:30))
                    ?unmapAfterCB           t)

            hiDisplayForm(myForm)
        ); let
    )

    procedure( dockform()
        let( (fileLocation loadFileButton swin dockForm myDock)
            fileLocation = hiCreateFileSelectorField(
                    ?name           'fileLocation
                    ?mode           'existingFile
                    ?prompt         "Choose a file"
                    ?editable       t)

            loadFileButton = hiCreateButton(
                    ?name           'loadFileButton
                    ?buttonText     "Load File"
                    ?callback       "printf(\"Loading file from docked form %s\n\" myForm2->fileLocation->value)")
            ; or this
                    ;?callback       "printf(\"Loading file from docked form %s\n\" hiGetCurrentForm()->fileLocation->value)")

            swin = hiGetSessionWindow(hiGetCurrentWindow())
            myForm2 = hiCreateAppForm(
                    ?name           'myForm2
                    ?formTitle      "My Form which should be docked"
                    ?buttonLayout   'Close
                    ?fields         list( list(fileLocation 10:10 400:20 100)
                                            list(loadFileButton 415:10 80:30))
                    ?unmapAfterCB           t)
            dockForm = hiCreateDockWindow(
                    ?appType        "Docked Form"
                    ?widgetType     "form"
                    ?handle         'dockedForm
                    ?title          "Docked Form"
                    ?form           myForm2)
            myDock = hiDockWindow(
                    ?window         dockForm
                    ?session        swin
                    ?side           'right)
        ); let
    )

     

    The key parts are that I've taken out myForm and myForm2 from the let() in each function, and changed the callback to either do:

    myForm->fileLocation->value

    or 

    hiGetCurrentForm()->fileLocation->value

    Either would be OK.

    In general top level user interface elements (e.g. forms, menus) must be in global variables. This is because the interactions with them must be accessible out of scope - particularly if they are non-blocking. There is no need for the form fields, or the dock window to be global.

    In your original popupform() function, it worked because the form was defined as being blocking - so the call to hiDisplayForm() meant that it was still within the scope of the popupform function. If you'd made the form non-blocking (as I've done in the modification above), or if the call to hiDisplayForm() had been outside of the function that created it, it also would not have worked. By ensuring the myForm and myForm2 are global - they are accessible everywhere. They also have to be global so that the CDS.log can record the updates to the form - so they are replayable.

    In the case of the dockform, it's always non-blocking - so you have to do this anyway.

    Provided you start from the global handle (or use hiGetCurrentForm()), you can retrieve the fields of anything on the form.

    Hope that helps!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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