• 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 text window/form with selectable text and...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 3235
  • 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 text window/form with selectable text and print to it

alexstepanov75
alexstepanov75 over 8 years ago

Hi,

I want to create window/form and print text to it. The text should be selectable so it will be possible to copy-past from this window/form.

It seems like I can use hiCreateWindow with t_widgetType text, but i was unable to figure out how to output text to this window.

Thanks,

Alex.

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

    Alex, 

    You can use hiTextDisplayString. Here's an example (bit long just for this purpose) of a dock window assistant on a text window where the buttons change based on a cyclic field, and when you press the buttons text is added in the window.

    Regards,

    Andrew.

    /* abExampleDockWindow.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Nov 15, 2012 
    Modified   
    By         
    
    Not very refined example, but shows how to use a docked form window
    with a dynamic form.
    
    Call abExampleDockWindow() to see how this works.
    
    ***************************************************
    
    SCCS Info: @(#) abExampleDockWindow.il 11/21/12.03:04:29 1.2
    
    */
    
    /***************************************************************
    *                                                              *
    *                 abCreateExampleDynamicForm()                 *
    *                                                              *
    *  Create the form that will be docked in the window. To make  *
    *  it interesting, has some dynamic fields - as radio button   *
    *       choices are made, updates the fields on the form       *
    *                                                              *
    ***************************************************************/
    
    procedure(abCreateExampleDynamicForm()
        let((label simType magicFields staticFields)
            label=hiCreateLabel(
                ?name 'label
                ?labelText "Simulation Type:"
            )
            simType=hiCreateRadioField(
                ?name 'simType
                ?itemsPerRow 1
                ?defValue "Dynamic"
                ?choices list("Static" "Dynamic" "Magic")
                ?callback list("abSimTypeCB(abExampleDynamicForm)")
            )
            ;----------------------------------------------------------------
            ; Create lists of fields (with coordinates) which will
            ; be dynamically added as radio choices are made
            ;----------------------------------------------------------------
            magicFields=list(
                list(
                    hiCreateButton(
                        ?name 'generate
                        ?buttonText "Generate"
                        ?callback "abExampleDockAction(\"Generate Pressed\")"
                    )
                    10:120 100:30
                )
                list(
                    hiCreateButton(
                        ?name 'run
                        ?buttonText "Run"
                        ?callback "abExampleDockAction(\"Run Pressed\")"
                    )
                    10:150 100:30
                )
            )
            staticFields=list(
                list(
                    hiCreateButton(
                        ?name 'delete
                        ?buttonText "Delete"
                        ?callback "abExampleDockAction(\"Delete Pressed\")"
                    )
                    10:120 100:30
                )
            )
            hiCreateAppForm(
                ?name 'abExampleDynamicForm
                ?formTitle "Doo dah"
                ?fields list(
                    list(label 0:0 100:30)
                    list(simType 10:30 100:120)
                )
            )
            ;----------------------------------------------------------------
            ; Rather than storing the list of fields in global variables
            ; store as properties on the form
            ;----------------------------------------------------------------
            abExampleDynamicForm->magicFields=magicFields
            abExampleDynamicForm->staticFields=staticFields
            abExampleDynamicForm
        )
    )
    
    /***************************************************************
    *                                                              *
    *                  abExampleDockAction(text)                   *
    *                                                              *
    *    Callback function for the buttons - displays some text    *
    *                      in the main canvas                      *
    *                                                              *
    ***************************************************************/
    
    procedure(abExampleDockAction(text)
        hiTextDisplayString(hiGetCurrentWindow() text t)
    )
    
    /***************************************************************
    *                                                              *
    *                      abSimTypeCB(form)                       *
    *                                                              *
    *  Callback for the simType field - changes the fields on the  *
    *           form dependent upon the choice selected.           *
    *                                                              *
    ***************************************************************/
    
    procedure(abSimTypeCB(form)
        let((currentFields fieldsToAdd)
            ;----------------------------------------------------------------
            ; currentFields is a property I'm using to store
            ; fields which have been dynamically added
            ;----------------------------------------------------------------
            currentFields=form->currentFields
            when(currentFields
                hiDeleteFields(form currentFields)
            )
            fieldsToAdd=case(form->simType->value
                ("Magic" form->magicFields)
                ("Static" form->staticFields)
            )
            when(fieldsToAdd
                hiAddFields(form fieldsToAdd)
            )
            ;----------------------------------------------------------------
            ; Recompute the names of the fields which have been
            ; added (so you know what to delete next time)
            ;----------------------------------------------------------------
            form->currentFields=
                foreach(mapcar fieldInfo fieldsToAdd car(fieldInfo)->hiFieldSym)
        )
    )
    
    /***************************************************************
    *                                                              *
    *                    abExampleDockWindow()                     *
    *                                                              *
    *               Main entry point for the example               *
    *                                                              *
    ***************************************************************/
    
    procedure(abExampleDockWindow()
        let((dock swin win pulldown)
            ;----------------------------------------------------------------
            ; Create a session (container) window plus the window itself
            ;----------------------------------------------------------------
            swin=hiCreateWindow(nil "session" "My App")
            win=hiCreateWindow(nil "text" "My App Text")
            ;----------------------------------------------------------------
            ; Create the form - you'd probably not do this every time if it
            ; has already been created - but this is for illustration
            ;----------------------------------------------------------------
            abCreateExampleDynamicForm()
            ;----------------------------------------------------------------
            ; And a dock window to contain the form
            ;----------------------------------------------------------------
            dock=hiCreateDockWindow(
                ?appType "Example Dock"
                ?widgetType "form"
                ?handle 'exampleDock
                ?form abExampleDynamicForm
                ?title "Example Dock"
            )
            ;----------------------------------------------------------------
            ; Create a pulldown menu and insert into the session window
            ;----------------------------------------------------------------
            hiCreatePulldownMenu(
                'abExampleDockWindowMenu
                "&File"
                list(
                    hiCreateMenuItem(
                        ?name 'close
                        ?itemText "&Close"
                        ?callback "hiCloseWindow(hiGetCurrentWindow())"
                    )
                )
            )
            hiInsertBannerMenu(
                swin
                abExampleDockWindowMenu
                1
            )
            ;----------------------------------------------------------------
            ; Dock the form, and then display the window in the session window
            ;----------------------------------------------------------------
            hiDockWindow(
                ?window dock
                ?session swin
                ?side 'left
            )
            hiDisplayWindow(win swin)
        )
    )
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Alex, 

    You can use hiTextDisplayString. Here's an example (bit long just for this purpose) of a dock window assistant on a text window where the buttons change based on a cyclic field, and when you press the buttons text is added in the window.

    Regards,

    Andrew.

    /* abExampleDockWindow.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Nov 15, 2012 
    Modified   
    By         
    
    Not very refined example, but shows how to use a docked form window
    with a dynamic form.
    
    Call abExampleDockWindow() to see how this works.
    
    ***************************************************
    
    SCCS Info: @(#) abExampleDockWindow.il 11/21/12.03:04:29 1.2
    
    */
    
    /***************************************************************
    *                                                              *
    *                 abCreateExampleDynamicForm()                 *
    *                                                              *
    *  Create the form that will be docked in the window. To make  *
    *  it interesting, has some dynamic fields - as radio button   *
    *       choices are made, updates the fields on the form       *
    *                                                              *
    ***************************************************************/
    
    procedure(abCreateExampleDynamicForm()
        let((label simType magicFields staticFields)
            label=hiCreateLabel(
                ?name 'label
                ?labelText "Simulation Type:"
            )
            simType=hiCreateRadioField(
                ?name 'simType
                ?itemsPerRow 1
                ?defValue "Dynamic"
                ?choices list("Static" "Dynamic" "Magic")
                ?callback list("abSimTypeCB(abExampleDynamicForm)")
            )
            ;----------------------------------------------------------------
            ; Create lists of fields (with coordinates) which will
            ; be dynamically added as radio choices are made
            ;----------------------------------------------------------------
            magicFields=list(
                list(
                    hiCreateButton(
                        ?name 'generate
                        ?buttonText "Generate"
                        ?callback "abExampleDockAction(\"Generate Pressed\")"
                    )
                    10:120 100:30
                )
                list(
                    hiCreateButton(
                        ?name 'run
                        ?buttonText "Run"
                        ?callback "abExampleDockAction(\"Run Pressed\")"
                    )
                    10:150 100:30
                )
            )
            staticFields=list(
                list(
                    hiCreateButton(
                        ?name 'delete
                        ?buttonText "Delete"
                        ?callback "abExampleDockAction(\"Delete Pressed\")"
                    )
                    10:120 100:30
                )
            )
            hiCreateAppForm(
                ?name 'abExampleDynamicForm
                ?formTitle "Doo dah"
                ?fields list(
                    list(label 0:0 100:30)
                    list(simType 10:30 100:120)
                )
            )
            ;----------------------------------------------------------------
            ; Rather than storing the list of fields in global variables
            ; store as properties on the form
            ;----------------------------------------------------------------
            abExampleDynamicForm->magicFields=magicFields
            abExampleDynamicForm->staticFields=staticFields
            abExampleDynamicForm
        )
    )
    
    /***************************************************************
    *                                                              *
    *                  abExampleDockAction(text)                   *
    *                                                              *
    *    Callback function for the buttons - displays some text    *
    *                      in the main canvas                      *
    *                                                              *
    ***************************************************************/
    
    procedure(abExampleDockAction(text)
        hiTextDisplayString(hiGetCurrentWindow() text t)
    )
    
    /***************************************************************
    *                                                              *
    *                      abSimTypeCB(form)                       *
    *                                                              *
    *  Callback for the simType field - changes the fields on the  *
    *           form dependent upon the choice selected.           *
    *                                                              *
    ***************************************************************/
    
    procedure(abSimTypeCB(form)
        let((currentFields fieldsToAdd)
            ;----------------------------------------------------------------
            ; currentFields is a property I'm using to store
            ; fields which have been dynamically added
            ;----------------------------------------------------------------
            currentFields=form->currentFields
            when(currentFields
                hiDeleteFields(form currentFields)
            )
            fieldsToAdd=case(form->simType->value
                ("Magic" form->magicFields)
                ("Static" form->staticFields)
            )
            when(fieldsToAdd
                hiAddFields(form fieldsToAdd)
            )
            ;----------------------------------------------------------------
            ; Recompute the names of the fields which have been
            ; added (so you know what to delete next time)
            ;----------------------------------------------------------------
            form->currentFields=
                foreach(mapcar fieldInfo fieldsToAdd car(fieldInfo)->hiFieldSym)
        )
    )
    
    /***************************************************************
    *                                                              *
    *                    abExampleDockWindow()                     *
    *                                                              *
    *               Main entry point for the example               *
    *                                                              *
    ***************************************************************/
    
    procedure(abExampleDockWindow()
        let((dock swin win pulldown)
            ;----------------------------------------------------------------
            ; Create a session (container) window plus the window itself
            ;----------------------------------------------------------------
            swin=hiCreateWindow(nil "session" "My App")
            win=hiCreateWindow(nil "text" "My App Text")
            ;----------------------------------------------------------------
            ; Create the form - you'd probably not do this every time if it
            ; has already been created - but this is for illustration
            ;----------------------------------------------------------------
            abCreateExampleDynamicForm()
            ;----------------------------------------------------------------
            ; And a dock window to contain the form
            ;----------------------------------------------------------------
            dock=hiCreateDockWindow(
                ?appType "Example Dock"
                ?widgetType "form"
                ?handle 'exampleDock
                ?form abExampleDynamicForm
                ?title "Example Dock"
            )
            ;----------------------------------------------------------------
            ; Create a pulldown menu and insert into the session window
            ;----------------------------------------------------------------
            hiCreatePulldownMenu(
                'abExampleDockWindowMenu
                "&File"
                list(
                    hiCreateMenuItem(
                        ?name 'close
                        ?itemText "&Close"
                        ?callback "hiCloseWindow(hiGetCurrentWindow())"
                    )
                )
            )
            hiInsertBannerMenu(
                swin
                abExampleDockWindowMenu
                1
            )
            ;----------------------------------------------------------------
            ; Dock the form, and then display the window in the session window
            ;----------------------------------------------------------------
            hiDockWindow(
                ?window dock
                ?session swin
                ?side 'left
            )
            hiDisplayWindow(win swin)
        )
    )
    
    • 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