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(); } }
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; } }
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); }
protected bool IsValueColumn(JetListViewColumn col) { return(!col.FixedSize && !col.IsIndentColumn()); }