private void GUI_Check_List_Load(object sender, EventArgs e)
        {
            //useless corner tile
            checksGrid.Columns.Insert(0);
            checksGrid.Rows.Insert(0);

            //columns
            checksGrid.Columns.Insert(0);
            checksGrid.Columns.Insert(0);
            checksGrid.Columns.Insert(0);

            //add rows
            foreach (Check c in _getChecks())
            {
                checksGrid.Rows.Insert(0);
                SourceGrid.Cells.Views.Cell rowView = new SourceGrid.Cells.Views.Cell();
                SourceGrid.Cells.Views.CheckBox checkView = new SourceGrid.Cells.Views.CheckBox();

                System.Drawing.Color cellColour;
                if (c.IsTriggered())
                {
                    cellColour = System.Drawing.Color.Red;
                }
                else if (c.HasError())
                {
                    cellColour = System.Drawing.Color.Yellow;
                }
                else if (c.IsPaused())
                {
                    cellColour = System.Drawing.Color.LightBlue;
                }
                else
                {
                    cellColour = System.Drawing.Color.White;
                }

                rowView.BackColor = cellColour;
                checkView.BackColor = cellColour;

                checksGrid[1, 0] = new SourceGrid.Cells.RowHeader(c.GetIndex());
                checksGrid[1, 1] = new SourceGrid.Cells.Cell(c.GetCheckType());
                checksGrid[1, 1].View = rowView;
                checksGrid[1, 2] = new SourceGrid.Cells.Cell(c.GetLocation());
                checksGrid[1, 2].View = rowView;
                SourceGrid.Cells.CheckBox pauseBox = new SourceGrid.Cells.CheckBox();
                pauseBox.Checked = c.IsPaused();

                checksGrid[1, 3] = pauseBox;
                checksGrid[1, 3].View = checkView;

            }

            //add column headers
            checksGrid[0, 1] = new SourceGrid.Cells.ColumnHeader("Name");
            checksGrid[0, 2] = new SourceGrid.Cells.ColumnHeader("Location");
            checksGrid[0, 3] = new SourceGrid.Cells.ColumnHeader("Paused");

            checksGrid.AutoSizeCells();
        }
Beispiel #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            grid1.BorderStyle = BorderStyle.FixedSingle;

            grid1.ColumnsCount = 3;
            grid1.FixedRows = 1;
            grid1.Rows.Insert(0);

            DevAge.Drawing.RectangleBorder border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(Color.DarkGreen), new DevAge.Drawing.BorderLine(Color.DarkGreen));

            DevAge.Drawing.VisualElements.ColumnHeader flatHeader = new DevAge.Drawing.VisualElements.ColumnHeader();
            flatHeader.Border = border;
            flatHeader.BackColor = Color.ForestGreen;
            flatHeader.BackgroundColorStyle = DevAge.Drawing.BackgroundColorStyle.Solid;
            SourceGrid.Cells.Views.ColumnHeader headerView = new SourceGrid.Cells.Views.ColumnHeader();
            headerView.Font = new Font(grid1.Font, FontStyle.Bold | FontStyle.Underline);
            headerView.Background = flatHeader;
            headerView.ForeColor = Color.White;

            SourceGrid.Cells.Views.Cell cellView = new SourceGrid.Cells.Views.Cell();
            cellView.Background = new DevAge.Drawing.VisualElements.BackgroundLinearGradient(Color.ForestGreen, Color.White, 45);
            cellView.Border = border;
            SourceGrid.Cells.Views.CheckBox checkView = new SourceGrid.Cells.Views.CheckBox();
            checkView.Background = new DevAge.Drawing.VisualElements.BackgroundLinearGradient(Color.ForestGreen, Color.White, 45);
            checkView.Border = border;


            grid1[0, 0] = new SourceGrid.Cells.ColumnHeader("String");
            grid1[0, 0].View = headerView;
            
            grid1[0, 1] = new SourceGrid.Cells.ColumnHeader("DateTime");
            grid1[0, 1].View = headerView;

            grid1[0, 2] = new SourceGrid.Cells.ColumnHeader("CheckBox");
            grid1[0, 2].View = headerView;
            for (int r = 1; r < 10; r++)
            {
                grid1.Rows.Insert(r);

                grid1[r, 0] = new SourceGrid.Cells.Cell("Hello " + r.ToString(), typeof(string));
                grid1[r, 0].View = cellView;

                grid1[r, 1] = new SourceGrid.Cells.Cell(DateTime.Today, typeof(DateTime));
                grid1[r, 1].View = cellView;

                grid1[r, 2] = new SourceGrid.Cells.CheckBox(null, true);
                grid1[r, 2].View = checkView;
            }

            grid1.AutoSizeCells();
        }
Beispiel #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            grid1.BorderStyle = BorderStyle.FixedSingle;

            grid1.ColumnsCount = 3;
            grid1.FixedRows    = 1;
            grid1.Rows.Insert(0);

            DevAge.Drawing.RectangleBorder border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(Color.DarkGreen), new DevAge.Drawing.BorderLine(Color.DarkGreen));

            DevAge.Drawing.VisualElements.ColumnHeader flatHeader = new DevAge.Drawing.VisualElements.ColumnHeader();
            flatHeader.Border               = border;
            flatHeader.BackColor            = Color.ForestGreen;
            flatHeader.BackgroundColorStyle = DevAge.Drawing.BackgroundColorStyle.Solid;
            SourceGrid.Cells.Views.ColumnHeader headerView = new SourceGrid.Cells.Views.ColumnHeader();
            headerView.Font       = new Font(grid1.Font, FontStyle.Bold | FontStyle.Underline);
            headerView.Background = flatHeader;
            headerView.ForeColor  = Color.White;

            SourceGrid.Cells.Views.Cell cellView = new SourceGrid.Cells.Views.Cell();
            cellView.Background = new DevAge.Drawing.VisualElements.BackgroundLinearGradient(Color.ForestGreen, Color.White, 45);
            cellView.Border     = border;
            SourceGrid.Cells.Views.CheckBox checkView = new SourceGrid.Cells.Views.CheckBox();
            checkView.Background = new DevAge.Drawing.VisualElements.BackgroundLinearGradient(Color.ForestGreen, Color.White, 45);
            checkView.Border     = border;


            grid1[0, 0]      = new SourceGrid.Cells.ColumnHeader("String");
            grid1[0, 0].View = headerView;

            grid1[0, 1]      = new SourceGrid.Cells.ColumnHeader("DateTime");
            grid1[0, 1].View = headerView;

            grid1[0, 2]      = new SourceGrid.Cells.ColumnHeader("CheckBox");
            grid1[0, 2].View = headerView;
            for (int r = 1; r < 10; r++)
            {
                grid1.Rows.Insert(r);

                grid1[r, 0]      = new SourceGrid.Cells.Cell("Hello " + r.ToString(), typeof(string));
                grid1[r, 0].View = cellView;

                grid1[r, 1]      = new SourceGrid.Cells.Cell(DateTime.Today, typeof(DateTime));
                grid1[r, 1].View = cellView;

                grid1[r, 2]      = new SourceGrid.Cells.CheckBox(null, true);
                grid1[r, 2].View = checkView;
            }

            grid1.AutoSizeCells();
        }
Beispiel #4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            grid1.BorderStyle = BorderStyle.FixedSingle;

            grid1.ColumnsCount = 3;
            grid1.FixedRows    = 1;
            grid1.Rows.Insert(0);

            SourceGrid.Cells.Views.ColumnHeader boldHeader = new SourceGrid.Cells.Views.ColumnHeader();
            boldHeader.Font = new Font(grid1.Font, FontStyle.Bold | FontStyle.Underline);

            SourceGrid.Cells.Views.Cell yellowView = new SourceGrid.Cells.Views.Cell();
            yellowView.BackColor = Color.Yellow;
            SourceGrid.Cells.Views.CheckBox yellowViewCheck = new SourceGrid.Cells.Views.CheckBox();
            yellowViewCheck.BackColor = Color.Yellow;


            grid1[0, 0]      = new SourceGrid.Cells.ColumnHeader("String");
            grid1[0, 0].View = boldHeader;

            grid1[0, 1]      = new SourceGrid.Cells.ColumnHeader("DateTime");
            grid1[0, 1].View = boldHeader;

            grid1[0, 2]      = new SourceGrid.Cells.ColumnHeader("CheckBox");
            grid1[0, 2].View = boldHeader;
            for (int r = 1; r < 10; r++)
            {
                grid1.Rows.Insert(r);

                grid1[r, 0]      = new SourceGrid.Cells.Cell("Hello " + r.ToString(), typeof(string));
                grid1[r, 0].View = yellowView;

                grid1[r, 1]      = new SourceGrid.Cells.Cell(DateTime.Today, typeof(DateTime));
                grid1[r, 1].View = yellowView;

                grid1[r, 2]      = new SourceGrid.Cells.CheckBox(null, true);
                grid1[r, 2].View = yellowViewCheck;
            }

            grid1.AutoSizeCells();
        }
Beispiel #5
0
        private void initView()
        {
            DevAge.Drawing.RectangleBorder border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(Color.DarkGreen), new DevAge.Drawing.BorderLine(Color.DarkGreen));

            DevAge.Drawing.VisualElements.ColumnHeader flatHeader = new DevAge.Drawing.VisualElements.ColumnHeader();
            flatHeader.Border               = border;
            flatHeader.BackColor            = Color.LightBlue;
            flatHeader.BackgroundColorStyle = DevAge.Drawing.BackgroundColorStyle.Solid;
            headerView.Font          = new Font(grid_addr.Font, FontStyle.Bold);
            headerView.Background    = flatHeader;
            headerView.ForeColor     = Color.Black;
            headerView.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;


            cellView.Background = new DevAge.Drawing.VisualElements.BackgroundLinearGradient(Color.White, Color.White, 500);
            cellView.Border     = border;

            checkView            = new SourceGrid.Cells.Views.CheckBox();
            checkView.Background = new DevAge.Drawing.VisualElements.BackgroundLinearGradient(Color.White, Color.White, 45);
            checkView.Border     = border;
        }
Beispiel #6
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //Border
            DevAge.Drawing.Border          border     = new DevAge.Drawing.Border(Color.DarkKhaki, 1);
            DevAge.Drawing.RectangleBorder cellBorder = new DevAge.Drawing.RectangleBorder(border, border);

            //Views Odd
            SourceGrid.Cells.Views.Cell viewOddNormal = new SourceGrid.Cells.Views.Cell();
            viewOddNormal.BackColor = Color.Khaki;
            viewOddNormal.Border    = cellBorder;
            SourceGrid.Cells.Views.CheckBox viewOddCheckBox = new SourceGrid.Cells.Views.CheckBox();
            viewOddCheckBox.BackColor = Color.Khaki;
            viewOddCheckBox.Border    = cellBorder;

            //Views Even
            SourceGrid.Cells.Views.Cell viewEvenNormal = new SourceGrid.Cells.Views.Cell(viewOddNormal);
            viewEvenNormal.BackColor = Color.DarkKhaki;
            SourceGrid.Cells.Views.CheckBox viewEvenCheckBox = new SourceGrid.Cells.Views.CheckBox(viewOddCheckBox);
            viewEvenCheckBox.BackColor = Color.DarkKhaki;

            //ColumnHeader view
            SourceGrid.Cells.Views.ColumnHeader viewColumnHeader = new SourceGrid.Cells.Views.ColumnHeader();
            viewColumnHeader.ForeColor = Color.White;
            viewColumnHeader.Font      = new Font("Comic Sans MS", 10, FontStyle.Underline);

            DevAge.Drawing.VisualElements.ColumnHeader backgroundColHeader = new DevAge.Drawing.VisualElements.ColumnHeader();
            backgroundColHeader.BackColor = Color.Maroon;
            viewColumnHeader.Background   = backgroundColHeader;

            //Editors
            SourceGrid.Cells.Editors.TextBox             editorString   = new SourceGrid.Cells.Editors.TextBox(typeof(string));
            SourceGrid.Cells.Editors.TextBoxUITypeEditor editorDateTime = new SourceGrid.Cells.Editors.TextBoxUITypeEditor(typeof(DateTime));


            //Create the grid
            grid1.BorderStyle = BorderStyle.FixedSingle;

            grid1.ColumnsCount = 3;
            grid1.FixedRows    = 1;
            grid1.Rows.Insert(0);

            SourceGrid.Cells.ColumnHeader columnHeader;

            columnHeader      = new SourceGrid.Cells.ColumnHeader("String");
            columnHeader.View = viewColumnHeader;
            columnHeader.AutomaticSortEnabled = false;
            grid1[0, 0] = columnHeader;

            columnHeader      = new SourceGrid.Cells.ColumnHeader("DateTime");
            columnHeader.View = viewColumnHeader;
            columnHeader.AutomaticSortEnabled = false;
            grid1[0, 1] = columnHeader;

            columnHeader      = new SourceGrid.Cells.ColumnHeader("CheckBox");
            columnHeader.View = viewColumnHeader;
            columnHeader.AutomaticSortEnabled = false;
            grid1[0, 2] = columnHeader;

            for (int r = 1; r < 10; r++)
            {
                grid1.Rows.Insert(r);

                grid1[r, 0]        = new SourceGrid.Cells.Cell("Hello " + r.ToString());
                grid1[r, 0].Editor = editorString;

                grid1[r, 1]        = new SourceGrid.Cells.Cell(DateTime.Today);
                grid1[r, 1].Editor = editorDateTime;

                grid1[r, 2] = new SourceGrid.Cells.CheckBox(null, true);

                if (Math.IEEERemainder(r, 2) == 0)
                {
                    grid1[r, 0].View = viewOddNormal;
                    grid1[r, 1].View = viewOddNormal;
                    grid1[r, 2].View = viewOddCheckBox;
                }
                else
                {
                    grid1[r, 0].View = viewEvenNormal;
                    grid1[r, 1].View = viewEvenNormal;
                    grid1[r, 2].View = viewEvenCheckBox;
                }
            }

            grid1.AutoSizeCells();
        }