mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
* Lots of minor code cleanup
* WIP work on HorizontalMenuView * Initial art for HorizontalMenuView demo
This commit is contained in:
parent
c87c0d69b7
commit
d346fe72ee
11 changed files with 114 additions and 66 deletions
|
@ -40,58 +40,10 @@ function MenuView(options) {
|
|||
|
||||
this.fillChar = miscUtil.valueWithDefault(options.fillChar, ' ').substr(0, 1);
|
||||
this.justify = options.justify || 'none';
|
||||
/*
|
||||
this.moveSelection = function(fromIndex, toIndex) {
|
||||
assert(!self.positionCacheExpired);
|
||||
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.redrawAllItems = 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.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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue