mexui.util.createControlConstructor('Grid', true, function(window, x, y, w, h, styles) { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('Grid', styles)); mexui.Entity.ControlWithEntries.call(this, false, false, toVector2(0, 25), toVector2(this.size.x, 25), toVector2(0, -25)); }); // default styles mexui.util.linkBaseControlStyles('Grid', { column: { lineColour: toColour(0, 0, 0, 255) }, header: { backgroundColour: toColour(255, 255, 255, 255), textColour: toColour(0, 0, 0, 255) }, cell: { backgroundColour: toColour(255, 255, 255, 255), textColour: toColour(0, 0, 0, 255) }, row: { lineColour: toColour(0, 0, 0, 255) } }); // render mexui.Control.Grid.prototype.render = function() { var pos = this.getScreenPosition(); mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); var startX = pos.x; var maxColumnHeight = 0; for(var i in this.axis.x.entries) { var column = this.axis.x.entries[i]; mexui.native.drawText(toVector2(startX, pos.y), toVector2(column.width, column.height), column.text, this.getStyles('header')); startX += column.width; mexui.native.drawAALine(toVector2(startX, pos.y), toVector2(startX, pos.y + this.size.y), this.getStyles('column')); if(column.height > maxColumnHeight) { maxColumnHeight = column.height; } } var startY = pos.y + maxColumnHeight; mexui.native.drawAALine(toVector2(pos.x, startY), toVector2(pos.x + this.size.x, startY), this.getStyles('row')); for(var i=this.axis.y.getEntryStartIndex(),j=this.axis.y.getEntryEndIndex(); i