 use namespace mx_internal;
 
 //--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the mouse button is pressed over a column header.
+ *
+ *  @eventType spark.events.GridEvent.GRID_MOUSE_DOWN
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridMouseDown", type="spark.events.GridEvent")]
+
+
+/**
+ *  Dispatched after a GRID_MOUSE_DOWN event if the mouse moves before the button is released.
+ *
+ *  @eventType spark.events.GridEvent.GRID_MOUSE_DRAG
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridMouseDrag", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched after a GRID_MOUSE_DOWN event when the mouse button is released, even
+ *  if the mouse is no longer within the ColumnHeaderBar.
+ *
+ *  @eventType spark.events.GridEvent.GRID_MOUSE_UP
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridMouseUp", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse enters a column header.
+ *
+ *  @eventType spark.events.GridEvent.GRID_ROLL_OVER
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridRollOver", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse leaves a column header.
+ *
+ *  @eventType spark.events.GridEvent.GRID_ROLL_OUT
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridRollOut", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse is clicked over a column header.
+ *
+ *  @eventType spark.events.GridEvent.GRID_CLICK
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridClick", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse is double-clicked over a column header.
+ *
+ *  @eventType spark.events.GridEvent.GRID_DOUBLE_CLICK
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridDoubleClick", type="spark.events.GridEvent")]
+
+
+/**
+ *  Dispatched when the mouse button is pressed over a column header.
+ *
+ *  @eventType spark.events.GridEvent.GRID_MOUSE_DOWN
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="gridMouseDown", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched after a SEPARATOR_MOUSE_DOWN event if the mouse moves before 
+ *  the button is released.
+ *
+ *  @eventType spark.events.GridEvent.SEPARATOR_MOUSE_DRAG
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="separatorMouseDrag", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched after a SEPARATOR_MOUSE_DOWN event when the mouse button is 
+ *  released, even if the mouse is no longer within the separator affordance.
+ *
+ *  @eventType spark.events.GridEvent.SEPARATOR_MOUSE_UP
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="separatorMouseUp", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse enters the area defined by a column 
+ *  separator and <code>separatorMouseWidth</code>.
+ *
+ *  @eventType spark.events.GridEvent.SEPARATOR_ROLL_OVER
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="separatorRollOver", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse leaves the area defined by a column 
+ *  separator and <code>separatorMouseWidth</code>.
+ *
+ *  @eventType spark.events.GridEvent.SEPARATOR_ROLL_OUT
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="separatorRollOut", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse is clicked over a column header separator.
+ *
+ *  @eventType spark.events.GridEvent.SEPARATOR_CLICK
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="separatorClick", type="spark.events.GridEvent")]
+
+/**
+ *  Dispatched when the mouse is double-clicked over a column 
+ *  header separator.
+ *
+ *  @eventType spark.events.GridEvent.SEPARATOR_DOUBLE_CLICK
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+[Event(name="separatorDoubleClick", type="spark.events.GridEvent")]
+
+
+//--------------------------------------
 //  Styles
 //--------------------------------------
 

import flash.geom.Point;
import flash.geom.Rectangle;

import mx.core.IFactory;
import mx.core.IVisualElement;
import mx.core.mx_internal;

        dispatchChangeEvent("overlayGroupChanged");
    }
    
    //----------------------------------
    //  separatorMouseWidth
    //----------------------------------
    
    [Bindable("separatorMouseWidthChanged")]
    
    private var _separatorMouseWidth:Number = 5;
    
    /**
     *  Horizontal space on either side of a column separator that's considered to be 
     *  part of the separator for the sake of mouse event dispatching.
     * 
     *  <p>Separators are often just one pixel wide which makes interacting with them difficult.
     *  This value is used by <code>getSeparatorIndexAt()</code> to give separators a wider
     *  berth, so that separator events are dispatched when the mouse is closer than 
     *  <code>separatorMouseWidth</code> to the horizontal midpoint of a separator.</p> 
     * 
     *  @default 5
     * 
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 1.5
     *  @productversion Flex 4.5
     */
    public function get separatorMouseWidth():Number
    {
        return _separatorMouseWidth;
    }
    
    /**
     *  @private
     */
    public function set separatorMouseWidth(value:Number):void
    {
        if (_separatorMouseWidth == value)
            return;
        
        _separatorMouseWidth = value;
        invalidateDisplayList();
        dispatchChangeEvent("separatorMouseWidthChanged");
    }    
    
    //--------------------------------------------------------------------------
    //
    //  Methods 
    //
    //--------------------------------------------------------------------------
    
    /**
     *  @copy spark.components.supportClasses.ColumnHeaderBarLayout#getColumnIndexAt()
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 2.0
     *  @productversion Flex 4.5
     */
    public function getHeaderIndexAt(x:Number, y:Number):int
    {
        return ColumnHeaderBarLayout(layout).getHeaderIndexAt(x, y);
    }
    
    /**
     *  @copy spark.components.supportClasses.ColumnHeaderBarLayout#getSeparatorIndexAt()
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 2.0
     *  @productversion Flex 4.5
     */
    public function getSeparatorIndexAt(x:Number, y:Number):int
    {
        return ColumnHeaderBarLayout(layout).getSeparatorIndexAt(x, y);
    }    
        
    /**
     *  @copy spark.components.supportClasses.ColumnHeaderBarLayout#getHeaderRendererAt()
     *  
