/// <summary>
 /// Initializes a new instance of the CellEventArgs class with 
 /// the specified Cell source, column index and row index
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="row">The Row index of the Cell</param>
 public CellEventArgsBase(Cell source, int column, int row)
     : base()
 {
     this.source = source;
     this.column = column;
     this.row = row;
 }
 /// <summary>
 /// Initializes a new instance of the CellMouseEventArgs class with 
 /// the specified source Cell, table, row index, column index and 
 /// cell bounds
 /// </summary>
 /// <param name="cell">The Cell that Raised the event</param>
 /// <param name="table">The Table the Cell belongs to</param>
 /// <param name="cellPos"></param>
 /// <param name="cellRect">The Cell's bounding rectangle</param>
 public CellMouseEventArgs(Cell cell, HTable table, CellPos cellPos, Gdk.Rectangle cellRect)
 {
     this.cell = cell;
     this.table = table;
     this.row = cellPos.Row;
     this.column = cellPos.Column;
     this.cellRect = cellRect;
 }
 /// <summary>
 /// Initializes a new instance of the CellKeyEventArgs class with 
 /// the specified source Cell, table, row index, column index, cell 
 /// bounds and KeyEventArgs
 /// </summary>
 /// <param name="cell">The Cell that Raised the event</param>
 /// <param name="table">The Table the Cell belongs to</param>
 /// <param name="row">The Row index of the Cell</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="cellRect">The Cell's bounding rectangle</param>
 /// <param name="kea"></param>
 public CellKeyEventArgs(Cell cell, HTable table, int row, int column, Gdk.Rectangle cellRect, Gtk.KeyReleaseEventArgs kea)
 {
     this.cell = cell;
     this.table = table;
     this.row = row;
     this.column = column;
     this.cellRect = cellRect;
 }
        /// <summary>
        /// Initializes a new instance of the CellEventArgs class with 
        /// the specified Cell source, column index and row index
        /// </summary>
        /// <param name="source">The Cell that Raised the event</param>
        /// <param name="editor">The CellEditor used to edit the Cell</param>
        /// <param name="table">The Table that the Cell belongs to</param>
        /// <param name="row">The Column index of the Cell</param>
        /// <param name="column">The Row index of the Cell</param>
        /// <param name="cellRect"></param>
        public CellEditEventArgs(Cell source, ICellEditor editor, HTable table, int row, int column, Gdk.Rectangle cellRect)
            : base(source, column, row)
        {
            this.editor = editor;
            this.table = table;
            this.cellRect = cellRect;

            this.cancel = false;
        }
        /// <summary>
        /// Adds the specified Cell to the end of the collection
        /// </summary>
        /// <param name="cell">The Cell to add</param>
        public int Add(Cell cell)
        {
            if (cell == null)
            {
                throw new System.ArgumentNullException("Cell is null");
            }

            int index = this.List.Add(cell);

            this.OnCellAdded(new RowEventArgs(this.owner, cell, index, index));

            return index;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the Row class with an array of Cell objects and 
        /// the foreground color, background color, and font of the Row
        /// </summary>
        /// <param name="cells">An array of Cell objects that represent the Cells of the Row</param>
        /// <param name="foreColor">The foreground Color of the Row</param>
        /// <param name="backColor">The background Color of the Row</param>
        /// <param name="font">The Font used to draw the text in the Row's Cells</param>
        public Row(Cell[] cells, Gdk.Color foreColor, Gdk.Color backColor, Pango.FontDescription font)
        {
            if (cells == null)
            {
                throw new ArgumentNullException("cells", "Cell[] cannot be null");
            }

            this.Init();

            this.ForeColor = foreColor;
            this.BackColor = backColor;
            this.Font = font;

            if (cells.Length > 0)
            {
                this.Cells.AddRange(cells);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the Row class with an array of strings 
        /// representing Cells and the foreground color, background color, and font 
        /// of the Row
        /// </summary>
        /// <param name="items">An array of strings that represent the Cells of the Row</param>
        /// <param name="foreColor">The foreground Color of the Row</param>
        /// <param name="backColor">The background Color of the Row</param>
        /// <param name="font">The Font used to draw the text in the Row's Cells</param>
        public Row(string[] items, Gdk.Color foreColor, Gdk.Color backColor, Pango.FontDescription font)
        {
            if (items == null)
            {
                throw new ArgumentNullException("items", "string[] cannot be null");
            }

            this.Init();

            this.ForeColor = foreColor;
            this.BackColor = backColor;
            this.Font = font;

            if (items.Length > 0)
            {
                Cell[] cells = new Cell[items.Length];

                for (int i=0; i<items.Length; i++)
                {
                    cells[i] = new Cell(items[i]);
                }

                this.Cells.AddRange(cells);
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the RowEventArgs class with 
 /// the specified Row source, row index, start index, end index 
 /// and affected Cell
 /// </summary>
 /// <param name="source">The Row that originated the event</param>
 /// <param name="rowIndex">The index of the Row</param>
 /// <param name="cell">The affected Cell</param>
 /// <param name="cellFromIndex">The start index of the affected Cell(s)</param>
 /// <param name="cellToIndex">The end index of the affected Cell(s)</param>
 /// <param name="eventType">The type of event</param>
 public RowEventArgs(Row source, int rowIndex, Cell cell, int cellFromIndex, int cellToIndex, RowEventType eventType)
     : base()
 {
     this.source = source;
     this.rowIndex = rowIndex;
     this.cell = cell;
     this.cellFromIndex = cellFromIndex;
     this.cellToIndex = cellToIndex;
     this.eventType = eventType;
 }
 /// <summary>
 /// Initializes a new instance of the PaintCellEventArgs class with 
 /// the specified graphics, table, row index, column index, selected value,  
 /// focused value, mouse value and clipping rectangle
 /// </summary>
 /// <param name="g">The Graphics used to paint the Cell</param>
 /// <param name="cell">The Cell to be painted</param>
 /// <param name="table">The Table the Cell belongs to</param>
 /// <param name="row">The Row index of the Cell</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="selected">Specifies whether the Cell is selected</param>
 /// <param name="focused">Specifies whether the Cell has focus</param>
 /// <param name="sorted">Specifies whether the Cell's Column is sorted</param>
 /// <param name="editable">Specifies whether the Cell is able to be edited</param>
 /// <param name="enabled">Specifies whether the Cell is enabled</param>
 /// <param name="cellRect">The rectangle in which to paint the Cell</param>
 public PaintCellEventArgs(Gtk.ExposeEventArgs g, Cell cell, HTable table, int row, int column, bool selected, bool focused, bool sorted, bool editable, bool enabled, Gdk.Rectangle cellRect)
 {
     this.cell = cell;
     this.table = table;
     this.row = row;
     this.column = column;
     this.selected = selected;
     this.focused = focused;
     this.sorted = sorted;
     this.editable = editable;
     this.enabled = enabled;
     this.cellRect = cellRect;
     this.handled = false;
 }
        /// <summary>
        /// Inserts an array of Cells into the collection at the specified index
        /// </summary>
        /// <param name="index">The zero-based index at which the cells should be inserted</param>
        /// <param name="cells">An array of Cells to be inserted into the collection</param>
        public void InsertRange(int index, Cell[] cells)
        {
            if (cells == null)
            {
                throw new System.ArgumentNullException("Cell[] is null");
            }

            if (index < 0)
            {
                throw new IndexOutOfRangeException();
            }

            if (index >= this.Count)
            {
                this.AddRange(cells);
            }
            else
            {
                for (int i=cells.Length-1; i>=0; i--)
                {
                    this.Insert(index, cells[i]);
                }
            }
        }
        /// <summary>
        ///	Returns the index of the specified Cell in the model
        /// </summary>
        /// <param name="cell">The Cell to look for</param>
        /// <returns>The index of the specified Cell in the model</returns>
        public int IndexOf(Cell cell)
        {
            for (int i=0; i<this.Count; i++)
            {
                if (this[i] == cell)
                {
                    return i;
                }
            }

            return -1;
        }
 /// <summary>
 /// Initializes a new instance of the CellEventArgs class with 
 /// the specified Cell source and event type
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 public CellEventArgsBase(Cell source)
     : this(source, -1, -1)
 {
 }
 /// <summary>
 /// Initializes a new instance of the CellMouseEventArgs class with 
 /// the specified source Cell, table, row index, column index and 
 /// cell bounds
 /// </summary>
 /// <param name="cell">The Cell that Raised the event</param>
 /// <param name="table">The Table the Cell belongs to</param>
 /// <param name="row">The Row index of the Cell</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="cellRect">The Cell's bounding rectangle</param>
 public CellMouseEventArgs(Cell cell, HTable table, int row, int column, Gdk.Rectangle cellRect)
 {
     this.cell = cell;
     this.table = table;
     this.row = row;
     this.column = column;
     this.cellRect = cellRect;
 }
 /// <summary>
 /// Initializes a new instance of the CellKeyEventArgs class with 
 /// the specified source Cell, table, row index, column index and 
 /// cell bounds
 /// </summary>
 /// <param name="cell">The Cell that Raised the event</param>
 /// <param name="table">The Table the Cell belongs to</param>
 /// <param name="cellPos"></param>
 /// <param name="cellRect">The Cell's bounding rectangle</param>
 /// <param name="kea"></param>
 public CellKeyEventArgs(Cell cell, HTable table, CellPos cellPos, Gdk.Rectangle cellRect, Gtk.KeyReleaseEventArgs kea)
 {
     this.cell = cell;
     this.table = table;
     this.row = cellPos.Row;
     this.column = cellPos.Column;
     this.cellRect = cellRect;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the RowEventArgs class with 
 /// the specified Row source, row index, start index, end index 
 /// and affected Cell
 /// </summary>
 /// <param name="source">The Row that originated the event</param>
 /// <param name="cell">The affected Cell</param>
 /// <param name="cellFromIndex">The start index of the affected Cell(s)</param>
 /// <param name="cellToIndex">The end index of the affected Cell(s)</param>
 public RowEventArgs(Row source, Cell cell, int cellFromIndex, int cellToIndex)
     : this(source, -1, cell, cellFromIndex, cellToIndex, RowEventType.Unknown)
 {
 }
Ejemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the Row class with an array of strings 
        /// representing Cells
        /// </summary>
        /// <param name="items">An array of strings that represent the Cells of 
        /// the Row</param>
        public Row(string[] items)
        {
            if (items == null)
            {
                throw new ArgumentNullException("items", "string[] cannot be null");
            }

            this.Init();

            if (items.Length > 0)
            {
                Cell[] cells = new Cell[items.Length];

                for (int i=0; i<items.Length; i++)
                {
                    cells[i] = new Cell(items[i]);
                }

                this.Cells.AddRange(cells);
            }
        }
 /// <summary>
 /// Initializes a new instance of the CellFocusEventArgs class with 
 /// the specified source Cell, table, row index, column index and 
 /// cell bounds
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 /// <param name="table">The Table the Cell belongs to</param>
 /// <param name="row">The Row index of the Cell</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="cellRect">The Cell's bounding rectangle</param>
 public CellFocusEventArgs(Cell source, HTable table, int row, int column, Rectangle cellRect)
     : base(source, column, row)
 {
     this.table = table;
     this.cellRect = cellRect;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the CellEventArgs class with 
 /// the specified Cell source and event type
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 /// <param name="eventType">The type of event</param>
 /// <param name="oldValue">The old value of the property</param>
 public CellEventArgs(Cell source, CellEventType eventType, object oldValue)
     : this(source, -1, -1, eventType, oldValue)
 {
 }
        /// <summary>
        /// Inserts a Cell into the collection at the specified index
        /// </summary>
        /// <param name="index">The zero-based index at which the Cell 
        /// should be inserted</param>
        /// <param name="cell">The Cell to insert</param>
        public void Insert(int index, Cell cell)
        {
            if (cell == null)
            {
                return;
            }

            if (index < 0)
            {
                throw new IndexOutOfRangeException();
            }

            if (index >= this.Count)
            {
                this.Add(cell);
            }
            else
            {
                base.List.Insert(index, cell);

                this.OnCellAdded(new RowEventArgs(this.owner, cell, index, index));
            }
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the CellEventArgs class with 
 /// the specified Cell source, column index, row index and event type
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="row">The Row index of the Cell</param>
 /// <param name="eventType">The type of event</param>
 /// <param name="oldValue">The old value of the property</param>
 public CellEventArgs(Cell source, int column, int row, CellEventType eventType, object oldValue)
     : base(source, column, row)
 {
     this.eventType = eventType;
     this.oldValue = oldValue;
 }
        /// <summary>
        /// Removes the specified Cell from the model
        /// </summary>
        /// <param name="cell">The Cell to remove</param>
        public void Remove(Cell cell)
        {
            int cellIndex = this.IndexOf(cell);

            if (cellIndex != -1)
            {
                this.RemoveAt(cellIndex);
            }
        }
 /// <summary>
 /// Initializes a new instance of the CellEventArgs class with 
 /// the specified Cell source, column index and row index
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 /// <param name="editor">The CellEditor used to edit the Cell</param>
 /// <param name="table">The Table that the Cell belongs to</param>
 public CellEditEventArgs(Cell source, ICellEditor editor, HTable table)
     : this(source, editor, table, -1, -1, Gdk.Rectangle.Zero)
 {
 }
        /// <summary>
        /// Adds an array of Cell objects to the collection
        /// </summary>
        /// <param name="cells">An array of Cell objects to add 
        /// to the collection</param>
        public void AddRange(Cell[] cells)
        {
            if (cells == null)
            {
                throw new System.ArgumentNullException("Cell[] is null");
            }

            for (int i=0; i<cells.Length; i++)
            {
                this.Add(cells[i]);
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Initializes a new instance of the Row class with an array of Cell objects 
        /// </summary>
        /// <param name="cells">An array of Cell objects that represent the Cells of the Row</param>
        public Row(Cell[] cells)
        {
            if (cells == null)
            {
                throw new ArgumentNullException("cells", "Cell[] cannot be null");
            }

            this.Init();

            if (cells.Length > 0)
            {
                this.Cells.AddRange(cells);
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="cell"></param>
 internal void SetCell(Cell cell)
 {
     this.cell = cell;
 }
 /// <summary>
 /// Initializes a new instance of the CellFocusEventArgs class with
 /// the specified source Cell, table, row index, column index and
 /// cell bounds
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 /// <param name="table">The Table the Cell belongs to</param>
 /// <param name="row">The Row index of the Cell</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="cellRect">The Cell's bounding rectangle</param>
 public CellFocusEventArgs(Cell source, HTable table, int row, int column, Rectangle cellRect) : base(source, column, row)
 {
     this.table    = table;
     this.cellRect = cellRect;
 }