• 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. Multiple forms inside a window

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 142
  • Views 15247
  • 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

Multiple forms inside a window

RK56
RK56 over 5 years ago

Hi,

How to instantiate multiple forms inside a window in Skill? Can we add same form twice in a window and maintain its GUI fields unique? 

Please share a sample code for this.

Thank you

Ramakrishnan

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Hi Ramakrishnan,

    The only way to have multiple forms inside a window is to have docked form windows within the main window. It's not entirely clear what you're asking.

    You certainly can't have the same form docked more than one (I don't think that's possible - I didn't try - but even if it was possible, the form contents would be shared; you'll need to create a unique container object for each form).

    Personally I can't give you any sample code for this as I don't have anything to do this, and I'm on vacation in a few hours... maybe somebody else does, or maybe you should just ask customer support?

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 5 years ago in reply to Andrew Beckett

    Hi Andrew,

    I have a FORM(GUI) which displays a text file content in a report field. Now I would like to display another report field (different file content) for visual comparison. Each report field has associated GUI elements to control/summarize. Instead of rewriting another FORM GUI code, I am looking for way to reuse without duplicating.

    I will try with docked window approach as you mentioned. Thanks for your response in spite of your busy schedule. Enjoy your vacation.

    -Ramakrishnan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to RK56

    You wouldn't have to rewrite a second copy of the code - you could have a common function, and provide the symbol to use for the form as an argument to that function. All the fields are tied to the form, so should be unique (unless you store them in global variables, that is and don't create them per each instance of the form).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 5 years ago in reply to Andrew Beckett

    It says the form is already instantiated. What type of window should be created? A form window or a graphics window?

    -Ramakrishnan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to RK56

    Ramakrishnan,

    Not sure how anyone can determine what you've done wrong if you don't share what you've actually done!

    Most likely, you've tried to add the same form twice to the same window - and that's not possible (I suspected it wasn't, but didn't know for certain) - either way, that wasn't what you wanted as if it had been possible, the fields would have been shared.

    Here's a very simple example of creating a form window and docking a second form to it. With any window, you need to determine what the main "canvas" will be - if you need graphics (e.g. a layout or schematic") then it could be a graphics window, if it's just a form, then use a form window, if you want text, then use a text window. This code just uses a form window with a second docked form, and both forms are created with the same function. Note that it's not a particularly refined example as I didn't have time to spend on it.

    procedure(CCFcreateSimpleForm(formName frameTitle formTitle)
        let((field1 field2 field3 vertBox)
            field1=hiCreateStringField(
                ?name 'field1
                ?prompt "First Field"
            )
            field2=hiCreateStringField(
                ?name 'field2
                ?prompt "Second Field"
            )
            field3=hiCreateStringField(
                ?name 'field3
                ?prompt "Third Field"
            )
            vertBox=hiCreateVerticalBoxLayout(
                'vertBox
                ?frame frameTitle
                ?items list(field1 field2 field3 list('stretch_item 1))
            )
            hiCreateLayoutForm(
                formName
                formTitle
                vertBox
            )
        )
    )
    
    procedure(CCFtwoFormsInWindow()
        let((swin win dockWin form1 form2)
            ;----------------------------------------------------------------
            ; Create the two separate forms
            ;----------------------------------------------------------------
            form1=CCFcreateSimpleForm('CCFform1 "First Info" "First Info")
            form2=CCFcreateSimpleForm('CCFform2 "Second Info" "Second Info")
            ;----------------------------------------------------------------
            ; Session window as container, and then window within that
            ;----------------------------------------------------------------
            swin=hiCreateWindow(
                list(100:100 700:600)
                "session"
                "Compare Info"
            )
            win=hiCreateWindow(
                nil
                "form"
                "Compare Info"
                ""
                nil
                form1
            )
            ;----------------------------------------------------------------
            ; Dock window for second form - dock at the bottom
            ;----------------------------------------------------------------
            dockWin=hiCreateDockWindow(
                ?appType "Second Info"
                ?widgetType "form"
                ?handle 'CCFdockForm
                ?form form2
                ?title "Second Info"
            )
            hiDockWindow(
                ?window dockWin
                ?session swin
                ?side 'bottom
            )
            hiDisplayWindow(win swin)
        )
    )
    

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 5 years ago in reply to Andrew Beckett

    Thank you Andrew for the example. I guess I can pick it up from here.

    I was not passing formName as argument and kept it as a constant inside hiCreateAppForm.

    -Ramakrishnan

    • 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