30 using System.ComponentModel;
31 using System.Collections.Generic;
57 [EditorBrowsable( EditorBrowsableState.Never )]
146 public void Scroll( IList<GameObject> objects,
double amount )
148 if ( objects.Count == 0 )
return;
152 double totalScrollingAmount = -amount;
155 while ( spaceForCurrentObject < totalScrollingAmount )
159 spaceForCurrentObject = 0;
163 totalScrollingAmount -= spaceForCurrentObject;
168 spaceForCurrentObject -= totalScrollingAmount;
173 double totalScrollingAmount = -amount;
176 while ( spaceForCurrentObject < -totalScrollingAmount )
180 spaceForCurrentObject = 0;
184 totalScrollingAmount += spaceForCurrentObject;
189 spaceForCurrentObject += totalScrollingAmount;
196 [EditorBrowsable( EditorBrowsableState.Never )]
199 if ( objects.Count == 0 )
203 double heightOfExpandingObjects = 0;
204 double heightOfFixedSizeObjects = 0;
208 foreach ( var o
in objects )
210 if ( o.PreferredSize.X > maxWidth )
212 maxWidth = o.PreferredSize.X;
215 if ( o.VerticalSizing !=
Sizing.FixedSize )
217 verticalSizing =
Sizing.Expanding;
218 heightOfExpandingObjects += o.PreferredSize.Y;
220 else if ( o.VerticalSizing ==
Sizing.FixedSize )
222 heightOfFixedSizeObjects += o.PreferredSize.Y;
225 if ( o.HorizontalSizing !=
Sizing.FixedSize )
227 horizontalSizing =
Sizing.Expanding;
241 [EditorBrowsable( EditorBrowsableState.Never )]
247 [EditorBrowsable( EditorBrowsableState.Never )]
253 [EditorBrowsable( EditorBrowsableState.Never )]
259 [EditorBrowsable( EditorBrowsableState.Never )]
269 while ( ( i < objects.Count ) && ( top >= contentBottomLimit ) )
277 width = contentWidth;
281 o.X = ( -maximumSize.
X / 2 ) + (
LeftPadding + contentWidth / 2 );
282 o.Y = top - height / 2 + offset;
284 top -= height +
Spacing - offset;