* Fix key press event for EditTextView

* Fix MCI draw issue for TextView
* Missing bbs.js MCI init
This commit is contained in:
Bryan Ashby 2016-08-10 23:35:17 -06:00
parent 30ba609fb4
commit 383b3b449d
3 changed files with 19 additions and 13 deletions

View File

@ -159,7 +159,7 @@ function initialize(cb) {
callback(err); callback(err);
}); });
}, },
function loadSysOpInformation2(callback) { function loadSysOpInformation(callback) {
// //
// Copy over some +op information from the user DB -> system propertys. // Copy over some +op information from the user DB -> system propertys.
// * Makes this accessible for MCI codes, easy non-blocking access, etc. // * Makes this accessible for MCI codes, easy non-blocking access, etc.
@ -202,6 +202,9 @@ function initialize(cb) {
} }
); );
}, },
function initMCI(callback) {
require('./predefined_mci.js').init(callback);
},
function readyMessageNetworkSupport(callback) { function readyMessageNetworkSupport(callback) {
require('./msg_network.js').startup(callback); require('./msg_network.js').startup(callback);
}, },

View File

@ -45,13 +45,13 @@ EditTextView.prototype.onKeyPress = function(ch, key) {
} }
} }
return; return EditTextView.super_.prototype.onKeyPress.call(this, ch, key);
} else if(this.isKeyMapped('clearLine', key.name)) { } else if(this.isKeyMapped('clearLine', key.name)) {
this.text = ''; this.text = '';
this.cursorPos.col = 0; this.cursorPos.col = 0;
this.setFocus(true); // resetting focus will redraw & adjust cursor this.setFocus(true); // resetting focus will redraw & adjust cursor
return; return EditTextView.super_.prototype.onKeyPress.call(this, ch, key);
} }
} }

View File

@ -119,14 +119,17 @@ function TextView(options) {
} }
} }
this.client.term.write(padStr( this.client.term.write(
padStr(
textToDraw, textToDraw,
this.dimens.width + 1, this.dimens.width + 1,
this.fillChar, this.fillChar,
this.justify, this.justify,
this.hasFocus ? this.getFocusSGR() : this.getSGR(), this.hasFocus ? this.getFocusSGR() : this.getSGR(),
this.getStyleSGR(1) || this.getSGR() this.getStyleSGR(1) || this.getSGR()
), false); ),
false // no converting CRLF needed
);
}; };
@ -184,7 +187,7 @@ TextView.prototype.setText = function(text, redraw) {
var widthDelta = 0; var widthDelta = 0;
if(this.text && this.text !== text) { if(this.text && this.text !== text) {
widthDelta = Math.abs(this.text.length - text.length); widthDelta = Math.abs(renderStringLength(this.text) - renderStringLength(text));
} }
this.text = text; this.text = text;
@ -198,7 +201,7 @@ TextView.prototype.setText = function(text, redraw) {
this.text = stylizeString(this.text, this.hasFocus ? this.focusTextStyle : this.textStyle); this.text = stylizeString(this.text, this.hasFocus ? this.focusTextStyle : this.textStyle);
if(this.autoScale.width) { if(this.autoScale.width) {
this.dimens.width = this.text.length + widthDelta; this.dimens.width = renderStringLength(this.text) + widthDelta;
} }
if(redraw) { if(redraw) {