• 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. Including png files in the Application form

Stats

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

Including png files in the Application form

gharish
gharish over 11 years ago

Hai,

I want to include png files in the app form. Please help me. I have a requirement that if i select the picture its callback is executed. 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    This could be a png (I picked a GIF, because there's one in the IC installation; there are png files too, but I thought I'd pick the Cadence logo):

    but=hiCreateButton(?name 'cadenceLogo ?callback "printf(\"I Love SKILL\n\")"
      ?buttonIcon list(cdsGetInstPath("share/cdssetup/dfII/publisher/html/cadence_logo2.gif") 100 40))
    hiCreateAppForm(?formTitle "Images on Forms" ?name 'CCFform ?fields list(list(but 0:0 110:50)))
    hiDisplayForm(CCFform)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • gharish
    gharish over 11 years ago

     Thanks Dear,

    Now I have a set of pictures, I would like to include all these png files in my form. Now I have a requirement that at a time one picture should be visible to me. if i press next another picture should be visible, and each picture will have separate call backs. So please help me regarding this.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    Not quite sure why I ended up writing this complete example rather than just giving you some pointers, but maybe it will give others a recipe to start from...

    /* abExampleIconNextPrev.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Feb 28, 2014 
    Modified   
    By         
    
    An example showing how to implement a form with an icon
    button which shows one of a set of pictures, and has next 
    and previous buttons to move back and forward through the
    list. Each picture has a corresponding callback function.
    
    See the details in the code - it's an example, so adapt to
    suit your needs.
    
    Call abExampleIconNextPrev() to create and display the
    form.
    
    ***************************************************
    
    SCCS Info: @(#) abExampleIconNextPrev.il 02/28/14.09:38:06 1.1
    
    */
    
    /**********************************************************************
    *                                                                     *
    *           abCreateExampleIconNextPrevForm(listOfPictures)           *
    *                                                                     *
    *  Create the example form. This gets passed a list of lists, where   *
    * each sublist is the name of a file (assumed to be in the 48x48 dir) *
    *      the width and height of the image, and a callback string.      *
    *                                                                     *
    **********************************************************************/
    
    procedure(abCreateExampleIconNextPrevForm(listOfPictures)
        let((next previous picture thisPicture)
            next=hiCreateButton(
                ?name 'next 
                ?buttonIcon list(cdsGetInstPath("share/cdssetup/icons/16x16/arrow-right.png") 16 16)
                ?callback "abExampleIconNextCB(hiGetCurrentForm())"
            )
            previous=hiCreateButton(
                ?name 'previous 
                ?buttonIcon list(cdsGetInstPath("share/cdssetup/icons/16x16/arrow-left.png") 16 16)
                ?callback "abExampleIconPreviousCB(hiGetCurrentForm())"
            )
            thisPicture=car(listOfPictures)
            picture=hiCreateButton(
                ?name 'picture 
                ?buttonIcon list(cdsGetInstPath(strcat("share/cdssetup/icons/48x48/" car(thisPicture)))
                    cadr(thisPicture) caddr(thisPicture))
                ?callback "abExampleIconPictureCB(hiGetCurrentForm())"
            )
            hiCreateAppForm(
                ?formTitle "Next Previous Example"
                ?name 'abExampleIconNextPrevForm
                ?fields
                    list(
                        list(previous 20:20 20:20)
                        list(picture 60:0 60:60)
                        list(next 140:20 20:20)
                    )
            )
            ;----------------------------------------------------------------
            ; Store the info on the form - the list of pictures and the currently
            ; displayed picture
            ;----------------------------------------------------------------
            abExampleIconNextPrevForm->listOfPictures=listOfPictures
            abExampleIconNextPrevForm->thisPicture=thisPicture
            abExampleIconNextPrevForm
        )
    )
    
    /*************************************************************************
    *                                                                        *
    *                       abExampleIconNextCB(form)                        *
    *                                                                        *
    * When the next button is pressed, update the button icon to the current *
    *        picture, and update the thisPicture property on the form        *
    *                                                                        *
    *************************************************************************/
    
    procedure(abExampleIconNextCB(form)
        let((remainder thisPicture)
            remainder=memq(form->thisPicture form->listOfPictures)
            when(thisPicture=cadr(remainder)
                hiSetButtonIcon(form->picture
                    list(cdsGetInstPath(strcat("share/cdssetup/icons/48x48/" car(thisPicture)))
                        cadr(thisPicture) caddr(thisPicture))
                )
                form->thisPicture=thisPicture
            )
        )
    )
    
    /*****************************************************************
    *                                                                *
    *                 abExampleIconPreviousCB(form)                  *
    *                                                                *
    * Similar to abExampleIconNextCB, but shows the previous picture *
    *                                                                *
    *****************************************************************/
    
    procedure(abExampleIconPreviousCB(form)
        let((thisPicture)
            thisPicture=car(form->listOfPictures)
            exists(picInfo form->listOfPictures
                eq(form->thisPicture picInfo) || (thisPicture=picInfo) && nil
            )
            unless(eq(thisPicture form->thisPicture)
                hiSetButtonIcon(form->picture
                    list(cdsGetInstPath(strcat("share/cdssetup/icons/48x48/" car(thisPicture)))
                        cadr(thisPicture) caddr(thisPicture))
                )
                form->thisPicture=thisPicture
            )
        )
    )
    
    /*****************************************************************
    *                                                                *
    *                  abExampleIconPictureCB(form)                  *
    *                                                                *
    * A generic callback function for the main picture button. This  *
    * retrieves the callback function (the 4th entry in the sublist) *
    *        and evaluates it with errset to trap any errors.        *
    *                                                                *
    *****************************************************************/
    
    procedure(abExampleIconPictureCB(form)
        when(form->thisPicture
            errsetstring(cadddr(form->thisPicture) t)
        )
    )
    
    /***************************************************************
    *                                                              *
    *                   abExampleIconNextPrev()                    *
    *                                                              *
    *            The main function to display the form.            *
    *                                                              *
    ***************************************************************/
    
    procedure(abExampleIconNextPrev()
        let((listOfPictures)
            listOfPictures=
                '(
                    ("plot-waveform.png" 48 48 "MyPlotWaveform()")
                    ("output-setup.png" 48 48 "MyOutputSetup()")
                    ("delete-alt-1.png" 48 48 "MyDelete()")
                    ("variable-edit.png" 48 48 "MyVariableEdit()")
                )
        hiDisplayForm(abCreateExampleIconNextPrevForm(listOfPictures))
        )
    )
    
    ;------------------------------------------------------------------------
    ; Example callback functions for each picture. None are
    ; terribly exciting...
    ;------------------------------------------------------------------------
    
    procedure(MyPlotWaveform()
        printf("Plotting a waveform\n")
    )
    
    procedure(MyOutputSetup()
        printf("Output Setup pushed\n")
    )
    
    procedure(MyDelete()
        printf("Delete the lot\n")
    )
    procedure(MyVariableEdit()
        printf("Variable Edit engaged\n")
    )

     

    • 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