Inheritance: System.ComponentModel.Component
Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the RowCollection class 
        /// that belongs to the specified TableModel
        /// </summary>
        /// <param name="owner">A TableModel representing the tableModel that owns 
        /// the RowCollection</param>
        public RowCollection(TableModel owner)
            : base()
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            this.owner = owner;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the ComparerBase class with the specified 
 /// TableModel, Column index and SortOrder
 /// </summary>
 /// <param name="tableModel">The TableModel that contains the data to be sorted</param>
 /// <param name="column">The index of the Column to be sorted</param>
 /// <param name="sortOrder">Specifies how the Column is to be sorted</param>
 public ComparerBase(TableModel tableModel, int column, SortOrder sortOrder)
 {
     this.tableModel = tableModel;
     this.column = column;
 }
Ejemplo n.º 3
0
            /// <summary>
            /// Initializes a new instance of the TableModel.Selection class 
            /// that belongs to the specified TableModel
            /// </summary>
            /// <param name="owner">A TableModel representing the tableModel that owns 
            /// the Selection</param>
            public Selection(TableModel owner)
            {
                if (owner == null)
                {
                    throw new ArgumentNullException("owner", "owner cannot be null");
                }

                this.owner = owner;
                this.rows = new ArrayList();

                this.shiftSelectStart = CellPos.Empty;
                this.shiftSelectEnd = CellPos.Empty;
            }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the DateTimeComparer class with the specified 
 /// TableModel, Column index and SortOrder
 /// </summary>
 /// <param name="tableModel">The TableModel that contains the data to be sorted</param>
 /// <param name="column">The index of the Column to be sorted</param>
 /// <param name="sortOrder">Specifies how the Column is to be sorted</param>
 public DateTimeComparer(TableModel tableModel, int column, SortOrder sortOrder)
     : base(tableModel, column, sortOrder)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the TextComparer class with the specified 
 /// TableModel, Column index and SortOrder
 /// </summary>
 /// <param name="tableModel">The TableModel that contains the data to be sorted</param>
 /// <param name="column">The index of the Column to be sorted</param>
 /// <param name="sortOrder">Specifies how the Column is to be sorted</param>
 public TextComparer(TableModel tableModel, int column, SortOrder sortOrder)
     : base(tableModel, column, sortOrder)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the InsertionSorter class with the specified 
 /// TableModel, Column index, IComparer and SortOrder
 /// </summary>
 /// <param name="tableModel">The TableModel that contains the data to be sorted</param>
 /// <param name="column">The index of the Column to be sorted</param>
 /// <param name="comparer">The IComparer used to sort the Column's Cells</param>
 /// <param name="sortOrder">Specifies how the Column is to be sorted</param>
 public InsertionSorter(TableModel tableModel, int column, IComparer comparer, SortOrder sortOrder)
     : base(tableModel, column, comparer, sortOrder)
 {
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Releases all resources used by the Row
        /// </summary>
        public void Dispose()
        {
            if (!this.disposed)
            {
                this.tag = null;

                if (this.tableModel != null)
                {
                    this.tableModel.Rows.Remove(this);
                }

                this.tableModel = null;
                this.index = -1;

                if (this.cells != null)
                {
                    Cell cell;

                    for (int i = 0; i < this.cells.Count; i++)
                    {
                        cell = this.cells[i];

                        cell.InternalRow = null;
                        cell.Dispose();
                    }

                    this.cells = null;
                }

                this.rowStyle = null;
                this.state = (byte)0;

                this.disposed = true;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Initialise default values
        /// </summary>
        private void Init()
        {
            this.cells = null;

            this.tag = null;
            this.tableModel = null;
            this.index = -1;
            this.rowStyle = null;
            this.selectedCellCount = 0;
            this.hasWordWrapCell = false;
            this.wordWrapIndex = 0;
            this.height = -1;

            this.state = (byte)(STATE_EDITABLE | STATE_ENABLED | STATE_VISIBLE);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the Table class with default settings
        /// </summary>
        public Table()
        {
            // starting setup
            this.init = true;

            // This call is required by the Windows.Forms Form Designer.
            components = new System.ComponentModel.Container();

            //
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.TabStop = true;

            this.Size = new Size(150, 150);

            this.BackColor = Color.White;

            //
            this.columnModel = null;
            this.tableModel = null;

            // header
            this.headerStyle = ColumnHeaderStyle.Clickable;
            this.headerFont = this.Font;
            this.headerRenderer = new XPHeaderRenderer();
            //this.headerRenderer = new GradientHeaderRenderer();
            //this.headerRenderer = new FlatHeaderRenderer();
            this.headerRenderer.Font = this.headerFont;
            this.headerContextMenu = new HeaderContextMenu();

            this.columnResizing = true;
            this.resizingColumnIndex = -1;
            this.resizingColumnWidth = -1;
            this.hotColumn = -1;
            this.pressedColumn = -1;
            this.lastSortedColumn = -1;
            this.sortedColumnBackColor = Color.WhiteSmoke;

            // borders
            this.borderStyle = BorderStyle.Fixed3D;
            this.borderColor = Color.Black;
            this.unfocusedBorderColor = Color.Black;

            // scrolling
            this.scrollable = true;

            this.hScrollBar = new HScrollBar();
            this.hScrollBar.Visible = false;
            this.hScrollBar.Location = new Point(this.BorderWidth, this.Height - this.BorderWidth - SystemInformation.HorizontalScrollBarHeight);
            this.hScrollBar.Width = this.Width - (this.BorderWidth * 2) - SystemInformation.VerticalScrollBarWidth;
            this.hScrollBar.Scroll += new ScrollEventHandler(this.OnHorizontalScroll);
            this.Controls.Add(this.hScrollBar);

            this.vScrollBar = new VScrollBar();
            this.vScrollBar.Visible = false;
            this.vScrollBar.Location = new Point(this.Width - this.BorderWidth - SystemInformation.VerticalScrollBarWidth, this.BorderWidth);
            this.vScrollBar.Height = this.Height - (this.BorderWidth * 2) - SystemInformation.HorizontalScrollBarHeight;
            this.vScrollBar.Scroll += new ScrollEventHandler(this.OnVerticalScroll);
            this.Controls.Add(this.vScrollBar);

            //
            this.gridLines = GridLines.None; ;
            this.gridColor = SystemColors.Control;
            this.gridLineStyle = GridLineStyle.Solid;

            this.allowSelection = true;
            this.allowRMBSelection = false;
            this.multiSelect = false;
            this.fullRowSelect = false;
            this.hideSelection = false;
            this.selectionBackColor = SystemColors.Highlight;
            this.selectionForeColor = SystemColors.HighlightText;
            this.unfocusedSelectionBackColor = SystemColors.Control;
            this.unfocusedSelectionForeColor = SystemColors.ControlText;
            this.selectionStyle = SelectionStyle.ListView;
            this.alternatingRowColor = Color.Transparent;
            this.alternatingRowSpan = 1;

            // current table state
            this.tableState = TableState.Normal;

            this.lastMouseCell = new CellPos(-1, -1);
            this.lastMouseDownCell = new CellPos(-1, -1);
            this.focusedCell = new CellPos(-1, -1);
            this.hoverTime = 1000;
            this.trackMouseEvent = null;
            this.ResetMouseEventArgs();

            this.toolTip = new ToolTip(this.components);
            this.toolTip.Active = false;
            this.toolTip.InitialDelay = 1000;

            this.noItemsText = "There are no items in this view";

            this.editingCell = new CellPos(-1, -1);
            this.curentCellEditor = null;
            this.editStartAction = EditStartAction.DoubleClick;
            this.customEditKey = Keys.F5;
            //this.tabMovesEditor = true;

            // showSelectionRectangle defaults to true
            this.showSelectionRectangle = true;

            // for data binding
            listChangedHandler = new ListChangedEventHandler(dataManager_ListChanged);
            positionChangedHandler = new EventHandler(dataManager_PositionChanged);
            dataSourceColumnBinder = new DataSourceColumnBinder();

            // finished setting up
            this.beginUpdateCount = 0;
            this.init = false;
            this.preview = false;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the SelectionEventArgs class with 
        /// the specified TableModel source, old selected indicies and new 
        /// selected indicies
        /// </summary>
        /// <param name="source">The TableModel that originated the event</param>
        /// <param name="oldSelectedIndicies">An array of the previously selected Rows</param>
        /// <param name="newSelectedIndicies">An array of the newly selected Rows</param>
        public SelectionEventArgs(TableModel source, int[] oldSelectedIndicies, int[] newSelectedIndicies)
            : base()
        {
            if (source == null)
            {
                throw new ArgumentNullException("source", "TableModel cannot be null");
            }

            this.source = source;
            this.oldSelectedIndicies = oldSelectedIndicies;
            this.newSelectedIndicies = newSelectedIndicies;

            this.oldSelectionBounds = Rectangle.Empty;
            this.newSelectionBounds = Rectangle.Empty;

            if (oldSelectedIndicies.Length > 0)
            {
                this.oldSelectionBounds = source.Selections.CalcSelectionBounds(oldSelectedIndicies[0],
                                                                                oldSelectedIndicies[oldSelectedIndicies.Length-1]);
            }

            if (newSelectedIndicies.Length > 0)
            {
                this.newSelectionBounds = source.Selections.CalcSelectionBounds(newSelectedIndicies[0],
                                                                                newSelectedIndicies[newSelectedIndicies.Length-1]);
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the SorterBase class with the specified 
 /// TableModel, Column index, IComparer and SortOrder
 /// </summary>
 /// <param name="tableModel">The TableModel that contains the data to be sorted</param>
 /// <param name="column">The index of the Column to be sorted</param>
 /// <param name="comparer">The IComparer used to sort the Column's Cells</param>
 /// <param name="sortOrder">Specifies how the Column is to be sorted</param>
 public SorterBase(TableModel tableModel, int column, IComparer comparer, SortOrder sortOrder)
 {
     this.tableModel = tableModel;
     this.column = column;
     this.comparer = comparer;
     this.sortOrder = sortOrder;
     this.secondarySortOrder = new SortColumnCollection();
     this.secondaryComparers = new IComparerCollection();
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the TableModelEventArgs class with 
 /// the specified TableModel source, start index, end index and affected Column
 /// </summary>
 /// <param name="source">The TableModel that originated the event</param>
 /// <param name="fromIndex">The start index of the affected Row(s)</param>
 /// <param name="toIndex">The end index of the affected Row(s)</param>
 public TableModelEventArgs(TableModel source, int fromIndex, int toIndex)
     : this(source, null, fromIndex, toIndex)
 {
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the TableModelEventArgs class with 
 /// the specified TableModel source, start index, end index and affected Column
 /// </summary>
 /// <param name="source">The TableModel that originated the event</param>
 public TableModelEventArgs(TableModel source)
     : this(source, null, -1, -1)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the TableModelEventArgs class with 
 /// the specified TableModel source, start index, end index and affected Column
 /// </summary>
 /// <param name="source">The TableModel that originated the event</param>
 /// <param name="row">The affected Row</param>
 /// <param name="fromIndex">The start index of the affected Row(s)</param>
 /// <param name="toIndex">The end index of the affected Row(s)</param>
 public TableModelEventArgs(TableModel source, Row row, int fromIndex, int toIndex)
 {
     this.source = source;
     this.row = row;
     this.fromIndex = fromIndex;
     this.toIndex = toIndex;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the CheckBoxComparer class with the specified 
 /// TableModel, Column index and SortOrder
 /// </summary>
 /// <param name="tableModel">The TableModel that contains the data to be sorted</param>
 /// <param name="column">The index of the Column to be sorted</param>
 /// <param name="sortOrder">Specifies how the Column is to be sorted</param>
 public CheckBoxComparer(TableModel tableModel, int column, SortOrder sortOrder)
     : base(tableModel, column, sortOrder)
 {
 }