• 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. pull down menu with directory contents

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 13613
  • 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

pull down menu with directory contents

frogconsultant
frogconsultant over 12 years ago

Hi All,

 I looked through the community for inspiration on this subject but I cannot find a first step for it. I would like to have a field in one of my menu containing the directory content (list of file) either through a cyclic or pulldown field.

 Does someone could give me an idea of how to grab the content of a directory path through a field menu?

Regards,

  • Cancel
Parents
  • psill00
    psill00 over 12 years ago

    I am kinda doing this on the fly since this is pieced together. If there is an error post it and we will work through it. This creates or adds to the menus on the CIW. You can do something similar to the layout menus too.

    This setup lists a directory and loads a file when you click on the slider.

     

    Try this:

    Create a ~/menus

    Copy/Paste or create ciw.menus in the ~/menus directory

     daMenu      = '(myMenu "My Stuff" (
                    (trySlider      "Cool Stuff" (
                            (booya1        "Test1" "println(1)")
                            (booya2        "Test2" "println(2)")
                            ))
                    )); end of Utilities menu

    loadFile  = '(lscr "mySkill" (
                    (skLintGui      "Lint"          "skShowForm()")
                    (cdsFind        "cdsFinder"     "startFinder()")
                    (skillIde       "Skill IDE"     "_ilgRunSkillIde()")
                    (refresh        "Refresh List"  "refreshMySkillMenu()")
                    (xscripts       "xScripts File" (
                            (holder "" "")
                            ))
                    (virtuoso       "Virtuoso File" (
                            (holder "" "")
                            ))
                    (bindkey        "Bindkey File"  (
                            (holder "" "")
                            ))
                    )); end of loadFile

    localCiwMenu = '(daMenu loadFile)

    ciwMenuList = append(ciwMenuList localCiwMenu)

     

    -------------------------------------------------------------------------------------------------------------------------------------------

    Another copy and paste file and make sure it loads when you start cadence and execute skForum_custCiwMenuBuild().

    Example of what to put in your ~/.cdsint file

    load("FILE_PATH")

    skForum_custCiwMenuBuild().

    Copy/Paste below:

    procedure(skForum_addFileMenuItems(@optional (bool nil))
    let(    (item fileItem
        (ext ".il$")
        (dir "ADD_YOUR_SKILL_DIRECTORY _HERE")
        )
    foreach(file skForum_sortLastModified(dir ext t)
        item        = car(parseString(file "."))
        fileItem    = hiCreateMenuItem(?name stringToSymbol(item)
                        ?callback  strcat("load(\"" dir file "\")")
                        ?itemText file)
        hiAddMenuItem(xscripts fileItem)
    ); end of foreach
    hiDeleteMenuItem(xscripts 'holder)
    t
    ); end of let
    ); end of skForum_addFileMenuItems

    procedure(skForum_delFileMenuItems()
    let(    (tmp
        )
    unless(member('holder hiGetMenuItems(xscripts))
        tmp = hiCreateMenuItem(?name 'holder ?itemText "tmp" ?callback "xB()")
        hiAddMenuItem(xscripts tmp)
        )

    foreach(item    hiGetMenuItems(xscripts)
        unless(equal(item 'holder) hiDeleteMenuItem(xscripts item))
        )
    t
    )); end of skForum_delFileMenuItems

    procedure(skForum_refreshMySkillMenu() skForum_delFileMenuItems() skForum_addFileMenuItems())

    procedure(skForum_sortLastModified(dir ext sort)
    let(    (fileList vFile tmp len
        )
    foreach(file getDirFiles(dir)
        if(rexMatchp(ext file) fileList = cons(file fileList))
        )
    if(sort then
        vFile    = listToVector(fileList)
        len    = length(vFile)-2
        for(i 0 len
            for(j 0 len
            if(greaterp(fileTimeModified(strcat(dir vFile[j])) fileTimeModified(strcat(dir vFile[j+1]))) then
                tmp        = vFile[j]
                vFile[j]    = vFile[j+1]
                vFile[j+1]    = tmp)
            )
        )
        reverse(vectorToList(vFile))
    else    sort(fileList nil))
    ); end of let
    ); end of skForum_sortLastModified

    procedure(skForum_reloadFile()
    let(    (file
        (dir "ADD_YOUR_SKILL_DIRECTORY_HERE")
        )
    file = car(skForum_sortLastModified(dir ".il$" t))
    printf("Loading file... %s\n" file)
    load(strcat(dir file))
    )); end of skForum_reloadFile

    procedure(skForum_custCiwMenuBuild()
    let(    (item fileItem
        (virt "virtuoso/")
        (bind "bindkeys/")
        (loadDir "ADD_YOUR_SKILL_DIRECTORY _HERE")
        )

    foreach(file skForum_sortLastModified(strcat(loadDir virt) ".il$" nil)
        item        = car(parseString(file "."))
        fileItem    = hiCreateMenuItem(?name stringToSymbol(item)
                        ?callback  strcat("load(\"" loadDir virt file "\")")
                        ?itemText file)
        hiAddMenuItem(virtuoso fileItem)
    ); end of foreach

    foreach(file skForum_sortLastModified(strcat(loadDir bind) ".il$" nil)
        item        = car(parseString(file "."))
        fileItem    = hiCreateMenuItem(?name stringToSymbol(item)
                        ?callback  strcat("load(\"" loadDir bind file "\")")
                        ?itemText file)
        hiAddMenuItem(bindkey fileItem)
    ); end of foreach
    hiDeleteMenuItem(virtuoso 'holder)
    hiDeleteMenuItem(bindkey 'holder)
    t
    ); end of let
    ); end of skForum_custCiwMenuBuild

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • psill00
    psill00 over 12 years ago

    I am kinda doing this on the fly since this is pieced together. If there is an error post it and we will work through it. This creates or adds to the menus on the CIW. You can do something similar to the layout menus too.

    This setup lists a directory and loads a file when you click on the slider.

     

    Try this:

    Create a ~/menus

    Copy/Paste or create ciw.menus in the ~/menus directory

     daMenu      = '(myMenu "My Stuff" (
                    (trySlider      "Cool Stuff" (
                            (booya1        "Test1" "println(1)")
                            (booya2        "Test2" "println(2)")
                            ))
                    )); end of Utilities menu

    loadFile  = '(lscr "mySkill" (
                    (skLintGui      "Lint"          "skShowForm()")
                    (cdsFind        "cdsFinder"     "startFinder()")
                    (skillIde       "Skill IDE"     "_ilgRunSkillIde()")
                    (refresh        "Refresh List"  "refreshMySkillMenu()")
                    (xscripts       "xScripts File" (
                            (holder "" "")
                            ))
                    (virtuoso       "Virtuoso File" (
                            (holder "" "")
                            ))
                    (bindkey        "Bindkey File"  (
                            (holder "" "")
                            ))
                    )); end of loadFile

    localCiwMenu = '(daMenu loadFile)

    ciwMenuList = append(ciwMenuList localCiwMenu)

     

    -------------------------------------------------------------------------------------------------------------------------------------------

    Another copy and paste file and make sure it loads when you start cadence and execute skForum_custCiwMenuBuild().

    Example of what to put in your ~/.cdsint file

    load("FILE_PATH")

    skForum_custCiwMenuBuild().

    Copy/Paste below:

    procedure(skForum_addFileMenuItems(@optional (bool nil))
    let(    (item fileItem
        (ext ".il$")
        (dir "ADD_YOUR_SKILL_DIRECTORY _HERE")
        )
    foreach(file skForum_sortLastModified(dir ext t)
        item        = car(parseString(file "."))
        fileItem    = hiCreateMenuItem(?name stringToSymbol(item)
                        ?callback  strcat("load(\"" dir file "\")")
                        ?itemText file)
        hiAddMenuItem(xscripts fileItem)
    ); end of foreach
    hiDeleteMenuItem(xscripts 'holder)
    t
    ); end of let
    ); end of skForum_addFileMenuItems

    procedure(skForum_delFileMenuItems()
    let(    (tmp
        )
    unless(member('holder hiGetMenuItems(xscripts))
        tmp = hiCreateMenuItem(?name 'holder ?itemText "tmp" ?callback "xB()")
        hiAddMenuItem(xscripts tmp)
        )

    foreach(item    hiGetMenuItems(xscripts)
        unless(equal(item 'holder) hiDeleteMenuItem(xscripts item))
        )
    t
    )); end of skForum_delFileMenuItems

    procedure(skForum_refreshMySkillMenu() skForum_delFileMenuItems() skForum_addFileMenuItems())

    procedure(skForum_sortLastModified(dir ext sort)
    let(    (fileList vFile tmp len
        )
    foreach(file getDirFiles(dir)
        if(rexMatchp(ext file) fileList = cons(file fileList))
        )
    if(sort then
        vFile    = listToVector(fileList)
        len    = length(vFile)-2
        for(i 0 len
            for(j 0 len
            if(greaterp(fileTimeModified(strcat(dir vFile[j])) fileTimeModified(strcat(dir vFile[j+1]))) then
                tmp        = vFile[j]
                vFile[j]    = vFile[j+1]
                vFile[j+1]    = tmp)
            )
        )
        reverse(vectorToList(vFile))
    else    sort(fileList nil))
    ); end of let
    ); end of skForum_sortLastModified

    procedure(skForum_reloadFile()
    let(    (file
        (dir "ADD_YOUR_SKILL_DIRECTORY_HERE")
        )
    file = car(skForum_sortLastModified(dir ".il$" t))
    printf("Loading file... %s\n" file)
    load(strcat(dir file))
    )); end of skForum_reloadFile

    procedure(skForum_custCiwMenuBuild()
    let(    (item fileItem
        (virt "virtuoso/")
        (bind "bindkeys/")
        (loadDir "ADD_YOUR_SKILL_DIRECTORY _HERE")
        )

    foreach(file skForum_sortLastModified(strcat(loadDir virt) ".il$" nil)
        item        = car(parseString(file "."))
        fileItem    = hiCreateMenuItem(?name stringToSymbol(item)
                        ?callback  strcat("load(\"" loadDir virt file "\")")
                        ?itemText file)
        hiAddMenuItem(virtuoso fileItem)
    ); end of foreach

    foreach(file skForum_sortLastModified(strcat(loadDir bind) ".il$" nil)
        item        = car(parseString(file "."))
        fileItem    = hiCreateMenuItem(?name stringToSymbol(item)
                        ?callback  strcat("load(\"" loadDir bind file "\")")
                        ?itemText file)
        hiAddMenuItem(bindkey fileItem)
    ); end of foreach
    hiDeleteMenuItem(virtuoso 'holder)
    hiDeleteMenuItem(bindkey 'holder)
    t
    ); end of let
    ); end of skForum_custCiwMenuBuild

     

    • 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