home *** CD-ROM | disk | FTP | other *** search
- class components.ui.gridLayout.GridLayout
- {
- var instCounter;
- var layout;
- var container;
- var grid;
- function GridLayout()
- {
- this.instCounter = 0;
- }
- function setLayout(layout)
- {
- this.layout = layout;
- }
- function setContainer(container)
- {
- this.container = container;
- }
- function render()
- {
- this.grid = [];
- var _loc12_ = 0;
- var _loc9_ = 0;
- var _loc6_ = 0;
- var _loc4_ = 0;
- while(_loc4_ < this.layout.numberOfRows)
- {
- this.grid[_loc4_] = [];
- var _loc3_ = 0;
- while(_loc3_ < this.layout.numberOfCols)
- {
- this.grid[_loc4_][_loc3_] = {};
- if(this.layout.cells[_loc4_ * this.layout.numberOfCols + _loc3_] != null)
- {
- var _loc7_ = _loc4_ * this.layout.numberOfCols + _loc3_;
- var _loc11_ = this.grid[_loc4_][_loc3_];
- var _loc2_ = this.container.attachMovie("cell","cell" + this.instCounter,this.instCounter++);
- if(this.layout.cells[_loc7_ + 1] != null || _loc3_ == this.layout.numberOfCols - 1)
- {
- _loc2_.front._width = this.layout.rowWidths[_loc3_];
- }
- else
- {
- _loc6_ = this.layout.rowWidths[_loc3_];
- var _loc8_ = _loc7_;
- var _loc5_ = _loc3_;
- while(_loc5_ < this.layout.numberOfCols - 1)
- {
- if(this.layout.cells[_loc8_ + 1] != null)
- {
- break;
- }
- _loc6_ += this.layout.rowWidths[_loc5_ + 1] + this.layout.horizotalSpace;
- _loc8_ = _loc8_ + 1;
- _loc5_ = _loc5_ + 1;
- }
- _loc2_.front._width = _loc6_;
- }
- if(this.layout.cells[_loc7_ + this.layout.numberOfCols] != null || _loc4_ == this.layout.numberOfRows - 1)
- {
- _loc2_.front._height = this.layout.colHeights[_loc4_];
- }
- else
- {
- _loc6_ = this.layout.colHeights[_loc4_];
- _loc8_ = _loc7_;
- _loc5_ = _loc4_;
- while(_loc5_ < this.layout.numberOfRows - 1)
- {
- if(this.layout.cells[_loc8_ + this.layout.numberOfCols] != null)
- {
- break;
- }
- _loc6_ += this.layout.colHeights[_loc5_ + 1] + this.layout.verticalSpace;
- _loc8_ += this.layout.numberOfCols;
- _loc5_ = _loc5_ + 1;
- }
- _loc2_.front._height = _loc6_;
- }
- var _loc10_ = new Color(_loc2_.front);
- _loc10_.setRGB(this.layout.colors[_loc4_ * this.layout.numberOfCols + _loc3_]);
- _loc2_._x = _loc9_;
- _loc2_._y = _loc12_;
- _loc11_.mc = _loc2_;
- _loc9_ = _loc2_._x + this.layout.rowWidths[_loc3_] + this.layout.horizotalSpace;
- if(_loc3_ < this.layout.numberOfCols - 1)
- {
- _loc2_.back._width = _loc2_.front._width + this.layout.horizotalSpace;
- }
- else
- {
- _loc2_.back._width = _loc2_.front._width;
- }
- if(_loc4_ < this.layout.numberOfRows - 1)
- {
- _loc2_.back._height = _loc2_.front._height + this.layout.verticalSpace;
- }
- else
- {
- _loc2_.back._height = _loc2_.front._height;
- }
- }
- else
- {
- _loc9_ = _loc9_ + this.layout.rowWidths[_loc3_] + this.layout.horizotalSpace;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc9_ = 0;
- _loc12_ += this.layout.colHeights[_loc4_] + this.layout.verticalSpace;
- _loc4_ = _loc4_ + 1;
- }
- return this.grid;
- }
- }
-