// AZJIO, 07.2019
if(!AkelPad.Include("ShowMenu.js")) WScript.Quit();
var lpItems; // массив пунктов меню
var nItem; // число пунктов меню

// Получение координат меню
var nX, nY;
var lpRECT = AkelPad.MemAlloc(16 /*sizeof(RECT)*/ );

AkelPad.SystemFunction().Call("User32::GetWindowRect", AkelPad.GetEditWnd(), lpRECT);

nX = AkelPad.MemRead(_PtrAdd(lpRECT, 0), 3 /*DT_DWORD*/ );
nY = AkelPad.MemRead(_PtrAdd(lpRECT, 4), 3 /*DT_DWORD*/ );
nX += (AkelPad.MemRead(_PtrAdd(lpRECT, 8), 3 /*DT_DWORD*/ ) - nX) / 2;
nY += (AkelPad.MemRead(_PtrAdd(lpRECT, 12), 3 /*DT_DWORD*/ ) - nY) / 2;

AkelPad.MemFree(lpRECT);
// Конец: Получение координат меню

// Название пункта учитывать что при появлении меню можно нажать первую букву пункта, чтобы вызвать пункт (текущая раскладка клавиатуры учитывается)
lpItems = [["Clipboard-Eng.txt", MF_NORMAL, 101],
["Coder-Eng.txt", MF_NORMAL, 102],
["ContextMenu-Eng.txt", MF_NORMAL, 103],
["Exit-Eng.txt", MF_NORMAL, 104],
["Explorer-Eng.txt", MF_NORMAL, 105],
["Fonts-Eng.txt", MF_NORMAL, 106],
["Format-Eng.txt", MF_NORMAL, 107],
["FullScreen-Eng.txt", MF_NORMAL, 108],
["HexSel-Eng.txt", MF_NORMAL, 109],
["Hotkeys-Eng.txt", MF_NORMAL, 110],
["LineBoard-Eng.txt", MF_NORMAL, 111],
["Log-Eng.txt", MF_NORMAL, 112],
["Macros-Eng.txt", MF_NORMAL, 113],
["MinimizeToTray-Eng.txt", MF_NORMAL, 114],
["QSearch-Eng.txt", MF_NORMAL, 115],
["RecentFiles-Eng.txt", MF_NORMAL, 116],
["SaveFile-Eng.txt", MF_NORMAL, 117],
["Scripts-Eng.txt", MF_NORMAL, 118],
["Scroll-Eng.txt", MF_NORMAL, 119],
["Sessions-Eng.txt", MF_NORMAL, 120],
["SmartSel-Eng.txt", MF_NORMAL, 121],
["Sounds-Eng.txt", MF_NORMAL, 122],
["SpecialChar-Eng.txt", MF_NORMAL, 123],
["SpellCheck-Eng.txt", MF_NORMAL, 124],
["Stats-Eng.txt", MF_NORMAL, 125],
["Templates-Eng.txt", MF_NORMAL, 126],
["ToolBar-Eng.txt", MF_NORMAL, 127],
["XBrackets-Eng.txt", MF_NORMAL, 128]];
nItem = ShowMenu(lpItems, POS_CURSOR, POS_CURSOR);
// nItem=ShowMenu(lpItems, nX-250, nY-100);
if(nItem == -1) {
	WScript.Quit();
} else {
var pPath = AkelPad.GetAkelDir();
	switch(lpItems[nItem][2]) {
		case 101:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Clipboard-Eng.txt");break;
		case 102:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Coder-Eng.txt");break;
		case 103:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\ContextMenu-Eng.txt");break;
		case 104:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Exit-Eng.txt");break;
		case 105:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Explorer-Eng.txt");break;
		case 106:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Fonts-Eng.txt");break;
		case 107:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Format-Eng.txt");break;
		case 108:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\FullScreen-Eng.txt");break;
		case 109:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\HexSel-Eng.txt");break;
		case 110:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Hotkeys-Eng.txt");break;
		case 111:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\LineBoard-Eng.txt");break;
		case 112:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Log-Eng.txt");break;
		case 113:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Macros-Eng.txt");break;
		case 114:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\MinimizeToTray-Eng.txt");break;
		case 115:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\QSearch-Eng.txt");break;
		case 116:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\RecentFiles-Eng.txt");break;
		case 117:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\SaveFile-Eng.txt");break;
		case 118:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Scripts-Eng.txt");break;
		case 119:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Scroll-Eng.txt");break;
		case 120:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Sessions-Eng.txt");break;
		case 121:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\SmartSel-Eng.txt");break;
		case 122:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Sounds-Eng.txt");break;
		case 123:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\SpecialChar-Eng.txt");break;
		case 124:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\SpellCheck-Eng.txt");break;
		case 125:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Stats-Eng.txt");break;
		case 126:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\Templates-Eng.txt");break;
		case 127:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\ToolBar-Eng.txt");break;
		case 128:AkelPad.OpenFile(pPath + "\\AkelFiles\\Docs\\XBrackets-Eng.txt");break;
	};
}
