private void GridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (e == null || e.Column == null) { return; } if (e.Column.FieldName == Schema.PRODUCT_ID) { return; } if (string.IsNullOrEmpty(e.DisplayText) == false) { string productID = (string)this.gridView1.GetRowCellValue(e.RowHandle, Schema.PRODUCT_ID); var color = GetBarColorByProductID(productID); e.Appearance.BackColor = color; e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; //Font Color : 보색으로 변경 if (this.IsUsedProdColor) { e.Appearance.ForeColor = ColorGenHelper.GetComplementaryColor(color); } } }
public BrushInfo GetBrushInfo(ToolBar bar, string patternOfProdID) { BrushInfo brushinfo = null; if (bar.State == EqpState.SETUP) { brushinfo = new BrushInfo(Color.Red); } else if (bar.State == EqpState.PM) { brushinfo = new BrushInfo(HatchStyle.Divot, Color.Black, Color.OrangeRed); } else if (bar.State == EqpState.DOWN) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Gray, Color.Black); } else if (bar.IsGhostBar) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.LightGray, Color.White); } else { var color = ColorGenHelper.GetColorByKey(bar.ToolID, ColorGenHelper.CATETORY_MASK); //ColorGen.GetColor(bar.ToolID); if (bar.State == EqpState.IDLERUN) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Black, color); } else { brushinfo = new BrushInfo(color); } } var selBar = this.SelectedBar; if (!this.EnableSelect || selBar == null) { bar.BackColor = brushinfo.BackColor; return(brushinfo); } if (!CompareToSelectedBar(bar, patternOfProdID)) { bar.BackColor = brushEmpth.BackColor; return(brushEmpth); } bar.BackColor = brushinfo.BackColor; return(brushinfo); }
public BrushInfo GetBrushInfo(GanttBar bar) { BrushInfo brushinfo = new BrushInfo(ColorGenHelper.GetColorByKey(bar.BarKey, ColorGenHelper.CATETORY_PRODUCT)); var selBar = this.SelectedBar; if (!this.EnableSelect || selBar == null) { bar.BackColor = brushinfo.BackColor; return(brushinfo); } if (!CompareToSelectedBar(bar)) { bar.BackColor = brushEmpth.BackColor; return(brushEmpth); } bar.BackColor = brushinfo.BackColor; return(brushinfo); }
private Color GetBarColorByProductID(string productID) { Color color = this.BackColor; if (string.IsNullOrEmpty(productID)) { return(color); } if (this.IsUsedProdColor) { Color prodColor; if (this.ProdColors.TryGetValue(productID, out prodColor)) { color = prodColor; } } else { color = ColorGenHelper.GetColorByKey(productID, ColorGenHelper.CATETORY_PRODUCT); } return(color); }