private void OnColumnRemoved(JetListViewColumn column) { if (ColumnRemoved != null) { ColumnRemoved(this, new ColumnEventArgs(column)); } }
public void Move(JetListViewColumn col, int toIndex) { BeginUpdate(); _items.Remove(col); _items.Insert(toIndex, col); EndUpdate(); }
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(); } }
protected void OnColumnClick(JetListViewColumn col) { if (ColumnClick != null) { ColumnClick(this, new ColumnEventArgs(col)); } }
/// <summary> /// Adds a column to the multiline column scheme. /// </summary> /// <param name="column">The column to add.</param> /// <param name="startRow">The row in which the column rectangle starts.</param> /// <param name="endRow">The row in which the column rectangle ends.</param> /// <param name="startX">The X position where the column data starts.</param> /// <param name="width">The width of the column in pixels.</param> /// <param name="anchor">The anchoring of the columnn to the edges of the view area.</param> /// <param name="textColor">The color of the text displayed in the column.</param> public void AddColumn(JetListViewColumn column, int startRow, int endRow, int startX, int width, ColumnAnchor anchor, Color textColor, HorizontalAlignment textAlign) { _columns.Add(column); _columnSettings.Add(new MultiLineColumnSetting(column, startRow, endRow, startX, width, anchor, textColor, textAlign)); }
public JetItemEditEventArgs(string text, object item, JetListViewColumn column) { _text = text; _item = item; _column = column; _cancelEdit = false; }
private void RecalcOnNodeAdded(JetListViewColumn col, JetListViewColumn indentCol, int fixedWidth, JetListViewNode paramNode) { int desiredWidth = GetDesiredWidthIndented(col, indentCol, paramNode, fixedWidth); col.Width = Math.Max(col.Width, desiredWidth); }
private void HandleAfterSectionTrack(object sender, HeaderSectionWidthEventArgs ea) { if (_trackColumn != null) { int trackWidth = AdjustTrackWidth(ea.Width); int delta = ea.Width - trackWidth; if (trackWidth >= 10) { _trackColumn.Width = trackWidth; if (_trackColumn.AutoSize) { _trackColumn.AutoSizeMinWidth = trackWidth; } } else { _trackColumn.Width = 10; _methodInvoker.BeginInvoke(new SetMinWidthDelegate(SetMinWidth), ea.Item, 10 + delta); } _trackColumn = null; } _processingHeaderOperation = false; OnInvalidate(); _methodInvoker.BeginInvoke(new ProcessColumnUpdateDelegate(ProcessColumnUpdate), true); }
private void OnColumnAdded(JetListViewColumn value) { if (ColumnAdded != null) { ColumnAdded(this, new ColumnEventArgs(value)); } }
protected override void UnhookColumn(JetListViewColumn col) { base.UnhookColumn(col); col.SizeToContentChanged -= HandleSizeToContentChanged; col.AutoSizeChanged -= HandleAutoSizeChanged; col.WidthChanged -= HandleColumnWidthChanged; col.TextChanged -= HandleColumnTextChanged; }
/// <summary> /// Adds the specified column to the list. /// </summary> /// <param name="value">The column to add.</param> /// <returns>The index of the added column.</returns> public int Add(JetListViewColumn value) { int result = _items.Add(value); value.Owner = this; OnColumnAdded(value); return(result); }
protected override void HandleSortIconChanged(object sender, EventArgs e) { JetListViewColumn col = (JetListViewColumn)sender; HeaderSection section = (HeaderSection)_headerMap [col]; if (section != null) { SetHeaderSortIcon(section, col); } }
public bool AcceptDoubleClick(JetListViewNode node, int x, int y) { JetListViewColumn col = GetColumnAt(node, x, y); if (col == null) { return(false); } return(col.AcceptColumnDoubleClick); }
public MultiLineColumnSetting(MultiLineColumnSetting rhs) { _column = rhs._column; _startRow = rhs._startRow; _endRow = rhs._endRow; _startX = rhs._startX; _width = rhs._width; _anchor = rhs._anchor; _textColor = rhs._textColor; _textAlign = rhs._textAlign; }
public Rectangle GetColumnBounds(JetListViewColumn col, JetListViewNode node) { if (col == _previewColumn) { int startX = _baseRowRenderer.BorderSize - _baseRowRenderer.ScrollOffset; int endX = _baseRowRenderer.ScrollRange - _baseRowRenderer.BorderSize; return(new Rectangle(startX, _baseRowRenderer.GetRowHeight(node), endX - startX, _previewColumn.GetAutoPreviewHeight(node))); } return(_baseRowRenderer.GetColumnBounds(col, node)); }
internal void UpdateToolTip(Point pt) { JetListViewNode node = _ownerControl.GetNodeAt(pt); JetListViewColumn col = _ownerControl.GetColumnAt(pt); if (node != _lastToolTipNode || col != _lastToolTipColumn) { Hide(); Win32Declarations.SendMessage(Handle, Win32Declarations.TTM_UPDATE, IntPtr.Zero, IntPtr.Zero); } }
private void HandleCustomDrawSection(object sender, HeaderCustomDrawEventArgs ea) { JetListViewColumn col = ColumnFromHeaderSection(ea.Item); if (col != null) { using (Graphics g = Graphics.FromHdc(ea.Hdc)) { col.DrawHeader(g, ea.Bounds); } } }
private void SetColumnWidth(JetListViewColumn col, int colWidth) { _internalChange++; try { col.Width = colWidth; } finally { _internalChange--; } }
public MultiLineColumnSetting(JetListViewColumn column, int startRow, int endRow, int startX, int width, ColumnAnchor anchor, Color textColor, HorizontalAlignment textAlign) { _column = column; _startRow = startRow; _endRow = endRow; _startX = startX; _width = width; _anchor = anchor; _textColor = textColor; _textAlign = textAlign; }
protected override void ScrollColumnInView(JetListViewColumn col, JetListViewNode node) { Rectangle rc = GetColumnBounds(col, node); if (rc.Left < 0) { OnRequestScroll(_scrollOffset + rc.Left + _borderSize); } else if (rc.Right > _visibleWidth) { OnRequestScroll(_scrollOffset + rc.Right - _visibleWidth); } }
public bool HandleMouseUp(JetListViewNode node, int x, int y, MouseButtons button, Keys modifiers) { if (button == MouseButtons.Left) { int deltaX, deltaY; JetListViewColumn col = GetClickColumn(node, x, y, out deltaX, out deltaY); if (col != null) { return(col.HandleMouseUp(node, deltaX, deltaY)); } } return(false); }
public override Rectangle GetColumnBounds(JetListViewColumn col, JetListViewNode node) { MultiLineColumnScheme scheme = _columnSchemeProvider.GetColumnScheme(node.Data); foreach (MultiLineColumnSetting setting in scheme.ColumnSettings) { if (setting.Column == col) { int indent = GetRowIndent(node, scheme); return(GetRectangleFromSetting(scheme, setting, indent)); } } throw new Exception("The specified column is not found in the column scheme for the specified node"); }
private void HandleSectionClick(object sender, HeaderSectionEventArgs ea) { JetListViewColumn col = ColumnFromHeaderSection(ea.Item); if (!_processingHeaderOperation) { if (ea.Button == MouseButtons.Left) { _processingHeaderOperation = true; OnColumnClick(col); _processingHeaderOperation = false; } } }
private void HandleAutoSizeChanged(object sender, EventArgs e) { JetListViewColumn col = (JetListViewColumn)sender; if (col.AutoSize) { _autoSizeColumnCount++; } else { _autoSizeColumnCount--; } AllocateAutoSizeWidth(); }
protected void DrawRowSelectRect(Graphics g, Rectangle rcFocus, bool dropTargetRow, bool focusRow) { if (_fullRowSelect) { if (dropTargetRow) { JetListViewColumn.DrawDropTarget(g, rcFocus); } else if (focusRow) { _controlPainter.DrawFocusRect(g, rcFocus); } } }
private void HandleBeforeSectionTrack(object sender, HeaderSectionWidthConformableEventArgs ea) { JetListViewColumn col = ColumnFromHeaderSection(ea.Item); if (col.FixedSize || col.SizeToContent || _processingHeaderOperation) { ea.Accepted = false; } else { _processingHeaderOperation = true; _trackColumn = col; OnInvalidate(); } }
private void RecalcOnCollapse(JetListViewColumn col, JetListViewColumn indentCol, int fixedWidth, JetListViewNode paramNode) { IEnumerator enumerator = paramNode.EnumerateChildrenRecursive(); while (enumerator.MoveNext()) { JetListViewNode node = (JetListViewNode)enumerator.Current; int desiredWidth = GetDesiredWidthIndented(col, indentCol, node, fixedWidth); if (col.Width == desiredWidth) { RecalcAll(col, indentCol, fixedWidth, null); break; } } }
protected void DrawColumnWithHighlight(Graphics g, Rectangle rcCol, JetListViewNode itemNode, JetListViewColumn col, RowState state) { if ((state & RowState.InPlaceEdit) == 0 || col != GetInPlaceEditColumn(itemNode)) { string highlightText = null; if ((state & RowState.IncSearchMatch) != 0 && col.MatchIncrementalSearch(itemNode, _searchHighlightText)) { highlightText = _searchHighlightText; } col.DrawNode(g, rcCol, itemNode, state, highlightText); } }
private void RecalcOnExpand(JetListViewColumn col, JetListViewColumn indentCol, int fixedWidth, JetListViewNode paramNode) { int maxWidth = col.Width; IEnumerator enumerator = paramNode.EnumerateChildrenRecursive(); while (enumerator.MoveNext()) { JetListViewNode node = (JetListViewNode)enumerator.Current; int desiredWidth = GetDesiredWidthIndented(col, indentCol, node, fixedWidth); if (desiredWidth > maxWidth) { maxWidth = desiredWidth; } } col.Width = maxWidth; }
public override Rectangle GetColumnBounds(JetListViewColumn col, JetListViewNode node) { int curX = -_scrollOffset + _borderSize; ColumnWidthEnumerator enumerator = new ColumnWidthEnumerator(_columnCollection, node); while (enumerator.MoveNext()) { if (enumerator.Current == col) { return(new Rectangle(curX, 0, enumerator.CurrentWidth, _rowHeight)); } curX += enumerator.CurrentWidth; } throw new ArgumentException("Column not found in list", "col"); }