public UserManagerForm(ExtendedForm parentForm) : base(parentForm)
 {
     Load += frmUserManager_Load;
     InitializeComponent();
     StyleFunctions.SetGridStyle(UserGrid, GridTheme);
     Show();
 }
Esempio n. 2
0
 private void GridEnterCell(object sender, DataGridViewCellEventArgs e)
 {
     if (!gridFilling)
     {
         StyleFunctions.HighlightRow((DataGridView)sender, this.GridTheme, e.RowIndex);
     }
 }
 private void DataGridHistory_CellEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (!gridFilling)
     {
         StyleFunctions.HighlightRow(DataGridHistory, GridTheme, e.RowIndex);
     }
 }
Esempio n. 4
0
 private void ResultGrid_CellEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (!gridIsFilling)
     {
         StyleFunctions.HighlightRow(ResultGrid, GridTheme, e.RowIndex);
     }
 }
Esempio n. 5
0
 private void SibiResultGrid_CellEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (!gridFilling && this.Visible)
     {
         StyleFunctions.HighlightRow(SibiResultGrid, GridTheme, e.RowIndex);
     }
 }
Esempio n. 6
0
        /// <summary>
        /// Gets the color associated with the specified attribute code. Alpha blended with gray to make it more pastel.
        /// </summary>
        /// <param name="statusCode"></param>
        /// <returns></returns>
        private Color GetRowColor(string statusCode)
        {
            // Gray color.
            var blendColor  = Color.FromArgb(222, 222, 222);
            var attribColor = Attributes.SibiAttributes.StatusType[statusCode].Color;

            // Return the a blended color.
            return(StyleFunctions.ColorAlphaBlend(attribColor, blendColor));
        }
Esempio n. 7
0
 private void GetGridStyles()
 {
     //Set default styles for all grid forms.
     Colors.DefaultGridBackColor = ResultGrid.DefaultCellStyle.BackColor;
     ResultGrid.DefaultCellStyle.SelectionBackColor = Colors.OrangeSelectColor;
     this.GridTheme = new GridTheme(Colors.OrangeHighlightColor, Colors.OrangeSelectColor, Colors.OrangeSelectAltColor, ResultGrid.DefaultCellStyle.BackColor);
     StyleFunctions.DefaultGridStyles           = new DataGridViewCellStyle(ResultGrid.DefaultCellStyle);
     StyleFunctions.AlternatingRowDefaultStyles = new DataGridViewCellStyle(ResultGrid.AlternatingRowsDefaultCellStyle);
     StyleFunctions.SetGridStyle(ResultGrid, GridTheme);
 }
Esempio n. 8
0
        private DataGridView GetNewGrid(string name, string label, DoubleClickAction type)
        {
            DataGridView newGrid   = new DataGridView();
            var          gridLabel = label;

            newGrid.Name = name;
            newGrid.Dock = DockStyle.Fill;
            newGrid.RowHeadersVisible           = false;
            newGrid.EditMode                    = DataGridViewEditMode.EditProgrammatically;
            newGrid.AllowUserToResizeRows       = false;
            newGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            newGrid.AutoSizeColumnsMode         = DataGridViewAutoSizeColumnsMode.None;
            newGrid.AllowUserToAddRows          = false;
            newGrid.AllowUserToDeleteRows       = false;
            newGrid.Padding          = new Padding(0, 0, 0, 10);
            newGrid.ContextMenuStrip = PopUpMenu;
            StyleFunctions.SetGridStyle(newGrid, ParentForm.GridTheme);
            newGrid.CellLeave += GridLeaveCell;
            newGrid.CellEnter += GridEnterCell;

            // Set double-click event according to specified action.
            switch (type)
            {
            case DoubleClickAction.ViewDevice:
                gridLabel += " - [Double-Click to view]";
                newGrid.CellDoubleClick += DoubleClickDevice;
                break;

            case DoubleClickAction.SelectValue:
                newGrid.CellDoubleClick += DoubleClickSelect;
                break;

            case DoubleClickAction.ViewOnly:
                // Don't subscribe double-click event.
                break;
            }

            newGrid.Tag = gridLabel;
            newGrid.DoubleBuffered(true);
            return(newGrid);
        }
Esempio n. 9
0
 private void InitForm()
 {
     try
     {
         this.Icon = Properties.Resources.sibi_icon;
         SibiResultGrid.DoubleBuffered(true);
         this.GridTheme = new GridTheme(Colors.HighlightBlue, Colors.SibiSelectColor, Colors.SibiSelectAltColor, SibiResultGrid.DefaultCellStyle.BackColor);
         StyleFunctions.SetGridStyle(SibiResultGrid, this.GridTheme);
         ToolStrip1.BackColor = Colors.SibiToolBarColor;
         windowList.InsertWindowList(ToolStrip1);
         SetDisplayYears();
         ShowAll("All");
         GetMunisStatuses();
         this.Show();
         this.Activate();
     }
     catch (Exception ex)
     {
         ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
         this.Dispose();
     }
 }
Esempio n. 10
0
 private void SetTracking(bool isTrackable, bool isCheckedOut)
 {
     if (isTrackable)
     {
         if (!TabControl1.TabPages.Contains(TrackingTab))
         {
             TabControl1.TabPages.Insert(1, TrackingTab);
         }
         ExpandSplitter(true);
         TrackingBox.Visible       = true;
         TrackingToolStrip.Visible = isTrackable;
         CheckOutTool.Visible      = !isCheckedOut;
         CheckInTool.Visible       = isCheckedOut;
     }
     else
     {
         TrackingToolStrip.Visible = isTrackable;
         TabControl1.TabPages.Remove(TrackingTab);
         TrackingBox.Visible = false;
         ExpandSplitter();
     }
     StyleFunctions.SetGridStyle(DataGridHistory, GridTheme);
     StyleFunctions.SetGridStyle(TrackingGrid, GridTheme);
 }
Esempio n. 11
0
 private void GridLeaveCell(object sender, DataGridViewCellEventArgs e)
 {
     StyleFunctions.LeaveRow((DataGridView)sender, e.RowIndex);
 }
Esempio n. 12
0
 private void ResultGrid_CellLeave(object sender, DataGridViewCellEventArgs e)
 {
     StyleFunctions.LeaveRow(ResultGrid, e.RowIndex);
 }
Esempio n. 13
0
 private void DataGridHistory_CellLeave(object sender, DataGridViewCellEventArgs e)
 {
     StyleFunctions.LeaveRow(DataGridHistory, e.RowIndex);
 }
Esempio n. 14
0
 private void SibiResultGrid_CellLeave(object sender, DataGridViewCellEventArgs e)
 {
     StyleFunctions.LeaveRow(SibiResultGrid, e.RowIndex);
     SetStatusCellColors();
 }