Adding disassembler to CPU window
This commit is contained in:
+23
-17
@@ -5,7 +5,11 @@ Toolkit.Window = class Window extends Toolkit.Panel {
|
||||
|
||||
// Object constructor
|
||||
constructor(application, options) {
|
||||
super(application, options);
|
||||
super(application, options ? {
|
||||
height : options.height,
|
||||
visible: true,
|
||||
width : options.width
|
||||
} : {});
|
||||
options = options || {};
|
||||
|
||||
// Configure instance fields
|
||||
@@ -15,15 +19,17 @@ Toolkit.Window = class Window extends Toolkit.Panel {
|
||||
this.dragCursor = { x: 0, y: 0 };
|
||||
this.dragEdge = null;
|
||||
this.dragPointer = null;
|
||||
this.initialCenter = "center" in options ? !!options.center : false;
|
||||
this.lastFocus = this.element;
|
||||
this.shown = this.visible;
|
||||
this.shown = "visible" in options ? !!options.visible : true;
|
||||
this.visible = this.shown;
|
||||
|
||||
// Configure element
|
||||
this.setLayout("grid", { columns: "auto" });
|
||||
this.setRole("dialog");
|
||||
this.setLocation(0, 0);
|
||||
this.element.style.position = "absolute";
|
||||
if (!this.shown)
|
||||
this.element.style.visibility = "hidden";
|
||||
this.element.setAttribute("aria-modal", "false");
|
||||
this.element.setAttribute("focus" , "false");
|
||||
this.element.setAttribute("tabindex" , "0" );
|
||||
@@ -90,6 +96,13 @@ Toolkit.Window = class Window extends Toolkit.Panel {
|
||||
this.closeListeners.push(listener);
|
||||
}
|
||||
|
||||
// Request focus on the appropriate element
|
||||
focus() {
|
||||
if (this.lastFocus != this)
|
||||
this.lastFocus.focus();
|
||||
else this.element.focus();
|
||||
}
|
||||
|
||||
// Retrieve the window's title text
|
||||
getTitle() {
|
||||
return this.title.getText();
|
||||
@@ -107,11 +120,15 @@ Toolkit.Window = class Window extends Toolkit.Panel {
|
||||
|
||||
// Specify whether the component is visible
|
||||
setVisible(visible, focus) {
|
||||
super.setVisible(visible);
|
||||
this.visible = visible = !!visible;
|
||||
if (!visible) {
|
||||
this.element.style.visibility = "hidden";
|
||||
return;
|
||||
}
|
||||
this.element.style.removeProperty("visibility");
|
||||
if (this.client === undefined)
|
||||
return;
|
||||
if (visible)
|
||||
this.contain();
|
||||
this.contain();
|
||||
if (focus)
|
||||
this.focus();
|
||||
if (!this.shown)
|
||||
@@ -126,17 +143,6 @@ Toolkit.Window = class Window extends Toolkit.Panel {
|
||||
|
||||
|
||||
|
||||
///////////////////////////// Package Methods /////////////////////////////
|
||||
|
||||
// Request focus on the appropriate element
|
||||
focus() {
|
||||
if (this.lastFocus != this)
|
||||
this.lastFocus.focus();
|
||||
else this.element.focus();
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////// Private Methods /////////////////////////////
|
||||
|
||||
// Position the window in the center of the desktop
|
||||
|
||||
Reference in New Issue
Block a user