src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/ColumnHeader.cs
/// <summary>
///     Beging a column adjustment. This function must be called
///     to get the property limits set.
/// </summary>
/// <param name="adjustingColumn">
///     The column that is being adjusted. Validate with
///     AllowColumnAdjustment before calling this
/// </param>
/// <param name="columnLeft">
///     The left edge of this column, adjusted by any
///     horizontal scrollbar offset. Should have been retrieved previously with
///     VirtualTreeControl.LimitRectToColumn.
/// </param>
/// <param name="adjustMouseX">
///     The difference between the mouse x position
///     and the right edge of the column. Tracking lines are shown at the true
///     edge, which is not directly under the mouse.
/// </param>
Beging a column adjustment. This function must be called
to get the property limits set.
Beging a column adjustment . This function must be called to get the property limits set .
public void BeginColumnAdjustment(int adjustingColumn, int columnLeft, int adjustMouseX)
            {
                Debug.Assert(AllowColumnAdjustment(adjustingColumn));
                myAdjustingColumn = adjustingColumn;
                myAdjustMouseX = adjustMouseX;
                var header = myHeaders[adjustingColumn];
                if (header.Percentage == 0f)
                {
                    if (!header.IsColumnAdjustable)
                    {
                        Debug.Assert(header.Percentage == 0f); 
                        myAdjustMinX = myAdjustMaxX = columnLeft + header.Width;
                    }
                    else
                    {
                        myAdjustMinX = columnLeft + VirtualTreeColumnHeader.MinimumPixelWidth;
                        myAdjustMaxX = int.MaxValue;
                    }
                }
                else
                {
                    Debug.Assert(myVariableBounds != null);
                    Debug.Assert(myColumnWidths[0] != -1); 
                    myAdjustMinX = columnLeft + header.Width;
                    var allowedTrailingAdjustment = myColumnWidths[adjustingColumn];
                    var headersCount = HeaderCount;
                    for (var i = adjustingColumn + 1; i < headersCount; ++i)
                    {
                        allowedTrailingAdjustment += myColumnWidths[i] - myHeaders[i].Width;
                    }
                    myAdjustMaxX = columnLeft + (int)(allowedTrailingAdjustment + .5f);
                }
            }
public void BeginColumnAdjustment ( int adjustingColumn , int columnLeft , int adjustMouseX ) { Debug . Assert ( AllowColumnAdjustment ( adjustingColumn ) ) ; myAdjustingColumn = adjustingColumn ; myAdjustMouseX = adjustMouseX ; var header = myHeaders [ adjustingColumn ] ; if ( header . Percentage == 0f ) { if ( ! header . IsColumnAdjustable ) { Debug . Assert ( header . Percentage == 0f ) ; myAdjustMinX = myAdjustMaxX = columnLeft + header . Width ; } else { myAdjustMinX = columnLeft + VirtualTreeColumnHeader . MinimumPixelWidth ; myAdjustMaxX = int . MaxValue ; } } else { Debug . Assert ( myVariableBounds != null ) ; Debug . Assert ( myColumnWidths [ 0 ] != - 1 ) ; myAdjustMinX = columnLeft + header . Width ; var allowedTrailingAdjustment = myColumnWidths [ adjustingColumn ] ; var headersCount = HeaderCount ; for ( var i = adjustingColumn + 1 ; i < headersCount ; ++ i ) { allowedTrailingAdjustment += myColumnWidths [ i ] - myHeaders [ i ] . Width ; } myAdjustMaxX = columnLeft + ( int ) ( allowedTrailingAdjustment + .5f ) ; } }
Beging a column adjustment.
Beging a column adjustment .
// Fixed size column, do not limit size we can adjust unless it is // nonadjustable, in which case we lock it in place. Limit lower by minimum pixel width; // Percentage-based columns are always adjustable // VirtualTreeControl.LimitRectToColumn calls GetColumnBounds, which sets this // Don't size smaller than the minimum  // This will be zero for fixed size, not worth checking
adjustingColumn
int
The column that is being adjusted. Validate with
AllowColumnAdjustment before calling this
The column that is being adjusted . Validate with AllowColumnAdjustment before calling this
columnLeft
int
The left edge of this column, adjusted by any
horizontal scrollbar offset. Should have been retrieved previously with
VirtualTreeControl.LimitRectToColumn.
The left edge of this column adjusted by any horizontal scrollbar offset . Should have been retrieved previously with VirtualTreeControl . LimitRectToColumn .
adjustMouseX
int
The difference between the mouse x position
and the right edge of the column. Tracking lines are shown at the true
edge, which is not directly under the mouse.
The difference between the mouse x position and the right edge of the column . Tracking lines are shown at the true edge which is not directly under the mouse .