+ MCI support for focusArgs, e.g. 'focusTextStyle'

+ TextView initial support for fillChar and justify
+ Add color support to string_util.js::pad()
* Better color handling in Views
This commit is contained in:
Bryan Ashby 2014-11-03 16:49:15 -07:00
parent 4234e03008
commit 6c841105ab
13 changed files with 126 additions and 162 deletions

View file

@ -34,10 +34,43 @@ function MenuView(client, options) {
this.fillChar = miscUtil.valueWithDefault(this.options.fillChar, ' ').substr(0, 1);
this.justify = this.options.justify || 'none';
this.moveSelection = function(fromIndex, toIndex) {
assert(!self.xPositionCacheExpired);
assert(fromIndex >= 0 && fromIndex <= self.items.length);
assert(toIndex >= 0 && toIndex <= self.items.length);
self.items[fromIndex].focused = false;
self.drawItem(fromIndex);
self.items[toIndex].focused = true;
self.focusedItemIndex = toIndex;
self.drawItem(toIndex);
};
this.cachePositions = function() {
// :TODO: implement me!
};
this.drawItem = function(index) {
// :TODO: implement me!
};
}
util.inherits(MenuView, View);
MenuView.prototype.redraw = function() {
MenuView.super_.prototype.redraw.call(this);
this.cachePositions();
var count = this.items.length;
for(var i = 0; i < count; ++i) {
this.items[i].focused = this.focusedItemIndex === i;
this.drawItem(i);
}
};
MenuView.prototype.setItems = function(items) {
var self = this;
if(items) {