菜单栏一般位于应用软件界面标题栏的下方,它可以包含若干菜单项、工具条、输入框、下拉框以及导航栏的标签页,菜单和工具条的每一个子控件对应一个应用功能,点击菜单项或者工具按钮即可触发,输入框一般和应用方案的状态参数所绑定,通过输入框的回车事件触发,下拉框和应用方案的可选项参数所绑定,通过改变下拉框的当前项触发它对应的功能,导航标签页是按照标签页显示功能导航栏中的模块划分,它的标签数据来源于功能导航栏的配置文件,导航标签页仅用于帮助用户切换导航栏中的功能模块,它不触发任何功能。这些控件按照顺序从左到右水平放置在菜单栏位置。菜单栏通过XML文件配置,菜单项、工具条、输入框、下拉框以及导航栏与配置文件根节点下的子节点一一对应,其中菜单项标签为menu,工具条标签为module,输入框标签为Edit,下拉框标签为Combo,导航标签页为module_tab。其中输入框和下拉框与XCGS定制系统中的用法相同,菜单项、工具条在下面章节说明。
菜单项标签为menu,它可以包含若干动作定义子节点,也可以嵌套包含子菜单节点。动作子节点的标签为action,包含图标等属性,可参考界面定制系统里的说明
用于设置动作控件的显示文本,其值类型为字符串。参考示例:text=“hello”。
工具条标签为module,它包含一系列动作定义子节点,动作子节点的标签为action,包含图标等属性,可参考界面定制系统里的说明。菜单栏中的工具条里面的按钮均按水平布局。
输入框标签为Edit,可参考界面定制系统里的说明。
下拉框标签为Combo,可参考界面定制系统里的说明。
菜单项标签为module_tab,无属性。仅用于指定在菜单栏显示功能导航栏的模块划分。
<menu_bar> <menu text=" 文件 "> <action tip="New" cid="NewDocument" icon="icons/file_new.png"/> <action tip="Open" cid="OpenDocument" icon="icons/file_open.png"/> <action tip="Save As" cid="SaveAs" icon="icons/saveas.png"/> <action tip="Save" cid="SaveDocument" icon="icons/save.png"/> <action tip="Close" cid="CloseDocument" icon="icons/closedoc.png"/> <action tip="TileWnd" cid="TileWindow" icon="icons/closedoc.png"/> </menu> <module text="general"> <action tip="New" cid="NewDocument" icon="icons/file_new.png"/> <action tip="Open" cid="OpenDocument" icon="icons/file_open.png"/> <action tip="Save As" cid="SaveAs" icon="icons/saveas.png"/> <action tip="Save" cid="SaveDocument" icon="icons/save.png"/> <action tip="Close" cid="CloseDocument" icon="icons/closedoc.png"/> </module> <Combo cid="SetCurrentModel" width="200"/> <Combo cid="search.type" width="100"> <option text="节点" value="50000"/> <option text="单元" value="60000"/> <option text="顶点" value="70001"/> <option text="边" value="70002"/> <option text="面" value="70003"/> <option text="体" value="70004"/> <option text="部件" value="80001"/> <option text="命令" value="-1"/> </Combo> <Edit text="搜索" cid="search.id" width="120"></Edit> <module_tab /> </menu_bar>