|
发表于 2013-10-18 20:20
|
显示全部楼层
来自: 中国广东广州
import kcs_gui
import kcs_ui
import kcs_util
import os
import sys
def struct_menu2chs():
menu=kcs_gui.menu_get(None, 0)
for i in range(0,20):#主菜单
try:
main_menu=kcs_gui.menu_item_get(menu, i)
if main_menu[0]=="&File":#文件菜单
kcs_gui.menu_item_set(menu, i,"文件(&F)", main_menu[1])
file_menu=kcs_gui.menu_get(menu, i)
for j in range(0,30):#一级菜单
file_menu_item=kcs_gui.menu_item_get(file_menu,j)
if file_menu_item[0]=="&New\tCtrl+N":
kcs_gui.menu_item_set(file_menu, j,"新建(&N)\tCtrl+N", file_menu_item[1])
if file_menu_item[0]=="&Open...\tCtrl+O":
kcs_gui.menu_item_set(file_menu, j,"打开(&O)\tCtrl+O", file_menu_item[1])
if file_menu_item[0]=="&Close":
kcs_gui.menu_item_set(file_menu, j,"关闭(&C)", file_menu_item[1])
if file_menu_item[0]=="&Save\tCtrl+S":
kcs_gui.menu_item_set(file_menu, j,"保存(&S)\tCtrl+S", file_menu_item[1])
if file_menu_item[0]=="Save &As...":
kcs_gui.menu_item_set(file_menu, j,"另存为(&A)", file_menu_item[1])
if file_menu_item[0]=="Revision":
kcs_gui.menu_item_set(file_menu, j,"修订", file_menu_item[1])
file_menu_sub_1=kcs_gui.menu_get(file_menu,j)
for k in range(0,3):#二级菜单
file_menu_sub_1_item=kcs_gui.menu_item_get(file_menu_sub_1,k)
if file_menu_sub_1_item[0]=="Create &New Revision...":
kcs_gui.menu_item_set(file_menu_sub_1, k,"新建(&N)", file_menu_sub_1_item[1])
if file_menu_sub_1_item[0]=="&Freeze Revision":
kcs_gui.menu_item_set(file_menu_sub_1, k,"锁定(&F)", file_menu_sub_1_item[1])
if file_menu_sub_1_item[0]=="&Unfreeze Revision":
kcs_gui.menu_item_set(file_menu_sub_1, k,"取消锁定(&U)", file_menu_sub_1_item[1]) |
|