📄 render.windowpane.js
字号:
if (y != null) { if (this._containerSize.height > 0 && y > this._containerSize.height - this._windowHeight) { y = this._containerSize.height - this._windowHeight; } if (y < 0) { y = 0; } this._windowY = y; } this.redraw(); }, redraw: function() { var borderSideWidth = this._windowWidth - this._borderInsets.left - this._borderInsets.right; var borderSideHeight = this._windowHeight - this._borderInsets.top - this._borderInsets.bottom; this._windowPaneDivElement.style.left = this._windowX + "px"; this._windowPaneDivElement.style.top = this._windowY + "px"; this._windowPaneDivElement.style.width = this._windowWidth + "px"; this._windowPaneDivElement.style.height = this._windowHeight + "px"; this._titleBarDivElement.style.width = (this._windowWidth - this._contentInsets.left - this._contentInsets.right) + "px"; this._borderDivElements[1].style.width = borderSideWidth + "px"; this._borderDivElements[6].style.width = borderSideWidth + "px"; this._borderDivElements[3].style.height = borderSideHeight + "px"; this._borderDivElements[4].style.height = borderSideHeight + "px"; WebCore.VirtualPosition.redraw(this._contentDivElement); WebCore.VirtualPosition.redraw(this._maskDivElement); }, _removeBorderListeners: function() { WebCore.EventProcessor.remove(document.body, "mousemove", this._processBorderMouseMoveRef, true); WebCore.EventProcessor.remove(document.body, "mouseup", this._processBorderMouseUpRef, true); }, _removeTitleBarListeners: function() { WebCore.EventProcessor.remove(document.body, "mousemove", this._processTitleBarMouseMoveRef, true); WebCore.EventProcessor.remove(document.body, "mouseup", this._processTitleBarMouseUpRef, true); }, renderAdd: function(update, parentElement) { this._loadPositionAndSize(); this._minimumWidth = EchoAppRender.Extent.toPixels( this.component.render("minimumWidth", EchoApp.WindowPane.DEFAULT_MINIMUM_WIDTH), true); this._minimumHeight = EchoAppRender.Extent.toPixels( this.component.render("minimumHeight", EchoApp.WindowPane.DEFAULT_MINIMUM_HEIGHT), false); this._maximumWidth = EchoAppRender.Extent.toPixels(this.component.render("maximumWidth"), true); this._maximumHeight = EchoAppRender.Extent.toPixels(this.component.render("maximumHeight"), false); var border = this.component.render("border", EchoApp.WindowPane.DEFAULT_BORDER); this._borderInsets = EchoAppRender.Insets.toPixels(border.borderInsets); this._contentInsets = EchoAppRender.Insets.toPixels(border.contentInsets); var movable = this.component.render("movable", true); var resizable = this.component.render("resizable", true); var closable = this.component.render("closable", true); this._windowPaneDivElement = document.createElement("div"); this._windowPaneDivElement.id = this.component.renderId; this._windowPaneDivElement.tabIndex = "0"; this._windowPaneDivElement.style.outlineStyle = "none"; this._windowPaneDivElement.style.position = "absolute"; this._windowPaneDivElement.style.zIndex = 1; this._windowPaneDivElement.style.overflow = "hidden"; if (this._windowX != null) { this._windowPaneDivElement.style.left = this._windowX + "px"; } if (this._windowY != null) { this._windowPaneDivElement.style.top = this._windowY + "px"; } this._windowPaneDivElement.style.width = this._windowWidth + "px"; this._windowPaneDivElement.style.height = this._windowHeight + "px"; EchoAppRender.Font.render(this.component.render("font"), this._windowPaneDivElement); var borderSideWidth = this._windowWidth - this._borderInsets.left - this._borderInsets.right; var borderSideHeight = this._windowHeight - this._borderInsets.top - this._borderInsets.bottom; this._borderDivElements = new Array(8); var fillImageFlags = this.component.render("ieAlphaRenderBorder") ? EchoAppRender.FillImage.FLAG_ENABLE_IE_PNG_ALPHA_FILTER : 0; // Render top row if (this._borderInsets.top > 0) { // Render top left corner if (this._borderInsets.left > 0) { this._borderDivElements[0] = document.createElement("div"); this._borderDivElements[0].style.zIndex = 2; this._borderDivElements[0].style.fontSize = "1px"; this._borderDivElements[0].style.position = "absolute"; this._borderDivElements[0].style.left = "0px"; this._borderDivElements[0].style.top = "0px"; this._borderDivElements[0].style.width = this._borderInsets.left + "px"; this._borderDivElements[0].style.height = this._borderInsets.top + "px"; if (border.color != null) { this._borderDivElements[0].style.backgroundColor = border.color; } if (resizable) { this._borderDivElements[0].style.cursor = "nw-resize"; } if (border.topLeft) { EchoAppRender.FillImage.render(border.topLeft, this._borderDivElements[0], fillImageFlags); } this._windowPaneDivElement.appendChild(this._borderDivElements[0]); } // Render top side this._borderDivElements[1] = document.createElement("div"); this._borderDivElements[1].style.zIndex = 2; this._borderDivElements[1].style.fontSize = "1px"; this._borderDivElements[1].style.position = "absolute"; this._borderDivElements[1].style.left = this._borderInsets.left + "px"; this._borderDivElements[1].style.top = "0px"; this._borderDivElements[1].style.width = borderSideWidth + "px"; this._borderDivElements[1].style.height = this._borderInsets.top + "px"; if (border.color != null) { this._borderDivElements[1].style.backgroundColor = border.color; } if (resizable) { this._borderDivElements[1].style.cursor = "n-resize"; } if (border.top) { EchoAppRender.FillImage.render(border.top, this._borderDivElements[1], fillImageFlags); } this._windowPaneDivElement.appendChild(this._borderDivElements[1]); // Render top right corner if (this._borderInsets.right > 0) { this._borderDivElements[2] = document.createElement("div"); this._borderDivElements[2].style.zIndex = 2; this._borderDivElements[2].style.fontSize = "1px"; this._borderDivElements[2].style.position = "absolute"; this._borderDivElements[2].style.right = "0px"; this._borderDivElements[2].style.top = "0px"; this._borderDivElements[2].style.width = this._borderInsets.right + "px"; this._borderDivElements[2].style.height = this._borderInsets.top + "px"; if (border.color != null) { this._borderDivElements[2].style.backgroundColor = border.color; } if (resizable) { this._borderDivElements[2].style.cursor = "ne-resize"; } if (border.topRight) { EchoAppRender.FillImage.render(border.topRight, this._borderDivElements[2], fillImageFlags); } this._windowPaneDivElement.appendChild(this._borderDivElements[2]); } } // Render left side if (this._borderInsets.left > 0) { this._borderDivElements[3] = document.createElement("div"); this._borderDivElements[3].style.zIndex = 2; this._borderDivElements[3].style.fontSize = "1px"; this._borderDivElements[3].style.position = "absolute"; this._borderDivElements[3].style.left = "0px"; this._borderDivElements[3].style.top = this._borderInsets.top + "px"; this._borderDivElements[3].style.width = this._borderInsets.left + "px"; this._borderDivElements[3].style.height = borderSideHeight + "px"; if (border.color != null) { this._borderDivElements[3].style.backgroundColor = border.color; } if (resizable) { this._borderDivElements[3].style.cursor = "w-resize"; } if (border.left) { EchoAppRender.FillImage.render(border.left, this._borderDivElements[3], fillImageFlags); } this._windowPaneDivElement.appendChild(this._borderDivElements[3]); } // Render right side if (this._borderInsets.right > 0) { this._borderDivElements[4] = document.createElement("div"); this._borderDivElements[4].style.zIndex = 2; this._borderDivElements[4].style.fontSize = "1px"; this._borderDivElements[4].style.position = "absolute"; this._borderDivElements[4].style.right = "0px"; this._borderDivElements[4].style.top = this._borderInsets.top + "px"; this._borderDivElements[4].style.width = this._borderInsets.right + "px"; this._borderDivElements[4].style.height = borderSideHeight + "px"; if (border.color != null) { this._borderDivElements[4].style.backgroundColor = border.color; } if (resizable) { this._borderDivElements[4].style.cursor = "e-resize"; } if (border.right) { EchoAppRender.FillImage.render(border.right, this._borderDivElements[4], fillImageFlags); } this._windowPaneDivElement.appendChild(this._borderDivElements[4]); } // Render bottom row if (this._borderInsets.bottom > 0) { // Render bottom left corner if (this._borderInsets.left > 0) { this._borderDivElements[5] = document.createElement("div"); this._borderDivElements[5].style.zIndex = 2; this._borderDivElements[5].style.fontSize = "1px"; this._borderDivElements[5].style.position = "absolute"; this._borderDivElements[5].style.left = "0px"; this._borderDivElements[5].style.bottom = "0px"; this._borderDivElements[5].style.width = this._borderInsets.left + "px"; this._borderDivElements[5].style.height = this._borderInsets.bottom + "px"; if (border.color != null) { this._borderDivElements[5].style.backgroundColor = border.color; } if (resizable) { this._borderDivElements[5].style.cursor = "sw-resize"; } if (border.bottomLeft) { EchoAppRender.FillImage.render(border.bottomLeft, this._borderDivElements[5], fillImageFlags); } this._windowPaneDivElement.appendChild(this._borderDivElements[5]); } // Render bottom side this._borderDivElements[6] = document.createElement("div"); this._borderDivElements[6].style.zIndex = 2; this._borderDivElements[6].style.fontSize = "1px"; this._borderDivElements[6].style.position = "absolute"; this._borderDivElements[6].style.left = this._borderInsets.left + "px"; this._borderDivElements[6].style.bottom = "0px"; this._borderDivElements[6].style.width = borderSideWidth + "px"; this._borderDivElements[6].style.height = this._borderInsets.bottom + "px"; if (border.color != null) { this._borderDivElements[6].style.backgroundColor = border.color; } if (resizable) { this._borderDivElements[6].style.cursor = "s-resize"; } if (border.bottom) { EchoAppRender.FillImage.render(border.bottom, this._borderDivElements[6], fillImageFlags); } this._windowPaneDivElement.appendChild(this._borderDivElements[6]); // Render bottom right corner if (this._borderInsets.right > 0) { this._borderDivElements[7] = document.createElement("div"); this._borderDivElements[7].style.zIndex = 2; this._borderDivElements[7].style.fontSize = "1px";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -