Update "Lock Pointer" button status

This commit is contained in:
Jeff Parsons 2014-11-12 16:50:26 -08:00 committed by jeffpar
commit cd0ed8c62a
4 changed files with 13 additions and 9 deletions

View file

@ -290,7 +290,8 @@ where PCjs could run amok and destroy the planet.
Other parameters that can be passed via the URL:
- *autostart*: set it to "false" to prevent all machines on the current page from automatically starting
- *autostart*: set it to "true" to allow all machines to start normally, "false" to prevent all machines from starting,
or "no" to prevent all machines from starting *unless* they have no "Run" button.
For example:

View file

@ -764,7 +764,8 @@ CPU.prototype.setSpeed = function(nMultiplier, fOnClick)
if (this.aCounts.mhzTarget != mhz) {
this.aCounts.mhzTarget = mhz;
var sSpeed = this.getSpeedTarget();
if (this.bindings["setSpeed"]) this.bindings["setSpeed"].innerHTML = sSpeed;
var controlSpeed = this.bindings["setSpeed"];
if (controlSpeed) controlSpeed.innerHTML = sSpeed;
this.println("target speed: " + sSpeed);
}
if (fOnClick) this.setFocus();
@ -947,7 +948,8 @@ CPU.prototype.runCPU = function(fOnClick)
if (this.cmp) this.cmp.start(this.aCounts.msStartRun, this.getCycles());
this.aFlags.fRunning = true;
if (this.chipset) this.chipset.setSpeaker();
if (this.bindings["run"]) this.bindings["run"].innerHTML = "Halt";
var controlRun = this.bindings["run"];
if (controlRun) controlRun.innerHTML = "Halt";
if (fOnClick) this.setFocus();
}
/*
@ -1065,7 +1067,8 @@ CPU.prototype.haltCPU = function(fComplete)
if (this.aFlags.fRunning) {
this.aFlags.fRunning = false;
if (this.chipset) this.chipset.setSpeaker();
if (this.bindings["run"]) this.bindings["run"].innerHTML = "Run";
var controlRun = this.bindings["run"];
if (controlRun) controlRun.innerHTML = "Run";
}
this.aFlags.fComplete = fComplete;
};

View file

@ -2012,6 +2012,7 @@ Video.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control)
case "lockPointer":
this.bindings[sBinding] = control;
this.sLockMessage = control.innerHTML;
if (this.canvasScreen && this.canvasScreen.lockPointer) {
control.onclick = function onClickLockPointer() {
if (DEBUG) video.messageDebugger("lockPointer()");
@ -2065,8 +2066,6 @@ Video.prototype.getCanvas = function(mouse)
/**
* lockPointer()
*
* TODO: Consider relabeling the "Lock Pointer" button for the duration of the lock.
*
* @this {Video}
* @param {boolean} fLock
* @return {boolean} true if request successful, false if not (eg, failed OR not supported)
@ -2118,6 +2117,8 @@ Video.prototype.notifyPointerLocked = function(fLocked)
this.mouse.notifyPointerLocked(fLocked);
if (this.kbd) this.kbd.notifyEscape(fLocked);
}
var control = this.bindings["lockPointer"];
if (control) control.innerHTML = (fLocked? "Press Esc to Unlock Pointer" : this.sLockMessage);
};
/**

View file

@ -2399,9 +2399,8 @@ X86CPU.prototype.displayStatus = function()
this.displayReg("I", (regPS & X86.PS.IF)? 1 : 0, 1);
this.displayReg("D", (regPS & X86.PS.DF)? 1 : 0, 1);
this.displayReg("O", (regPS & X86.PS.OF)? 1 : 0, 1);
if (this.bindings["speed"]) {
this.bindings["speed"].innerHTML = this.getSpeedCurrent();
}
var controlSpeed = this.bindings["speed"];
if (controlSpeed) controlSpeed.innerHTML = this.getSpeedCurrent();
};
/**