public void Update( float deltaTime ) { if( Hidden ) return; MouseDelta = Game.InputManager.MousePositionInGame - MousePreviousPosition; if ( IsDraggableFrom( Game.InputManager.MouseDownFromInGame ) && IsDraggableFrom( Game.InputManager.MousePositionInGame ) && Game.InputManager.MouseDown && Game.InputManager.MouseButtons == System.Windows.Forms.MouseButtons.Left ) IsDragging = true; for( int i = 0; i < Game.WindowManager.WindowPool.Count; i++ ) { if( i == Game.WindowManager.GetWindowIndex( this ) ) continue; if( Game.WindowManager.WindowPool[ i ].IsDragging ) IsDragging = false; } if( IsDragging ) { Game.WindowManager.MoveToFront( Game.WindowManager.GetWindowIndex( this ) ); Position += MouseDelta; } if( !Game.InputManager.MouseDown ) IsDragging = false; if ( IsSelectable( Game.InputManager.MouseDownFromInGame ) && IsSelectable( Game.InputManager.MousePositionInGame ) && !IsDragging && !Hidden && Game.InputManager.MouseDown ) { bool MoveToFront = true; for( int i = 0; i < Game.WindowManager.WindowPool.Count; i++ ) { if( Game.WindowManager.WindowPool[ i ].IsDragging ) MoveToFront = false; } if( MoveToFront ) Game.WindowManager.MoveToFront( this ); } MousePreviousPosition = Game.InputManager.MousePositionInGame; }