Home
  • Products
  • Solutions
  • Support
  • Company

This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  • Products
  • Solutions
  • Support
  • Company
Community PCB Design & IC Packaging (Allegro X) Allegro X Capture CIS how add custom menu callback with OrCAD_Capture.xml or capTCLMenu...

Stats

  • State Verified Answer
  • Replies 5
  • Subscribers 40
  • Views 4975
  • Members are here 0
More Content

how add custom menu callback with OrCAD_Capture.xml or capTCLMenu.tcl?

kwxsp86
kwxsp86 over 1 year ago

1. use "InsertXMLMenu" to add a custom menu, but cannot utf-8 encoding.

InsertXMLMenu [list [list "myfile1"] "" "" [list "popup" [encoding convertto utf-8 "中文"] "" "" "" "" "" ""] ""]

menu cannot show "中文"

InsertXMLMenu [list [list "myfile1"] "" "" [list "popup" "中文" "" "" "" "" "" ""] ""]

this command also cannot work(cannot show exactly),

2. use static method OrCAD_Capture.xml

succes show "中文"

but i don't know how connect the callback function?

thanks.

  • Sign in to reply
  • Cancel
Parents
  • CadAP
    0 CadAP over 1 year ago

    Hi kwxsp86,

    Please use the below code and  make changes according to your requirements.

    namespace eval ::testMenu {

    proc registerMenuActions { args } {
    catch {

    InsertXMLMenu [list [list "MyFile1"] "" "" [list "popup" "MyFileTest1" "" "" "" "" ""] ""]
    InsertXMLMenu [list [list "MyFile1" "MyFileLevelpopup1" ""] "" "" [list "action" "MyFileTest1 &Level1" "0" "ActioForMenu1" "UpdateForMenu1" "" "" "" "This is my menu test2"] ""]
    InsertXMLMenu [list [list "MyFile1" "MyFileLevelpopup3" ""] "" "" [list "action" "MyFileTest1 &Level2" "0" "ActioForMenu2" "UpdateForMenu1" "" "" "" "This is my menu test2"] ""]
    InsertXMLMenu [list [list "MyFile1" "MyFileLevelpopup3" ""] "" "" [list "action" "MyFileTest1 &Level3" "0" "ActioForMenu1" "UpdateForMenu1" "" "" "" "This is my menu test2"] ""]


    RegisterAction "ActioForMenu1" "::testMenu::shouldProcess" "" "::testMenu::testActionProc1" ""
    RegisterAction "UpdateForMenu1" "::testMenu::shouldProcess" "" "::testMenu::testUpdateProc1" ""
    RegisterAction "ActioForMenu2" "::testMenu::shouldProcess" "" "::testMenu::testActionProc2" ""
    RegisterAction "UpdateForMenu2" "::testMenu::shouldProcess" "" "::testMenu::testUpdateProc2" ""
    }
    }

    proc shouldProcess { args } {
    return 1
    }

    proc testActionProc1 { args } {
    puts "Got in testActionProc1!"

    }

    proc testActionProc3 { args } {
    puts "Got in testActionProc1!"

    }

    proc testUpdateProc1 { args } {

    return true;

    }

    proc testActionProc2 { args } {
    puts "Got in testActionProc2!"

    }

    proc testUpdateProc2 { args } {

    return true;

    }

    }

    ::testMenu::registerMenuActions

    Hope this help!

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kwxsp86
    0 kwxsp86 over 1 year ago in reply to CadAP

    yes, i have got this sample before. but, when i use chinese(eg. "中文") as the label, the ui menu shows "??????".  i have try lots of encodings, but not works.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • kwxsp86
    0 kwxsp86 over 1 year ago in reply to CadAP

    yes, i have got this sample before. but, when i use chinese(eg. "中文") as the label, the ui menu shows "??????".  i have try lots of encodings, but not works.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
Cadence Guidelines

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