The <menus> element defines the menus used in the program. Shareaza contains many menus, and each of which is assigned a name to identify it. Skins can override the design for every menu, or just a few. To see what the menus currently look like, check out default-en.xml in your skins folder.
Here is an example from MyMenuSkin.xml:
<?xml version="1.0" encoding="UTF-8"?> <skin xmlns="http://www.shareaza.com/schemas/Skin.xsd" version="1.0"> <manifest name="My Menu Skin" author="Me" type="Skin"/> <menus> <menu name="CHomeWnd"> <item id="ID_TAB_HOME" text="_Home"/> <item id="ID_TAB_LIBRARY" text="_Library"/> <item id="ID_TAB_NETWORK" text="_Network"/> <item id="ID_TAB_TRANSFERS" text="_Transfers"/> <separator/> <item id="ID_TAB_CONNECT" text="_Connect"/> <item id="ID_NETWORK_SEARCH" text="New _Search..."/> </menu> </menus> </skin> |
Each menu is contained within a <menu> element, which is named by a name attribute. A list of current menu names is included at the end of this section (there are many!).
Each menu contains one or more items, which can be either <item>'s, <separator>'s or sub-menus (<menu>'s).
選單項目
Menu items are created with an <item/> element, and are the most common element in menus. Each menu has the following attributes:
- id - The command ID of the menu item, which controls what it actually does.
- text - The text to display next to the icon for the menu item.
分隔
Separators are created with a <separator/> element, and are the second most common element found in menus. Separators have no additional attributes, as they simply produce a "gap" in the menu, often used to group sets of commands together.
Sub-Menus
Menus can be nested by creating sub-menus, or popup-menus within an existing menu. This allows a very logical grouping of commands which can simplify the overall experience. It's easy to create a sub-menu -- simply start a new <menu> element within an existing menu. The only difference is that you don't need to assign a name attribute -- assign a text attribute instead, which will be how the sub-menu is displayed.
例子:
<?xml version="1.0" encoding="UTF-8"?> <skin xmlns="http://www.shareaza.com/schemas/Skin.xsd" version="1.0"> <manifest name="My Menu Skin" author="Me" type="Skin"/> <menus> <menu name="CHomeWnd"> <item id="ID_TAB_HOME" text="_Home"/> <item id="ID_TAB_LIBRARY" text="_Library"/> <item id="ID_TAB_NETWORK" text="_Network"/> <item id="ID_TAB_TRANSFERS" text="_Transfers"/> <separator/> <menu text="_Advanced"> <!--(Sub-Menu)--> <item id="ID_VIEW_SECURITY" text="Se_curity" shortcut="F7"/> <item id="ID_VIEW_HOSTS" text="H_ost Cache" shortcut="F8"/> <item id="ID_VIEW_DISCOVERY" text="Disco_very" shortcut="F9"/> <item id="ID_VIEW_TRAFFIC" text="_Graph" shortcut="F10"/> </menu> <item id="ID_TAB_CONNECT" text="_Connect"/> <item id="ID_NETWORK_SEARCH" text="New _Search..."/> </menu> </menus> </skin> |
選單名稱
For an up-to-date version of names see default-en.xml in your skins folder. A selection of the current menu names are:
選單 | 敘述 |
CBrowseHostWnd | 瀏覽主機視窗的蹦現選單. |
CDiscoveryWnd | 揭示服務視窗的蹦現選單. |
CDownloadTabBar | |
CDownloadsWnd.Completed | 下載視窗的蹦現選單, 在一個完成的下載被選擇時. |
CDownloadsWnd.Download | 下載視窗的蹦現選單, 在一個下載被選擇時. |
CDownloadsWnd.Source | The download window popup menu, when a transfer or source is selected. |
CHitMonitorWnd | The hit monitor window popup menu. |
CHomeWnd | 主頁視窗的蹦現選單. |
CHostCacheWnd | 主機快取視窗的蹦現選單. |
CLibraryFileView | |
CLibraryTileView | |
CLibraryTree.Physical | |
CLibraryTree.Virtual | |
CLibraryWnd.File | 收藏視窗的蹦現選單, 在一個檔案被選擇時. |
CLibraryWnd.Folder | 收藏視窗的蹦現選單, 在一個資料夾被選擇時. |
CMainWnd.Basic | 標準模式的主視窗選單. |
CMainWnd.Tabbed | 標籤模式的主視窗選單. |
CMainWnd.Tray | 蹦現系統選單 |
CMainWnd.Windowed | 多重視窗模式的主視窗選單. |
CMainWnd.View.Tabbed | The popup view menu, when the user right-clicks nowhere. Tabbed mode. |
CMainWnd.View.Windowed | The popup view menu, when the user right-clicks nowhere. Windowed mode. |
CMediaFrame | |
CMediaFrame.Zoom | |
CMediaList | |
CNeighboursWnd | 鄰居視窗的蹦現選單. |
CPrivateChatFrame | |
CSearchMonitorWnd | The search monitor window popup menu. |
CSearchWnd | 搜尋視窗的蹦現選單. |
CSecurityWnd | 安全性視窗的蹦現選單. |
CSystemWnd | 系統視窗的蹦現選單. |
CTrafficWnd | 流量圖表視窗的蹦現選單. |
CUploadsWnd | 上傳視窗的蹦現選單. |