|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 XYX365 于 2016-1-25 13:42 编辑
如何把自己的菜单插入到allegro menu,使用動態選單
;filename:fDynamicMenus.il
;此程式只適用於Allegro v16.3以上
;必須直接加載到allegro.ilinit檔裡面,不能在其他地方載入此程式
;此程式可以設計成中英文語言的選單
; Load: load("fDynamicMenus.il")
;附件程式不包含選單上的任一程式工具
fDynamicMenus.rar
(1.71 KB, 下载次数: 49)
- ;filename:fDynamicMenus.il
- ;此程式只適用於Allegro v16.3以上
- ;必須直接加載到allegro.ilinit檔裡面,不能在其他地方載入此程式
- ;此程式可以設計成中英文語言的選單
- ; Load: load("fDynamicMenus.il")
- setShellEnvVar("LANG=ENG") ;強制設定為英文選單
- case(getShellEnvVar("LANG")
- ("GB"
- ;這裡是擺放簡體中文位置,沒有完成,必須自行建立
- lskillMenu = '(
- (popup "EDA365 Skill for Test") ;主選單上的名稱
- ("Chinese Transfer" "(fnChineseTransform)") ;第一個字串是顯示在選單上,第二個字串是執行命令
- ("Quick Open" "filemgr") ;程式選單項目
- (separator) ;區格線
- ("Netin,3rd Party" "netin3rd_protel")
- ("Compare Net_Changes" "gnetrpt")
- ("Compare BRD_Changes" "component_changes")
- ("Clear Layout TempFile" "tmpdel")
- ("Check Height" "heightchk")
- ("Hilight TestPoint Net" "hlnpt")
- ("Set_drillkey" "setdrill")
- ("Set Design Color" "s1")
- ("Show Height/width" "draw targets")
- ("Add Layer" "addlayer")
- ("Calc Trace Width" "twcal")
- ("Calc Via Quantity" "viacal")
- ("Cut Line" "clinecut")
- ("Cut Shape" "cutshape")
- ("Check width" "chgew")
- ("Etch Cross Check" "ecp")
- (popup "Text Function") ;子選單名稱
- ("Edit TextBlock" "settxtpw")
- ("SilkScreen Export/inport" "text_out_in")
- ("Move Text2Center" "r2c")
- ("Check_NoRefdes" "ch_noref")
- ("Check_refdes_direction" "ch_dir")
- ("Check_text_grap" "ch_text_overlap")
- (end)
- (popup "SplitPlane")
- ("SplitPlane_CreateLayers" "SplitPlane_CreateLayers")
- ("SplitPlane_CreateShapes" "SplitPlane_CreateShapes")
- (end)
- (popup "DataBase Check")
- ("DataBase &Check..." "dbdoctor")
- ("DANGLING CHECK" "dangling")
- ("DumpVia CHECK" "check_dvia")
- (end)
- (popup "TAPEOUT")
- ("Artwork..." "artwork")
- (separator)
- (popup "AUTO DRILL")
- ("SET NCcustom" "setnccus")
- ("Drill Legend" "nclegend")
- ("Drill Route" "ncdr")
- (end)
- ("Setting FilmControl" "efilm")
- ("Auto CreateArtWork" "ns_gerber")
- ("Output GFile" "outfilm")
- ("draw pin hole" "draw pin hole")
- ("Ouput DXF/RefPdf/IPC356" "odxf")
- ("Ouput SymLoc" "inform")
- (popup "Sort Output File")
- ("Move Gfile" "sortgfile")
- ("Zip Gerber" "gzip")
- (end)
- (end)
- ("Export CAD" "cadout")
- (separator)
- (popup "[ System Tools ]")
- ("[ Snap Screen ]" "system snippingtool")
- ("[ Run Notepad ]" "system notepad")
- ("[ Run Calculator ]" "system calc")
- ("[ Run Paint ]" "system mspaint")
- ("[ Run CMD ]" "system")
- (end)
- (end)
- )
- )
- ("BIG5"
- ;這裡是擺放繁體中文位置,沒有完成,必須自行建立
- lSkillMenu = '(
- (popup "EDA365 Skill for Test") ;主選單上的名稱
- ;第一個字串是顯示在選單上,第二個字串是執行命令
- ("\244\244\244\345" "(fnChineseTransform)") ;中文碼轉八進位的ASCII碼
- ("Quick Open" "filemgr") ;程式選單項目
- (separator) ;區格線
- ("Netin,3rd Party" "netin3rd_protel")
- ("Compare Net_Changes" "gnetrpt")
- ("Compare BRD_Changes" "component_changes")
- ("Clear Layout TempFile" "tmpdel")
- ("Check Height" "heightchk")
- ("Hilight TestPoint Net" "hlnpt")
- ("Set_drillkey" "setdrill")
- ("Set Design Color" "s1")
- ("Show Height/width" "draw targets")
- ("Add Layer" "addlayer")
- ("Calc Trace Width" "twcal")
- ("Calc Via Quantity" "viacal")
- ("Cut Line" "clinecut")
- ("Cut Shape" "cutshape")
- ("Check width" "chgew")
- ("Etch Cross Check" "ecp")
- (popup "Text Function") ;子選單名稱
- ("Edit TextBlock" "settxtpw")
- ("SilkScreen Export/inport" "text_out_in")
- ("Move Text2Center" "r2c")
- ("Check_NoRefdes" "ch_noref")
- ("Check_refdes_direction" "ch_dir")
- ("Check_text_grap" "ch_text_overlap")
- (end)
- (popup "SplitPlane")
- ("SplitPlane_CreateLayers" "SplitPlane_CreateLayers")
- ("SplitPlane_CreateShapes" "SplitPlane_CreateShapes")
- (end)
- (popup "DataBase Check")
- ("DataBase &Check..." "dbdoctor")
- ("DANGLING CHECK" "dangling")
- ("DumpVia CHECK" "check_dvia")
- (end)
- (popup "TAPEOUT")
- ("Artwork..." "artwork")
- (separator)
- (popup "AUTO DRILL")
- ("SET NCcustom" "setnccus")
- ("Drill Legend" "nclegend")
- ("Drill Route" "ncdr")
- (end)
- ("Setting FilmControl" "efilm")
- ("Auto CreateArtWork" "ns_gerber")
- ("Output GFile" "outfilm")
- ("draw pin hole" "draw pin hole")
- ("Ouput DXF/RefPdf/IPC356" "odxf")
- ("Ouput SymLoc" "inform")
- (popup "Sort Output File")
- ("Move Gfile" "sortgfile")
- ("Zip Gerber" "gzip")
- (end)
- (end)
- ("Export CAD" "cadout")
- (separator)
- (popup "[ System Tools ]")
- ("[ Snap Screen ]" "system snippingtool")
- ("[ Run Notepad ]" "system notepad")
- ("[ Run Calculator ]" "system calc")
- ("[ Run Paint ]" "system mspaint")
- ("[ Run CMD ]" "system")
- (end)
- (end)
- )
- )
- (t
- ;這裡是擺放英文位置
- lSkillMenu = '(
- (popup "EDA365 Skill for Test") ;主選單上的名稱
- ("Chinese Transfer" "(fnChineseTransform)") ;第一個字串是顯示在選單上,第二個字串是執行命令
- ("Quick Open" "filemgr") ;程式選單項目
- (separator) ;區格線
- ("Netin,3rd Party" "netin3rd_protel")
- ("Compare Net_Changes" "gnetrpt")
- ("Compare BRD_Changes" "component_changes")
- ("Clear Layout TempFile" "tmpdel")
- ("Check Height" "heightchk")
- ("Hilight TestPoint Net" "hlnpt")
- ("Set_drillkey" "setdrill")
- ("Set Design Color" "s1")
- ("Show Height/width" "draw targets")
- ("Add Layer" "addlayer")
- ("Calc Trace Width" "twcal")
- ("Calc Via Quantity" "viacal")
- ("Cut Line" "clinecut")
- ("Cut Shape" "cutshape")
- ("Check width" "chgew")
- ("Etch Cross Check" "ecp")
- (popup "Text Function") ;子選單名稱
- ("Edit TextBlock" "settxtpw")
- ("SilkScreen Export/inport" "text_out_in")
- ("Move Text2Center" "r2c")
- ("Check_NoRefdes" "ch_noref")
- ("Check_refdes_direction" "ch_dir")
- ("Check_text_grap" "ch_text_overlap")
- (end)
- (popup "SplitPlane")
- ("SplitPlane_CreateLayers" "SplitPlane_CreateLayers")
- ("SplitPlane_CreateShapes" "SplitPlane_CreateShapes")
- (end)
- (popup "DataBase Check")
- ("DataBase &Check..." "dbdoctor")
- ("DANGLING CHECK" "dangling")
- ("DumpVia CHECK" "check_dvia")
- (end)
- (popup "TAPEOUT")
- ("Artwork..." "artwork")
- (separator)
- (popup "AUTO DRILL")
- ("SET NCcustom" "setnccus")
- ("Drill Legend" "nclegend")
- ("Drill Route" "ncdr")
- (end)
- ("Setting FilmControl" "efilm")
- ("Auto CreateArtWork" "ns_gerber")
- ("Output GFile" "outfilm")
- ("draw pin hole" "draw pin hole")
- ("Ouput DXF/RefPdf/IPC356" "odxf")
- ("Ouput SymLoc" "inform")
- (popup "Sort Output File")
- ("Move Gfile" "sortgfile")
- ("Zip Gerber" "gzip")
- (end)
- (end)
- ("Export CAD" "cadout")
- (separator)
- (popup "[ System Tools ]")
- ("[ Snap Screen ]" "system snippingtool")
- ("[ Run Notepad ]" "system notepad")
- ("[ Run Calculator ]" "system calc")
- ("[ Run Paint ]" "system mspaint")
- ("[ Run CMD ]" "system")
- (end)
- (end)
- )
- )
- )
- procedure(fnDynamicMenusTrig(tMenuFile)
- let((xMenuID)
- when(tMenuFile == "allegro" ;只判斷第一次載入及執行,如果沒有此判斷的話,有其他程式也是使用動態選單時,就會再加載一次
- xMenuID = axlUIMenuFind(nil -1)
- axlUIMenuInsert(xMenuID lSkillMenu)
- )
- )
- )
- procedure(fnChineseTransform() ;中文碼轉八進位的ASCII碼函數
- axlUIPrompt("Code:",sprintf(nil,"%L",axlUIPrompt("Please Input Chinese:")))
- )
- ; Using the trigger function directly
- axlTriggerSet('menu 'fnDynamicMenusTrig)
复制代码
|
|