public void UpdateColumn(ListViewColumn col, ListViewColumnChange change) { if (TableView == null) { throw new InvalidOperationException("Add the column to a table first"); } switch (change) { case ListViewColumnChange.CanResize: if (col.CanResize) { ResizingMask |= NSTableColumnResizing.UserResizingMask; } else { ResizingMask &= ~NSTableColumnResizing.UserResizingMask; } break; case ListViewColumnChange.Expanding: if (col.Expands) { ResizingMask |= NSTableColumnResizing.Autoresizing; } else { ResizingMask &= ~NSTableColumnResizing.Autoresizing; } break; case ListViewColumnChange.Cells: DataView = CellUtil.CreateCellView(context, backend, col.Views, backend.Columns.IndexOf(this)); DataView.Identifier = Identifier; UpdateCachedViews(col.Views); TableView.ReloadData(); break; case ListViewColumnChange.Title: HeaderCell.Title = col.Title ?? string.Empty; if (!col.CanResize) { SizeToFit(); } break; case ListViewColumnChange.Alignment: HeaderCell.Alignment = col.Alignment.ToNSTextAlignment(); break; } }
public virtual NSTableColumn AddColumn (ListViewColumn col) { var tcol = new NSTableColumn (); tcol.Editable = true; cols.Add (tcol); var c = CellUtil.CreateCell (ApplicationContext, Table, this, col.Views, cols.Count - 1); tcol.DataCell = c; Table.AddColumn (tcol); var hc = new NSTableHeaderCell (); hc.Title = col.Title ?? ""; tcol.HeaderCell = hc; Widget.InvalidateIntrinsicContentSize (); return tcol; }
public virtual object AddColumn(ListViewColumn col) { var tcol = new NSTableColumn(); cols.Add(tcol); var c = CellUtil.CreateCell(this, col.Views); tcol.DataCell = c; Table.AddColumn(tcol); var hc = new NSTableHeaderCell(); hc.Title = col.Title; tcol.HeaderCell = hc; return(tcol); }
public virtual object AddColumn(ListViewColumn col) { var tcol = new NSTableColumn(); cols.Add(tcol); var c = CellUtil.CreateCell(this, col.Views); tcol.DataCell = c; Table.AddColumn(tcol); var hc = new NSTableHeaderCell(); hc.Title = col.Title ?? ""; tcol.HeaderCell = hc; Widget.InvalidateIntrinsicContentSize(); return(tcol); }
public void UpdateColumn(ListViewColumn col, object handle, ListViewColumnChange change) { NSTableColumn tcol = (NSTableColumn)handle; switch (change) { case ListViewColumnChange.CanResize: if (col.CanResize) { tcol.ResizingMask |= NSTableColumnResizing.UserResizingMask; } else { tcol.ResizingMask &= ~NSTableColumnResizing.UserResizingMask; } break; case ListViewColumnChange.Expanding: if (col.Expands) { tcol.ResizingMask |= NSTableColumnResizing.Autoresizing; } else { tcol.ResizingMask &= ~NSTableColumnResizing.Autoresizing; } break; case ListViewColumnChange.Cells: var c = CellUtil.CreateCell(ApplicationContext, Table, this, col.Views, cols.IndexOf(tcol)); c.Alignment = col.Alignment.ToNSTextAlignment(); tcol.DataCell = c; break; case ListViewColumnChange.Title: tcol.HeaderCell.Title = col.Title ?? string.Empty; if (!col.CanResize) { tcol.SizeToFit(); } break; case ListViewColumnChange.Alignment: tcol.HeaderCell.Alignment = col.Alignment.ToNSTextAlignment(); break; } }
public virtual NSTableColumn AddColumn(ListViewColumn col) { var tcol = new NSTableColumn(); tcol.Editable = true; cols.Add(tcol); var c = CellUtil.CreateCell(ApplicationContext, Table, this, col.Views, cols.Count - 1); tcol.DataCell = c; Table.AddColumn(tcol); var hc = new NSTableHeaderCell(); hc.Title = col.Title ?? ""; tcol.HeaderCell = hc; tcol.HeaderCell.Alignment = col.Alignment.ToNSTextAlignment(); tcol.ResizingMask = col.CanResize ? NSTableColumnResizing.UserResizingMask : NSTableColumnResizing.Autoresizing; tcol.SizeToFit(); Widget.InvalidateIntrinsicContentSize(); return(tcol); }
void UpdateCachedViews(ICollection <CellView> cells) { if (CachedViews.Count == 0) { return; } var col = backend.Columns.IndexOf(this); foreach (var cached in CachedViews) { // update only the alive and not disposed views if (cached.IsAlive) { var view = cached.Target as CompositeCell; if (view?.IsDisposed == false) { CellUtil.UpdateCellView(view, backend, cells, col); } } } CleanViewCache(); }
public void UpdateColumn(ListViewColumn col, object handle, ListViewColumnChange change) { NSTableColumn tcol = (NSTableColumn)handle; tcol.DataCell = CellUtil.CreateCell(this, col.Views); }
public void UpdateColumn(ListViewColumn col, object handle, ListViewColumnChange change) { NSTableColumn tcol = (NSTableColumn)handle; tcol.DataCell = CellUtil.CreateCell(ApplicationContext, Table, this, col.Views, cols.IndexOf(tcol)); }