/// <summary> /// 2.4.初始化List显示 /// </summary> private void InitList() { this._RecordListView = new FastObjectListView(); this._RecordListView.VirtualMode = true; this._RecordListView.Cursor = System.Windows.Forms.Cursors.Default; this._RecordListView.Dock = System.Windows.Forms.DockStyle.Fill; this._RecordListView.GridLines = true; this._RecordListView.FullRowSelect = true; this._RecordListView.HeaderUsesThemes = false; this._RecordListView.HeaderWordWrap = true; this._RecordListView.HideSelection = false; this._RecordListView.Location = new System.Drawing.Point(0, 110); this._RecordListView.Name = "PInfoListView"; this._RecordListView.ShowGroups = false; this._RecordListView.UseCompatibleStateImageBehavior = false; this._RecordListView.UseHotItem = true; this._RecordListView.View = System.Windows.Forms.View.Details; this._RecordListView.OwnerDraw = true; this._RecordListView.MultiSelect = false; List<ListColumnInfo> ColumnArray = new List<ListColumnInfo>(); ColumnArray.Add(new ListColumnInfo("NO", "OrderNumber", 80, HorizontalAlignment.Left, true)); ColumnArray.Add(new ListColumnInfo("文件名称", "BackDataFileName",200, HorizontalAlignment.Left, true)); ColumnArray.Add(new ListColumnInfo("备份时间", "DataBackTime", 120, HorizontalAlignment.Left, true)); this.InitializedListColumn(ColumnArray);//初始化栏位信息 groupBox2.Controls.Add(this._RecordListView); this._RecordListView.ContextMenuStrip = this.contextMenuStrip1; }
/// <summary> /// Make a DataSourceAdapter /// </summary> public DataSourceAdapter(ObjectListView olv) { if (olv == null) throw new ArgumentNullException("olv"); this.ListView = olv; this.BindListView(this.ListView); }
/// <summary> /// Create an exporter that will export all the given rows from the given ObjectListView /// </summary> /// <param name="olv"></param> /// <param name="objectsToExport"></param> public OLVExporter(ObjectListView olv, IEnumerable objectsToExport) { if (olv == null) throw new ArgumentNullException("olv"); if (objectsToExport == null) throw new ArgumentNullException("objectsToExport"); this.ListView = olv; this.ModelObjects = ObjectListView.EnumerableToArray(objectsToExport, true); }
/// <summary> /// Make a DataSourceAdapter /// </summary> public DataSourceAdapter(ObjectListView olv) { Debug.Assert(olv != null); ListView = olv; BindListView(ListView); }
/// <summary> /// Make a DataSourceAdapter /// </summary> public DataSourceAdapter(ObjectListView olv) { if (olv == null) throw new ArgumentNullException("olv"); this.ListView = olv; // ReSharper disable once DoNotCallOverridableMethodsInConstructor this.BindListView(this.ListView); }
public static void AddColumnForOlv(Type type, ObjectListView olv) { olv.Columns.Clear(); olv.AllColumns.Clear(); var lColumn = ReflectionUtils.PropertysFromType(type); var i = 0; foreach (var colN in lColumn) { var col = new OLVColumn(); col.AspectName = colN.Name; col.DisplayIndex = i++; col.Text = colN.Name; col.IsEditable = true; if (colN.PropertyType.FullName == "System.Boolean") { col.CheckBoxes = true; } if (colN.PropertyType.FullName == "System.Single") { var colName = colN.Name; col.AspectPutter = delegate(Object row, Object newvalue) { ReflectionUtils.SetPropertyInternal(row, colName, float.Parse(newvalue.ToString())); }; } olv.AllColumns.Add(col); olv.Columns.Add(col); } }
/// <summary> /// Create a data object which operates on the given model objects /// in the given ObjectListView /// </summary> /// <param name="olv">The source of the data object</param> /// <param name="modelObjects">The model objects to be put into the data object</param> public OLVDataObject(ObjectListView olv, IList modelObjects) { this.objectListView = olv; this.modelObjects = modelObjects; this.includeHiddenColumns = olv.IncludeHiddenColumnsInDataTransfer; this.includeColumnHeaders = olv.IncludeColumnHeadersInCopy; this.CreateTextFormats(); }
public void updateStatusLine(ObjectListView olv) { IList objects = olv.Objects as IList; int rows = theQueue.dt.Rows.Count; this.label1.Text = String.Format("{0} patients", olv.Items.Count); }
/// <summary> /// Helper method for GenerateListColumns() /// </summary> /// <param name="objectListView"></param> /// <param name="data"></param> public static void AddListColumn(ObjectListView objectListView, string name, string aspect) { OLVColumn columnHeader = new OLVColumn(); columnHeader.Text = name; columnHeader.AspectName = aspect; objectListView.Columns.Add(columnHeader); }
/// <summary> /// 1.3. 向ListView 中添加栏位 /// </summary> /// <param name="_ColumnList"></param> private void AddColumnsToListVIew(ObjectListView _Listview, List<OLVColumn> _ColumnList) { if (_ColumnList != null && _ColumnList.Count > 0) { foreach (OLVColumn _Column in _ColumnList) { _Listview.Columns.Add(_Column); } } }
private static string GetHeaders(ObjectListView listView, string[] values) { var columns = listView.ColumnsInDisplayOrder; int nbCol = columns.Count; for (int i = 0; i < nbCol; i++) { var col = columns[i]; values[i] = col.Text; } return string.Join("\t", values); }
private void ChangeEditable(ObjectListView objectListView, ComboBox comboBox) { if (comboBox.Text == "No") objectListView.CellEditActivation = ObjectListView.CellEditActivateMode.None; else if (comboBox.Text == "Single Click") objectListView.CellEditActivation = ObjectListView.CellEditActivateMode.SingleClick; else if (comboBox.Text == "Double Click") objectListView.CellEditActivation = ObjectListView.CellEditActivateMode.DoubleClick; else objectListView.CellEditActivation = ObjectListView.CellEditActivateMode.F2Only; }
private void StringListPutHelper(ObjectListView list_view, List<string> l, object row_object, object value) { for (int i = 0, count = l.Count; i < count; ++i) { if (Object.ReferenceEquals(row_object, l[i])) { l[i] = (string)value; break; } } list_view.SetObjects(l, true); }
public void SetBusy(ObjectListView lv,bool busy) { if (busy) { lv.OverlayText = GenerateOverlay(); } else { lv.OverlayText = null; } }
/// <summary> /// Replace all columns of the given ObjectListView with columns generated /// from the first member of the given enumerable. If the enumerable is /// empty or null, the ObjectListView will be cleared. /// </summary> /// <param name="olv">The ObjectListView to modify</param> /// <param name="enumerable">The collection whose first element will be used to generate columns.</param> static public void GenerateColumns(ObjectListView olv, IEnumerable enumerable) { // Generate columns based on the type of the first model in the collection and then quit if (enumerable != null) { foreach (object model in enumerable) { Generator.GenerateColumns(olv, model.GetType()); return; } } // If we reach here, the collection was empty, so we clear the list Generator.ReplaceColumns(olv, new List<OLVColumn>()); }
/// <summary> /// Create a GroupingParameters /// </summary> /// <param name="olv"></param> /// <param name="groupByColumn"></param> /// <param name="groupByOrder"></param> /// <param name="column"></param> /// <param name="order"></param> /// <param name="secondaryColumn"></param> /// <param name="secondaryOrder"></param> /// <param name="titleFormat"></param> /// <param name="titleSingularFormat"></param> /// <param name="sortItemsByPrimaryColumn"></param> public GroupingParameters(ObjectListView olv, OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder, string titleFormat, string titleSingularFormat, bool sortItemsByPrimaryColumn) { this.ListView = olv; this.GroupByColumn = groupByColumn; this.GroupByOrder = groupByOrder; this.PrimarySort = column; this.PrimarySortOrder = order; this.SecondarySort = secondaryColumn; this.SecondarySortOrder = secondaryOrder; this.SortItemsByPrimaryColumn = sortItemsByPrimaryColumn; this.TitleFormat = titleFormat; this.TitleSingularFormat = titleSingularFormat; }
/// <summary> /// 1.2.初始化一个栏位 /// </summary> /// <param name="Title">显示的名称</param> /// <param name="aspect">名称代码</param> /// <param name="Name">栏位名称</param> /// <param name="alig">对齐方式</param> /// <param name="bolleter">超出界限部分是否显示省略号</param> /// <param name="with">栏位宽度</param> /// <param name="columnobj">栏位对象</param> /// <param name="isSHow">是否显示</param> private OLVColumn InitializationOLVCOlumn(string Title, string aspect, string Name, HorizontalAlignment alig, bool bolleter, int with, object columnobj, bool isSHow,ObjectListView listview,IListViewColumnFormater _formater) { OLVColumn newcolumn = new OLVColumn(); newcolumn.HeaderTextAlign = alig; newcolumn.UseInitialLetterForGroup = bolleter; newcolumn.Text = Title; newcolumn.Name = Name; newcolumn.Width = with; newcolumn.Tag = columnobj; newcolumn.IsVisible = isSHow;//是否显示 _formater.Formater(listview,newcolumn, isSHow); return newcolumn; }
private static string RowToString(ObjectListView listView, int rowIndex, string[] values) { var columns = listView.ColumnsInDisplayOrder; int nbCol = columns.Count; var modelObject = listView.GetModelObject(rowIndex); for (int i = 0; i < nbCol; i++) { var col = columns[i]; string val = col.GetStringValue(modelObject); string escapeVal = StringHelpers.Escape(val); values[i] = escapeVal; } return string.Join("\t", values); }
/// <summary> /// 开始初始化 /// </summary> /// <param name="_Listview"></param> /// <param name="_listcolumns"></param> /// <param name="_formater">字段格式化类</param> public void Init(ObjectListView _Listview, List<ListColumnInfo> _listcolumns,IListViewColumnFormater _formater) { if (_Listview.Columns != null && _Listview.Columns.Count > 0) { _Listview.Columns.Clear(); } List<OLVColumn> _Columns = new List<OLVColumn>(); foreach (ListColumnInfo _Column in _listcolumns) { _Columns.Add(InitializationOLVCOlumn(_Column.ColumnTitle, _Column.ColumnName, _Column.ColumnName, _Column.HAlign, true, _Column.ColumnLength, _Column.ColumnName, true,_Listview,_formater)); } AddColumnsToListVIew(_Listview, _Columns);//向ListView 中填充栏位 }
public static void TimedFilter(ObjectListView olv, string txt, TextMatchFilter.MatchKind matchKind = TextMatchFilter.MatchKind.Text) { TextMatchFilter filter = null; if (!String.IsNullOrEmpty(txt)) filter = new TextMatchFilter(olv, txt, matchKind); // Setup a default renderer to draw the filter matches olv.DefaultRenderer = filter == null ? null : new HighlightTextRenderer(filter); // Some lists have renderers already installed var highlightingRenderer = olv.GetColumn(0).Renderer as HighlightTextRenderer; if (highlightingRenderer != null) highlightingRenderer.Filter = filter; olv.ModelFilter = filter; }
public override void Draw(ObjectListView olv, Graphics g, Rectangle r) { if (olv.HotRowIndex < 0) return; if (olv.View == View.Tile) return; OLVListItem item = olv.GetItem(olv.HotRowIndex); if (item == null) return; Size cardSize = new Size(400, 250); Rectangle cardBounds = new Rectangle( r.Right - cardSize.Width - 8, r.Bottom - cardSize.Height - 20, cardSize.Width, cardSize.Height); businessCardRenderer.DrawBusinessCard(g, cardBounds, item.RowObject, olv, item); }
public override void Draw(BrightIdeasSoftware.ObjectListView olv, Graphics g, Rectangle r) { Rectangle cellBounds = this.CellBounds; cellBounds.Inflate(-this.CellPadding.Width, -this.CellPadding.Height); Rectangle textBounds = cellBounds; if (this.ImageList != null && !String.IsNullOrEmpty(this.ImageName)) { var img = this.ImageList.Images[this.ImageName]; if (img != null) { g.DrawImage(img, cellBounds.Location); textBounds.X += this.ImageList.ImageSize.Width; textBounds.Width -= this.ImageList.ImageSize.Width; } } //g.DrawRectangle(Pens.Red, textBounds); // Draw the title using (StringFormat fmt = new StringFormat(StringFormatFlags.NoWrap)) { fmt.Trimming = StringTrimming.EllipsisCharacter; fmt.Alignment = StringAlignment.Near; fmt.LineAlignment = StringAlignment.Near; using (SolidBrush b = new SolidBrush(this.TitleColor)) { g.DrawString(this.Title, this.TitleFont, b, textBounds, fmt); } // Draw the description SizeF size = g.MeasureString(this.Title, this.TitleFont, (int)textBounds.Width, fmt); textBounds.Y += (int)size.Height; textBounds.Height -= (int)size.Height; } // Draw the description using (StringFormat fmt2 = new StringFormat()) { fmt2.Trimming = StringTrimming.EllipsisCharacter; using (SolidBrush b = new SolidBrush(this.DescriptionColor)) { g.DrawString(this.Description, this.DescripionFont, b, textBounds, fmt2); } } }
/// <summary> /// Create an AutoCompleteCellEditor /// </summary> /// <param name="lv"></param> /// <param name="column"></param> public AutoCompleteCellEditor(ObjectListView lv, OLVColumn column) { this.DropDownStyle = ComboBoxStyle.DropDown; Dictionary<String, bool> alreadySeen = new Dictionary<string, bool>(); for (int i = 0; i < Math.Min(lv.GetItemCount(), 1000); i++) { String str = column.GetStringValue(lv.GetModelObject(i)); if (!alreadySeen.ContainsKey(str)) { this.Items.Add(str); alreadySeen[str] = true; } } this.Sorted = true; this.AutoCompleteSource = AutoCompleteSource.ListItems; this.AutoCompleteMode = AutoCompleteMode.Append; }
public TraitViewManager(FormGrangerMain mainForm, GrangerContext context, ObjectListView listview) { MainForm = mainForm; Context = context; OLV = listview; OLV.FormatRow += OLV_FormatRow; AllTraits = HorseTrait.GetAllTraitEnums().Select(x => new HorseTrait(x)).ToArray(); BuildClearTraitView(); listview.SetObjects(Items); Decide(); MainForm.Granger_SelectedSingleHorseChanged += MainForm_Granger_SelectedHorsesChanged; MainForm.Granger_ValuatorChanged += MainForm_Granger_ValuatorChanged; MainForm.Granger_TraitViewDisplayModeChanged += MainForm_Granger_TraitViewDisplayModeChanged; Context.OnHerdsModified += Context_OnHerdsModified; Context.OnHorsesModified += Context_OnHorsesModified; Context.OnTraitValuesModified += Context_OnTraitValuesModified; }
public void TimedFilter(ObjectListView olv, string txt, int matchKind) { TextMatchFilter filter = null; if (!String.IsNullOrEmpty(txt)) { switch (matchKind) { case 0: default: filter = TextMatchFilter.Contains(olv, txt); break; case 1: filter = TextMatchFilter.Prefix(olv, txt); break; case 2: filter = TextMatchFilter.Regex(olv, txt); break; } } olv.AdditionalFilter = filter; }
/// <summary> /// Create a TextFilter /// </summary> /// <param name="olv"></param> /// <param name="text"></param> /// <param name="columns"></param> public TextMatchFilter(ObjectListView olv, string text, OLVColumn[] columns) : this(olv, text, columns, MatchKind.Text, StringComparison.InvariantCultureIgnoreCase) { }
/// <summary> /// Draw a filled border /// </summary> /// <param name="olv"></param> /// <param name="g"></param> /// <param name="r"></param> public override void Draw(ObjectListView olv, Graphics g, Rectangle r) { Rectangle bounds = CalculateBounds(); if (!bounds.IsEmpty) DrawFilledBorder(g, bounds); }
/// <summary> /// Replace all columns of the given ObjectListView with columns generated /// from the first member of the given enumerable. If the enumerable is /// empty or null, the ObjectListView will be cleared. /// </summary> /// <param name="olv">The ObjectListView to modify</param> /// <param name="enumerable">The collection whose first element will be used to generate columns.</param> static public void GenerateColumns(ObjectListView olv, IEnumerable enumerable) { Generator.GenerateColumns(olv, enumerable, false); }
public virtual Object StartDrag(ObjectListView olv, MouseButtons button, OLVListItem item) { return(null); }
public static IntPtr InsertGroup(ObjectListView olv, LVGROUP2 group) { return(NativeMethods.SendMessage(olv.Handle, LVM_INSERTGROUP, -1, ref group)); }
/// <summary> /// Generate columns into the given ObjectListView that come from the public properties of the given /// model object type. /// </summary> /// <param name="olv">The ObjectListView to modify</param> /// <param name="type">The model type whose attributes will be considered.</param> /// <param name="allProperties">Will columns be generated for properties that are not marked with [OLVColumn].</param> static public void GenerateColumns(ObjectListView olv, Type type, bool allProperties) { Generator.Instance.GenerateAndReplaceColumns(olv, type, allProperties); }
public static int GetGroupInfo(ObjectListView olv, int groupId, ref LVGROUP2 group) { return((int)NativeMethods.SendMessage(olv.Handle, LVM_GETGROUPINFO, groupId, ref group)); }
public static IntPtr SetGroupMetrics(ObjectListView olv, LVGROUPMETRICS metrics) { return(NativeMethods.SendMessage(olv.Handle, LVM_SETGROUPMETRICS, 0, ref metrics)); }
/// <summary> /// Create a TextFilter /// </summary> /// <param name="olv"></param> /// <param name="text"></param> /// <param name="match"></param> public TextMatchFilter(ObjectListView olv, string text, MatchKind match) : this(olv, text, null, match, StringComparison.InvariantCultureIgnoreCase) { }
/// <summary> /// Draw this overlay /// </summary> /// <param name="olv">The ObjectListView that is being overlaid</param> /// <param name="g">The Graphics onto the given OLV</param> /// <param name="r">The content area of the OLV</param> public virtual void Draw(ObjectListView olv, Graphics g, Rectangle r) { }
/// <summary> /// Get the scroll position of the given scroll bar /// </summary> /// <param name="handle"></param> /// <param name="horizontalBar"></param> /// <returns></returns> public static int GetScrollPosition(ObjectListView objectListView, bool horizontalBar) { int fnBar = (horizontalBar ? SB_HORZ : SB_VERT); SCROLLINFO si = new SCROLLINFO(); si.fMask = SIF_POS; if (GetScrollInfo(objectListView.Handle, fnBar, si)) return si.nPos; else return -1; }
/// <summary> /// Create a TextFilter /// </summary> /// <param name="olv"></param> public TextMatchFilter(ObjectListView olv) { this.ListView = olv; }
/// <summary> /// Create a TextFilter that finds the given string using the given comparison /// </summary> /// <param name="olv"></param> /// <param name="text"></param> /// <param name="comparison"></param> public TextMatchFilter(ObjectListView olv, string text, StringComparison comparison) { this.ListView = olv; this.ContainsStrings = new string[] { text }; this.StringComparison = comparison; }
/// <summary> /// Draw a tint over everything in the ObjectListView except the /// row under the mouse. /// </summary> /// <param name="olv"></param> /// <param name="g"></param> /// <param name="r"></param> public override void Draw(ObjectListView olv, Graphics g, Rectangle r) { if (!r.Contains(olv.PointToClient(Cursor.Position))) return; Rectangle bounds = RowBounds; if (bounds.IsEmpty) { if (olv.View == View.Tile) g.FillRectangle(FillBrush, r); return; } using (var newClip = new Region(r)) { bounds.Inflate(BoundsPadding); newClip.Exclude(GetRoundedRect(bounds, CornerRounding)); Region originalClip = g.Clip; g.Clip = newClip; g.FillRectangle(FillBrush, r); g.Clip = originalClip; } }
/// <summary> /// Create a TextFilter that finds the given string using the given comparison /// </summary> /// <param name="olv"></param> /// <param name="text"></param> /// <param name="comparison"></param> public TextMatchFilter(ObjectListView olv, string text, StringComparison comparison) { ListView = olv; ContainsStrings = new[] { text }; StringComparison = comparison; }
/// <summary> /// Create a TextFilter that finds the given string /// </summary> /// <param name="olv"></param> /// <param name="text"></param> public TextMatchFilter(ObjectListView olv, string text) { this.ListView = olv; this.ContainsStrings = new string[] { text }; }
/// <summary> /// Create a TextFilter that finds the given string /// </summary> /// <param name="olv"></param> /// <param name="text"></param> public TextMatchFilter(ObjectListView olv, string text) { ListView = olv; ContainsStrings = new[] { text }; }
public static IntPtr SetGroupInfo(ObjectListView olv, int groupId, LVGROUP2 group) { return(NativeMethods.SendMessage(olv.Handle, LVM_SETGROUPINFO, groupId, ref group)); }
/// <summary> /// Open this form so it will edit the columns that are available in the listview's current view /// </summary> /// <param name="olv">The ObjectListView whose columns are to be altered</param> public void OpenOn(ObjectListView olv) { OpenOn(olv, olv.View); }
public static GroupState GetGroupState(ObjectListView olv, int groupId, GroupState mask) { return((GroupState)NativeMethods.SendMessage(olv.Handle, LVM_GETGROUPSTATE, groupId, (int)mask)); }
/// <summary> /// Create a header control for the given ObjectListView. /// </summary> /// <param name="olv"></param> public HeaderControl(ObjectListView olv) { this.ListView = olv; this.AssignHandle(NativeMethods.GetHeaderControl(olv)); }
/// <summary> /// Generate columns into the given ObjectListView that come from the public properties of the given /// model object type. /// </summary> /// <param name="olv">The ObjectListView to modify</param> /// <param name="type">The model type whose attributes will be considered.</param> static public void GenerateColumns(ObjectListView olv, Type type) { Generator.Instance.GenerateAndReplaceColumns(olv, type, false); }
/// <summary> /// Attach this form to the given ObjectListView /// </summary> public void Bind(ObjectListView olv, IOverlay overlay) { if (this.objectListView != null) { this.Unbind(); } this.objectListView = olv; this.Overlay = overlay; this.mdiClient = null; this.mdiOwner = null; if (this.objectListView == null) { return; } // NOTE: If you listen to any events here, you *must* stop listening in Unbind() this.objectListView.Disposed += new EventHandler(objectListView_Disposed); this.objectListView.LocationChanged += new EventHandler(objectListView_LocationChanged); this.objectListView.SizeChanged += new EventHandler(objectListView_SizeChanged); this.objectListView.VisibleChanged += new EventHandler(objectListView_VisibleChanged); this.objectListView.ParentChanged += new EventHandler(objectListView_ParentChanged); // Collect our ancestors in the widget hierarchy if (this.ancestors == null) { this.ancestors = new List <Control>(); } Control parent = this.objectListView.Parent; while (parent != null) { this.ancestors.Add(parent); parent = parent.Parent; } // Listen for changes in the hierarchy foreach (Control ancestor in this.ancestors) { ancestor.ParentChanged += new EventHandler(objectListView_ParentChanged); TabControl tabControl = ancestor as TabControl; if (tabControl != null) { tabControl.Selected += new TabControlEventHandler(tabControl_Selected); } } // Listen for changes in our owning form this.Owner = this.objectListView.FindForm(); this.myOwner = this.Owner; if (this.Owner != null) { this.Owner.LocationChanged += new EventHandler(Owner_LocationChanged); this.Owner.SizeChanged += new EventHandler(Owner_SizeChanged); this.Owner.ResizeBegin += new EventHandler(Owner_ResizeBegin); this.Owner.ResizeEnd += new EventHandler(Owner_ResizeEnd); if (this.Owner.TopMost) { // We can't do this.TopMost = true; since that will activate the panel, // taking focus away from the owner of the listview NativeMethods.MakeTopMost(this); } // We need special code to handle MDI this.mdiOwner = this.Owner.MdiParent; if (this.mdiOwner != null) { this.mdiOwner.LocationChanged += new EventHandler(Owner_LocationChanged); this.mdiOwner.SizeChanged += new EventHandler(Owner_SizeChanged); this.mdiOwner.ResizeBegin += new EventHandler(Owner_ResizeBegin); this.mdiOwner.ResizeEnd += new EventHandler(Owner_ResizeEnd); // Find the MDIClient control, which houses all MDI children foreach (Control c in this.mdiOwner.Controls) { this.mdiClient = c as MdiClient; if (this.mdiClient != null) { break; } } if (this.mdiClient != null) { this.mdiClient.ClientSizeChanged += new EventHandler(myMdiClient_ClientSizeChanged); } } } this.UpdateTransparency(); }
public void InsertGroupNewStyle(ObjectListView olv) { this.ListView = olv; BrightIdeasSoftware.NativeMethods.InsertGroup(olv, this.AsNativeGroup(true)); this.SetGroupSpacing(); }
/// <summary> /// Create a data object from the selected objects in the given ObjectListView /// </summary> /// <param name="olv">The source of the data object</param> public OLVDataObject(ObjectListView olv) : this(olv, olv.SelectedObjects) { }
public OLVDataObject(ObjectListView olv, IList modelObjects) { this.objectListView = olv; this.modelObjects = modelObjects; }
public HeaderControl(ObjectListView olv) { this.ListView = olv; base.AssignHandle(BrightIdeasSoftware.NativeMethods.GetHeaderControl(olv)); }
/// <summary> /// Create a TextFilter /// </summary> /// <param name="olv"></param> /// <param name="text"></param> /// <param name="match"></param> /// <param name="comparison"></param> public TextMatchFilter(ObjectListView olv, string text, MatchKind match, StringComparison comparison) : this(olv, text, null, match, comparison) { }
/// <summary> /// Create an exporter that will export all the rows of the given ObjectListView /// </summary> /// <param name="olv"></param> public OLVExporter(ObjectListView olv) : this(olv, olv.Objects) { }
/// <summary> /// Draw the decoration /// </summary> /// <param name="olv"></param> /// <param name="g"></param> /// <param name="r"></param> public override void Draw(ObjectListView olv, Graphics g, Rectangle r) { if (!olv.IsCellEditing) return; Rectangle bounds = olv.CellEditor.Bounds; if (bounds.IsEmpty) return; bounds.Inflate(BoundsPadding); GraphicsPath path = GetRoundedRect(bounds, CornerRounding); if (FillBrush != null) { if (UseLightbox) { using (var newClip = new Region(r)) { newClip.Exclude(path); Region originalClip = g.Clip; g.Clip = newClip; g.FillRectangle(FillBrush, r); g.Clip = originalClip; } } else { g.FillPath(FillBrush, path); } } if (BorderPen != null) g.DrawPath(BorderPen, path); }
public static IntPtr HitTest(ObjectListView olv, ref LVHITTESTINFO hittest) { return(NativeMethods.SendMessage(olv.Handle, olv.View == View.Details ? LVM_SUBITEMHITTEST : LVM_HITTEST, -1, ref hittest)); }
/// <summary> /// Draw this decoration /// </summary> /// <param name="olv">The ObjectListView being decorated</param> /// <param name="g">The Graphics used for drawing</param> /// <param name="r">The bounds of the rendering</param> public virtual void Draw(ObjectListView olv, Graphics g, Rectangle r) { DrawText(g, CalculateItemBounds(ListItem, SubItem)); }
/// <summary> /// Insert a native group into the underlying Windows control, /// *without* using a ListViewGroup /// </summary> /// <param name="olv"></param> /// <remarks>This is used when creating virtual groups</remarks> public void InsertGroupNewStyle(ObjectListView olv) { this.ListView = olv; NativeMethods.InsertGroup(olv, this.AsNativeGroup(true)); }
protected virtual void UnbindListView(ObjectListView olv) { if (olv == null) return; olv.Freezing -= new EventHandler<FreezeEventArgs>(HandleListViewFreezing); olv.SelectedIndexChanged -= new EventHandler(HandleListViewSelectedIndexChanged); olv.BindingContextChanged -= new EventHandler(HandleListViewBindingContextChanged); }
/// <summary> /// Create a typed wrapper around the given list. /// </summary> /// <param name="olv">The listview to be wrapped</param> public TypedObjectListView(ObjectListView olv) { this.olv = olv; }