예제 #1
0
 private void RecalcColumnWidth(ProcessSizeToContentColumnDelegate callback, JetListViewNode paramNode)
 {
     if (_sizeToContentColumnCount > 0)
     {
         int fixedWidth = 0;
         JetListViewColumn indentCol = null;
         for (int i = 0; i < _columnCollection.Count; i++)
         {
             JetListViewColumn col = _columnCollection [i];
             if (col.IsIndentColumn())
             {
                 indentCol = col;
             }
             if (col.FixedSize && indentCol != null)
             {
                 fixedWidth += col.Width;
             }
             if (col.SizeToContent)
             {
                 callback(col, indentCol, fixedWidth, paramNode);
             }
             if (!col.FixedSize && !col.IsIndentColumn())
             {
                 indentCol  = null;
                 fixedWidth = 0;
             }
         }
         UpdateScrollRange();
     }
 }
예제 #2
0
        private void HandleDividerDblClick(object sender, HeaderSectionEventArgs ea)
        {
            JetListViewColumn col = ColumnFromHeaderSection(ea.Item);

            if (col.FixedSize)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                int fixedWidth = 0;
                JetListViewColumn indentCol = null;
                for (int i = 0; i < _columnCollection.Count; i++)
                {
                    JetListViewColumn aCol = _columnCollection [i];
                    if (aCol.IsIndentColumn())
                    {
                        indentCol = aCol;
                    }
                    if (aCol.FixedSize && indentCol != null)
                    {
                        fixedWidth += col.Width;
                    }
                    if (aCol == col)
                    {
                        RecalcAll(aCol, indentCol, fixedWidth, null);
                        OnInvalidate();
                        break;
                    }
                    if (!aCol.FixedSize && !aCol.IsIndentColumn())
                    {
                        indentCol  = null;
                        fixedWidth = 0;
                    }
                }
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
예제 #3
0
            internal bool MoveNext()
            {
                if (_colIndex >= _columns.Count - 1)
                {
                    return(false);
                }
                _colIndex++;

                JetListViewColumn curColumn = Current;

                if (curColumn.IsIndentColumn())
                {
                    _availIndent = GetAvailableIndent(_colIndex);
                    int indent = curColumn.GetIndent(_node);
                    _curWidth     = Math.Min(_availIndent, indent);
                    _availIndent -= _curWidth;
                    _itemIndent   = _curWidth;
                }
                else if (!curColumn.FixedSize)
                {
                    _curWidth    = curColumn.Width - _itemIndent;
                    _itemIndent  = 0;
                    _availIndent = Int32.MaxValue;
                }
                else
                {
                    int delta = curColumn.GetWidthDelta(_node);
                    _curWidth = curColumn.Width + delta;
                    if (_curWidth > _availIndent)
                    {
                        _itemIndent -= _curWidth - _availIndent;
                        _curWidth    = _availIndent;
                    }
                    _availIndent -= _curWidth;
                    _itemIndent  -= delta;
                }
                return(true);
            }
예제 #4
0
 protected bool IsValueColumn(JetListViewColumn col)
 {
     return(!col.FixedSize && !col.IsIndentColumn());
 }