Exemplo n.º 1
0
 protected override void RaiseCustomDrawCell(RowCellCustomDrawEventArgs e)
 {
     base.RaiseCustomDrawCell(e);
     if (e.Column != null && e.Column == buttonsColumnInternal && e.RowHandle == FocusedRowHandle)
     {
         e.DefaultDraw();
         DrawButtonsPanel(e);
     }
 }
Exemplo n.º 2
0
 void layoutView_CustomDrawCardFieldValue(object sender, RowCellCustomDrawEventArgs e)
 {
     if (e.Column.FieldName != colImage.FieldName)
     {
         return;
     }
     e.DefaultDraw();
     e.Cache.DrawRectangle(e.Cache.GetPen(layoutView.Appearance.FieldCaption.ForeColor, ScaleDPI.ScaleHLine(1)), e.Bounds);
     e.Handled = true;
 }
Exemplo n.º 3
0
 void lvEmployees_CustomDrawCardFieldValue(object sender, RowCellCustomDrawEventArgs e)
 {
     if (e.Column.FieldName != colPhoto.FieldName)
     {
         return;
     }
     e.DefaultDraw();
     e.Graphics.DrawRectangle(e.Cache.GetPen(lvEmployees.Appearance.FieldCaption.ForeColor), e.Bounds);
     e.Handled = true;
 }
Exemplo n.º 4
0
 void layoutView_CustomDrawCardFieldValue(object sender, RowCellCustomDrawEventArgs e) {
     if(e.Column.FieldName != colImage.FieldName) return;
     e.DefaultDraw();
     e.Graphics.DrawRectangle(e.Cache.GetPen(layoutView.Appearance.FieldCaption.ForeColor), e.Bounds);
     e.Handled = true;
 }
Exemplo n.º 5
0
        private void patternGridView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            int      smuIndex = 0;
            GridView view     = sender as GridView;

            if (e == null)
            {
                return;
            }
            if (e.Column == null)
            {
                return;
            }
            if (e.Column.FieldName == "No")
            {
                return;
            }

            LedProperty led = PatternRows[e.RowHandle].Leds[e.Column.AbsoluteIndex - 1];

            e.Appearance.Font = patternNoFont;
            e.Appearance.Options.UseTextOptions = true;
            e.Appearance.TextOptions.VAlignment = (mode == EPatternDispMode.String) ? VertAlignment.Center : VertAlignment.Top;

            switch (led.Type)
            {
            case ELedType.Disabled:
                e.Appearance.BackColor = Color.White;
                break;

            case ELedType.Enabled:
                if ((stringToSmus.Count > 0) && (stringToSmus.Count >= led.StringIndex))
                {
                    smuIndex = stringToSmus[led.StringIndex - 1];
                    if (smuIndex != -1)
                    {
                        e.Appearance.BackColor = Color.FromKnownColor(AppRes.Properties.SmuColors[smuIndex]);
                    }
                }
                break;

            case ELedType.Black:
                e.Appearance.BackColor = Color.Black;
                break;
            }

            e.Appearance.ForeColor = Color.Black;
            e.DefaultDraw();

            if (mode == EPatternDispMode.StringAndLamp)
            {
                switch (led.Type)
                {
                case ELedType.Enabled:
                    e.Cache.DrawRectangle(e.Bounds.X + (e.Bounds.Width / 2 - 9), e.Bounds.Y + 22, 8, 8, Color.Gray, 1);
                    e.Cache.FillRectangle((led.TurnOn == true) ? Color.Red : Color.DarkGray,
                                          new Rectangle((e.Bounds.X + e.Bounds.Width / 2 - 8), e.Bounds.Y + 23, 6, 6));

                    e.Cache.DrawRectangle(e.Bounds.X + (e.Bounds.Width / 2 + 2), e.Bounds.Y + 22, 8, 8, Color.Gray, 1);
                    e.Cache.FillRectangle((led.Measuring == true) ? Color.Lime : Color.DarkGray,
                                          new Rectangle(e.Bounds.X + (e.Bounds.Width / 2 + 3), e.Bounds.Y + 23, 6, 6));
                    break;

                case ELedType.Black:
                    e.Cache.DrawRectangle(e.Bounds.X + (e.Bounds.Width / 2 - 4),
                                          e.Bounds.Y + (e.Bounds.Height / 2 + 4), 8, 8, Color.Gray, 1);
                    e.Cache.FillRectangle((led.Measuring == true) ? Color.Lime : Color.DarkGray,
                                          new Rectangle(e.Bounds.X + (e.Bounds.Width / 2 - 3), e.Bounds.Y + (e.Bounds.Height / 2 + 5), 6, 6));
                    break;
                }
            }

            e.Handled = true;
        }