     private weak var layoutBarTop:NSLayoutConstraint!
     private weak var layoutCollectionLeft:NSLayoutConstraint!
     private weak var layoutControlsWidth:NSLayoutConstraint!
+    private var drag:Drag
     private let kBarHeight:CGFloat = 210
+    private let kControlsMinThreshold:CGFloat = 7
+    private let kControlsExtraThreshold:CGFloat = 30
+    private let kControlsMenuThreshold:CGFloat = 50
+    private let kControlsMaxThreshold:CGFloat = 180
+    private let kExtraSpeed:CGFloat = 3
     private let kDeselectTime:TimeInterval = 0.2
+    private let kAnimationDuration:TimeInterval = 0.3
     
     override init(controller:CController)
     {
+        drag = Drag.stand
+        
         super.init(controller:controller)
         self.controller = controller as? CLinearEquationsProject
         

        }
        
        layoutBarTop.constant = offsetY
    }
    
    func numberOfSections(in collectionView:UICollectionView) -> Int

    
    func collectionView(_ collectionView:UICollectionView, didSelectItemAt indexPath:IndexPath)
    {
        if drag == Drag.restart
        {
            restartingScroll()
        }
        else
        {
            let item:MLinearEquationsProjectRowItem = modelAtIndex(index:indexPath)
            item.selected(controller:controller)
            
            DispatchQueue.main.asyncAfter(
                deadline:DispatchTime.now() + kDeselectTime)
            { [weak collectionView] in
                
                collectionView?.selectItem(
                    at:nil,
                    animated:true,
                    scrollPosition:UICollectionViewScrollPosition())
            }
        }
    }
}
