/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */ function QxFlowLayout(){QxLayout.call(this);};QxFlowLayout.extend(QxLayout,"QxFlowLayout");QxFlowLayout.addProperty({name:"horizontalSpacing",type:Number,defaultValue:0});QxFlowLayout.addProperty({name:"verticalSpacing",type:Number,defaultValue:0});QxFlowLayout.addProperty({name:"horizontalBlockAlign",type:String,defaultValue:"left"});QxFlowLayout.addProperty({name:"verticalChildrenAlign",type:String,defaultValue:"top"});proto._d1=function(){var innerWidth=this.getInnerWidth();var innerHeight=this.getInnerHeight();var blockAlign=this.getHorizontalBlockAlign();var childrenAlign=this.getVerticalChildrenAlign();var spacingX=this.getHorizontalSpacing();var spacingY=this.getVerticalSpacing();var paddingLeft=this.getPaddingLeft();var paddingTop=this.getPaddingTop();var accumulatedWidth=0;var accumulatedHeight=0;var childNeededWidth;var childNeededHeight;var currentRow;var childCalculatedLeft,childCalculatedTop;var maxRequiredRowHeight=0;var rows=[];var childOffsetLeft=[];function storeRow(accumulatedWidth,accumulatedHeight,maxRequiredRowHeight){var r={width:accumulatedWidth,height:maxRequiredRowHeight,offsetTop:accumulatedHeight };switch(blockAlign){case "center":r.offsetLeft=(innerWidth-accumulatedWidth)/2;break;case "right":r.offsetLeft=innerWidth-accumulatedWidth;break;default:r.offsetLeft=0;};rows.push(r);};var ch=this.getChildren();var chl=ch.length;var chc;for(var i=0;iinnerWidth){storeRow(accumulatedWidth,accumulatedHeight,maxRequiredRowHeight);chc.__row=rows.length;accumulatedHeight+=maxRequiredRowHeight+spacingY;childOffsetLeft.push(0);accumulatedWidth=childNeededWidth+spacingX;maxRequiredRowHeight=childNeededHeight;}else {chc.__row=rows.length;childOffsetLeft.push(accumulatedWidth);accumulatedWidth+=childNeededWidth+spacingX;maxRequiredRowHeight=Math.max(maxRequiredRowHeight,childNeededHeight);};};storeRow(accumulatedWidth,accumulatedHeight,maxRequiredRowHeight);for(var i=0;i