/// <summary> /// Offset cell bounds, check box bounds, image bounds and text bounds by specified offset. /// </summary> /// <param name="cell">Cell to offset.</param> /// <param name="x">Horizontal offset in pixels.</param> /// <param name="y">Vertical offset in pixels.</param> public void Offset(Cell cell, int x, int y) { cell.SetBounds(new Rectangle(cell.Bounds.X+x,cell.Bounds.Y+y,cell.Bounds.Width,cell.Bounds.Height)); if(!cell.CheckBoxBounds.IsEmpty) cell.SetCheckBoxBounds(new Rectangle(cell.CheckBoxBounds.X+x,cell.CheckBoxBounds.Y+y,cell.CheckBoxBounds.Width,cell.CheckBoxBounds.Height)); if(!cell.ImageBounds.IsEmpty) cell.SetImageBounds(new Rectangle(cell.ImageBounds.X+x,cell.ImageBounds.Y+y,cell.ImageBounds.Width,cell.ImageBounds.Height)); if(!cell.TextContentBounds.IsEmpty) cell.TextContentBounds=new Rectangle(cell.TextContentBounds.X+x,cell.TextContentBounds.Y+y,cell.TextContentBounds.Width,cell.TextContentBounds.Height); }
/// <summary> /// Initializes new instance of CellEditEventArgs class. /// </summary> /// <param name="cell">Reference to Cell this event is raised for.</param> /// <param name="action">Indicates the action that caused the event.</param> /// <param name="newText">Indicates new text of the cell if it applies to given event.</param> public CellEditEventArgs(Cell cell, eTreeAction action, string newText) { this.Action=action; this.Cell=cell; this.NewText=newText; }
private static void LoadCells(Node parentNode, XmlElement xmlCells) { foreach(XmlNode xmlChild in xmlCells.ChildNodes) { if(xmlChild.Name==XmlCellName && xmlChild is XmlElement) { Cell cell=new Cell(); parentNode.Cells.Add(cell); ElementSerializer.Deserialize(cell, xmlChild as XmlElement); // Load images if any foreach(XmlElement xmlImage in xmlChild.ChildNodes) { if(xmlImage.Name==XmlCellImagesName) { ElementSerializer.Deserialize(cell.Images, xmlImage); break; } } } } }
/// <summary>Makes a copy of a Cell.</summary> public virtual Cell Copy() { // TODO: Make sure that new properties are copied Cell c=new Cell(); c.CheckBoxAlignment=this.CheckBoxAlignment; c.CheckBoxVisible=this.CheckBoxVisible; c.Checked=this.Checked; c.Cursor=this.Cursor; c.Enabled=this.Enabled; c.ImageAlignment=this.ImageAlignment; c.SetCellImages(this.Images.Copy()); c.Layout=this.Layout; c.StyleDisabled=this.StyleDisabled; c.StyleMouseDown=this.StyleMouseDown; c.StyleMouseOver=this.StyleMouseOver; c.StyleNormal=this.StyleNormal; c.StyleSelected=this.StyleSelected; c.Tag=this.Tag; c.Text=this.Text; return c; }
/// <summary> /// Removes specified object from the collection. /// </summary> /// <param name="value"></param> public void Remove(Cell value) { List.Remove(value); }
/// <summary> /// Returns whether collection contains specified object. /// </summary> /// <param name="value">Object to look for.</param> /// <returns>true if object is part of the collection, otherwise false.</returns> public bool Contains(Cell value) { return List.Contains(value); }
/// <summary> /// Returns index of the object inside of the collection. /// </summary> /// <param name="value">Reference to the object.</param> /// <returns>Index of the object.</returns> public int IndexOf(Cell value) { return List.IndexOf(value); }
/// <summary>Default Constructor.</summary> public Node() { m_NodesColumns=new ColumnHeaderCollection(); m_Cells.SetParentNode(this); m_ParentConnectorPoints=new ConnectorPointsCollection(); m_ParentConnectorPoints.SetParentNode(this); Cell defaultCell=new Cell(); this.Cells.Add(defaultCell); }
/// <summary> /// Adds new object to the collection. /// </summary> /// <param name="cell">Object to add.</param> /// <returns>Index of newly added object.</returns> public int Add(Cell cell) { return List.Add(cell); }
/// <summary> /// Copies contained items to the Cell array. /// </summary> /// <param name="array">Array to copy to.</param> internal void CopyTo(Cell[] array) { List.CopyTo(array,0); }
/// <summary> /// Copies collection into the specified array. /// </summary> /// <param name="array">Array to copy collection to.</param> /// <param name="index">Starting index.</param> public void CopyTo(Cell[] array, int index) { List.CopyTo(array, index); }
/// <summary> /// Initializes new instance of CellImages class. /// </summary> /// <param name="parentCell">Reference to parent cell.</param> public CellImages(Cell parentCell) { m_ParentCell=parentCell; }
protected internal virtual void InvokeMarkupLinkClick(Cell cell, MarkupLinkClickEventArgs args) { if(MarkupLinkClick!=null) MarkupLinkClick(cell, args); TreeGX tree = this.TreeControl; if(tree!=null) tree.InvokeMarkupLinkClick(cell, args); }
/// <summary> /// Called after cell has been removed from Cells collection. /// </summary> /// <param name="cell">Reference to the removed cell.</param> internal void OnCellRemoved(Cell cell) { this.SizeChanged = true; OnDisplayChanged(); }
/// <summary> /// Default constructor for event data. /// </summary> /// <param name="action">Type of the action event is raised for.</param> /// <param name="cell">Cell that event is raised for.</param> public TreeGXCellCancelEventArgs(eTreeAction action, Cell cell):base(action,cell) { }
/// <summary> /// Default constructor for event data. /// </summary> /// <param name="action">Type of the action event is raised for.</param> /// <param name="cell">Cell that event is raised for.</param> public TreeGXCellEventArgs(eTreeAction action, Cell cell) { this.Action=action; this.Cell=cell; }
/// <summary> /// Inserts new object into the collection. /// </summary> /// <param name="index">Position of the object.</param> /// <param name="value">Object to insert.</param> public void Insert(int index, Cell value) { List.Insert(index, value); }