misc high level widget fixes.

This commit is contained in:
Christopher Jeffrey 2013-07-15 05:00:26 -05:00
parent 211491409b
commit 97b442d3ec

View File

@ -3520,6 +3520,7 @@ function RadioButton(options) {
this.on('check', function() {
self.group.forEach(function(el) {
if (el === self) return;
el.uncheck();
});
});
@ -3542,20 +3543,6 @@ function Prompt(options) {
Box.call(this, options);
/*prompt = createPrompt.prompt = blessed.box({
parent: screen,
hidden: true,
content: '',
width: 'half',
height: 7,
left: 'center',
top: 'center',
border: {
type: 'ascii'
},
tags: true
});*/
this._.input = new Textbox({
parent: this,
top: 3,
@ -3647,20 +3634,6 @@ function Question(options) {
Box.call(this, options);
/*question = createQuestion.question = blessed.box({
parent: screen,
hidden: true,
content: '',
width: 'half',
height: 5,
left: 'center',
top: 'center',
border: {
type: 'ascii'
},
tags: true
});*/
this._.okay = new Button({
parent: this,
top: 3,
@ -3751,20 +3724,6 @@ function Message(options) {
options.tags = true;
Box.call(this, options);
/*var msg = blessed.box({
parent: screen,
hidden: true,
top: 'center',
left: 'center',
width: 'half',
tags: true,
align: 'center',
shrink: true,
border: {
type: 'ascii'
}
});*/
}
Message.prototype.__proto__ = Box.prototype;
@ -3790,7 +3749,7 @@ Message.prototype.display = function(text, time, callback) {
};
Message.prototype.error = function(text, callback) {
return this.display('{red-fg}Error: ' + text + '{/}', callback);
return this.display('{red-fg}Error: ' + text + '{/red-fg}', callback);
};
/**
@ -3805,19 +3764,6 @@ function Info(options) {
}
Box.call(this, options);
/*var info = blessed.box({
parent: screen,
hidden: true,
top: 'center',
left: 'center',
width: 'half',
tags: true,
shrink: true,
border: {
type: 'ascii'
}
});*/
}
Info.prototype.__proto__ = Box.prototype;
@ -3845,7 +3791,8 @@ Info.prototype.display = function(text, callback) {
self.screen.removeListener('keypress', fn);
end();
});
screen.on('mouse', function fn(data) {
if (!self.options.mouse) return;
self.screen.on('mouse', function fn(data) {
if (data.action === 'mousemove') return;
self.screen.removeListener('mouse', fn);
end();