⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main_only.js

📁 vc-mfc编程实例 很简单的东西,以后回多传自己的东西
💻 JS
📖 第 1 页 / 共 2 页
字号:
	submenuIsOpen=false;
}
function showFileMenu() {
	if(currentOpenedTopMenuButton!=null) { closeTopSubNenu(); }
	var fileMenuTopObj=document.getElementById("fileTopMenu");
	fileMenuTopObj.focus();
	currentOpenedTopMenuButton=fileMenuTopObj;
	submenuIsOpen=true;
	fileMenuTopObj.style.backgroundColor="#316AC5";
	fileMenuTopObj.style.color="#ffffff";
	setTimeout(clickTimeout(fileMenuTopObj),20)
}
function showToolsMenu() {
	if(currentOpenedTopMenuButton!=null) { closeTopSubNenu(); }
	var toolsMenuTopObj=document.getElementById("toolsTopMenu");
	toolsMenuTopObj.focus();
	currentOpenedTopMenuButton=toolsMenuTopObj;
	submenuIsOpen=true;
	toolsMenuTopObj.style.backgroundColor="#316AC5";
	toolsMenuTopObj.style.color="#ffffff";
	setTimeout(clickTimeout(toolsMenuTopObj),20)
}
function showHelpMenu() {
	if(currentOpenedTopMenuButton!=null) { closeTopSubNenu(); }
	var helpMenuTopObj=document.getElementById("helpTopMenuA");
	helpMenuTopObj.focus();
	currentOpenedTopMenuButton=helpMenuTopObj;
	submenuIsOpen=true;
	helpMenuTopObj.style.backgroundColor="#316AC5";
	helpMenuTopObj.style.color="#ffffff";
	setTimeout(clickTimeout(helpMenuTopObj),20)
}
////////////////////webmenu function//////////////////////////////////////
////////////////////hot key function//////////////////////////////////////
function declareAltHotKey(key,fun) {
	key=key.toUpperCase();
	var tmpColl=new topMenuEventCollection();
	tmpColl.key=key;
	tmpColl.keyCodeNum=key.charCodeAt(0);
	tmpColl.fireFunction=fun;
	hotKeyList.push(tmpColl);
}

function declareCtrlHotKey(key,fun) {
	key=key.toUpperCase();
	var tmpColl=new topMenuEventCollection();
	tmpColl.key=key;
	tmpColl.keyCodeNum=key.charCodeAt(0);
	tmpColl.fireFunction=fun;
	ctrlHotKeyList.push(tmpColl);
}

var topMenuEventCollection=function() {
	this.key="";
	this.keyCodeNum=0;
	this.fireFunction=function(){}
}

function fireCtrlHotKey(code,fireFrom) {
	for (i=0;i<ctrlHotKeyList.length;i++) {
		if(ctrlHotKeyList[i].keyCodeNum==code) {
			ctrlHotKeyList[i].fireFunction();
			//alert(fireFrom.outerHTML);
		}
	}
}

function fireHotKey(code,fireFrom) {
	//alert(hotKeyList.length);
	for (i=0;i<hotKeyList.length;i++) {
		if(hotKeyList[i].keyCodeNum==code) {
			hotKeyList[i].fireFunction();
			//alert(fireFrom.outerHTML);
			if (fireFrom.tagName=="A" || toUpperCase(fireFrom.tagName)=="OBJECT") {
				fireFrom.blur();
			}
		}
	}
}

function fireUpKeyEvent() {
	if (!submenuIsOpen) return;
	subMenuListArray=document.getElementById(currentOpenedTopMenuButton.submenuid).childNodes;
	highLightIndex=0;
	tempIndexId=0;
	for(i=0;i<subMenuListArray.length;i++) {
		if (subMenuListArray[i].style.backgroundColor!="") {
			tempIndexId=i;
		}
		subMenuListArray[i].style.backgroundColor="";
		subMenuListArray[i].style.color="#000000";
		if (subMenuListArray[i].className=="upMenuStyle") {
			subMenuListArray[i].style.backgroundImage="url(images/topMenuDiv.jpg)";
		}
	}
	if (tempIndexId>0) {
		highLightIndex=tempIndexId-1;
	}
	if (tempIndexId==0) {
		highLightIndex=subMenuListArray.length-1;
	}
	subMenuListArray[highLightIndex].style.backgroundColor="#316AC5";
	subMenuListArray[highLightIndex].style.color="#ffffff";
	if (subMenuListArray[highLightIndex].className=="upMenuStyle") {
		subMenuListArray[highLightIndex].style.backgroundImage="none";
	}
}

function fireDownKeyEvent() {
	if (!submenuIsOpen) return;
	subMenuListArray=document.getElementById(currentOpenedTopMenuButton.submenuid).childNodes;
	highLightIndex=0;
	tempIndexId=-1;
	for(i=0;i<subMenuListArray.length;i++) {
		if (subMenuListArray[i].style.backgroundColor!="") {
			tempIndexId=i;
		}
		if (tempIndexId==subMenuListArray.length-1) {
			tempIndexId=-1;
		}
		subMenuListArray[i].style.backgroundColor="";
		subMenuListArray[i].style.color="#000000";
		if (subMenuListArray[i].className=="upMenuStyle") {
			subMenuListArray[i].style.backgroundImage="url(images/topMenuDiv.jpg)";
		}
	}
	if (tempIndexId<subMenuListArray.length-1) {
		highLightIndex=tempIndexId+1;
	}
	subMenuListArray[highLightIndex].style.backgroundColor="#316AC5";
	subMenuListArray[highLightIndex].style.color="#ffffff";
	if (subMenuListArray[highLightIndex].className=="upMenuStyle") {
		subMenuListArray[highLightIndex].style.backgroundImage="none";
	}
}

function fireLeftKeyEvent() {
	if (currentOpenedTopMenuButton==null) {
		return;
	}
	var inextId=-1;
	var tmpTopElementCon=currentOpenedTopMenuButton;
	for (var i=0;i<globeTopMenuListArray.length;i++) {
		if(globeTopMenuListArray[i]==tmpTopElementCon) {
			inextId=i;
			inextId-=1;
			break;
		}
	}
	if (inextId<0) {
		inextId=globeTopMenuListArray.length-1;
	}
	closeTopSubNenu();
	if(globeTopMenuListArray[inextId].id=="fileTopMenu") {
		showFileMenu();
	}	
	else if (globeTopMenuListArray[inextId].id=="toolsTopMenu") {
		showToolsMenu();
	}
	else if (globeTopMenuListArray[inextId].id=="helpTopMenuA")	{
		showHelpMenu();
	}
}

function fireRightKeyEvent() {
	if (currentOpenedTopMenuButton==null) {	return;	}
	var inextId=-1;
	var tmpTopElementCon=currentOpenedTopMenuButton;
	for (var i=0;i<globeTopMenuListArray.length;i++) {
		if(globeTopMenuListArray[i]==tmpTopElementCon) {
			inextId=i;
			inextId+=1;
			break;
		}
	}
	if (inextId==-1) { return; }
	if (inextId>globeTopMenuListArray.length-1) { inextId=0; }
//	alert(globeTopMenuListArray[inextId].id);
	closeTopSubNenu();
	if(globeTopMenuListArray[inextId].id=="fileTopMenu") { showFileMenu(); }	
	else if (globeTopMenuListArray[inextId].id=="toolsTopMenu") { showToolsMenu(); }
	else if (globeTopMenuListArray[inextId].id=="helpTopMenuA") { showHelpMenu(); }
}

function fireEnterKeyEvent()
{
	if (!submenuIsOpen) return;
	subMenuListArray=document.getElementById(currentOpenedTopMenuButton.submenuid).childNodes;
	for(i=0;i<subMenuListArray.length;i++) {
		if (subMenuListArray[i].style.backgroundColor!="") {
			menuFireEvent(subMenuListArray[i].iid);
		}
	}
}

function fireEscKeyEvent()
{
	closeTopSubNenu();
}

function fireOtherKeyEvent(code)
{
	if (currentOpenedTopMenuButton==null) { return; }
	var parentMenuObj=document.getElementById(currentOpenedTopMenuButton.submenuid);
	if (parentMenuObj==null) { return; }
	var listArray1=parentMenuObj.childNodes;
	var currentPressKey=(String.fromCharCode(code));
	for(i=0;i<listArray1.length;i++) {
		if (currentPressKey==listArray1[i].hotkeyflag) {
			if (listArray1[i].style.display=="none") { return; }
			listArray1[i].click();
			return;
		}
	}
}

function isTopSubMenuOpened() {
	if(currentOpenedTopMenuButton==null) { return false; }
	else { return true; }
}
////////////////////hot key function//////////////////////////////////////

///////////////////window function///////////////////////////////////////
function moveWindow() {
	if (isMove) {
		closeTopSubNenu();
		window.external.OnMoveWindow();
	}
}
//////////////////file operation //////////////////////////////////////
function FileExit() { ExitWindow(); }
//////////////////file operation finish//////////////////////////////////////
/////////////////tools operation////////////////////////////////////////
function BrowseImageForImage() {
	var browseFile = Main_Object.BrowerImgFile();
	if ( browseFile == "" ) { return ""; }
//	Int    IsImgLegal(char *imgFile); 0 合法,非0非法, check image start
	if (Main_Object.IsImgLegal(browseFile)!=0) {
		RIT_popMsg('',264,135,'ok',GS("BrowseImageForImageImageBad"),'alert');
		return "";
	}
	else {
		var hasPwd = Main_Object.IsImgHasPwd(browseFile);
		if( hasPwd!=0 ) {
			window.external.SetStaticData(browseFile);
			window.external.Navigate("mainui/check.html", 300, 200);
			var returnString = window.external.GetStaticData();
			if( returnString != "ok" ) {
				return "";
			}
		}
	}
	return browseFile;
}
function ToolsCheckImage() {
	var browseFile = BrowseImageForImage();
	if (browseFile!="") {
		window.external.SetStaticData(browseFile);
		IframeMainUI.location = "CheckImageProcess.html";
	}
}
function ToolsMountImage() {
	IframeMainUI.location = "Mount.htm";return;
	var browseFile = BrowseImageForImage();
	if (browseFile!="") {
		window.external.SetStaticData(browseFile);
		IframeMainUI.location = "MountImage.htm";
	}
}
function ToolsUmountIMage() {
	IframeMainUI.location = "UnMountImage.htm";
	//Main_Object.UmountIMageFile();
}
/////////////////tools operation////////////////////////////////////////
////////////////help operation /////////////////////////////////////////
function HelpHelp() {
	var helpPath = window.external.GetCurPath();
	window.showHelp(helpPath+"/../DClone.CHM");
}
////////////////help operation /////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -