--------//
// 命令行窗口工具
//--------------------------------------------------------------//
function Console(parentNode, processInputProc) {
// 窗口
var panel = document.createElement("div");
panel.style.width = "250px";
panel.style.height = "250px";
panel.style.borderColor = "#666666";
panel.style.borderWidth = "1px";
panel.style.backgroundColor = "#ffffff";
panel.style.borderStyle = "solid";
panel.style.position = "absolute";
panel.style.zIndex = 100;
parentNode.appendChild(panel);
// 标题栏
var title = document.createElement("div");
title.style.width = "250px";
title.style.height = "15px";
title.style.backgroundColor = "#dddddd";
title.style.fontSize = "12px";
title.style.fontFamily = "verdana,tahoma";
panel.appendChild(title);
// 标题栏拖动窗口功能
var isDragging = false;
var startPos = new Position(panel.offsetLeft, panel.offsetTop);
var startMousePos = new Position(0, 0);
title.onmouseover = function(evt) {
this.style.cursor = "pointer";
}
title.onmousedown = function(evt) {
if (isDragging == true) {
return;
}
var event = evt || window.event;
startMousePos.x = event.clientX;
startMousePos.y = event.clientY;
isDragging = true;
}
title.onmousemove = function(evt) {
if (isDragging == false) {
return;
}