public void Paint(Graphics g, Rectangle rect)
        {
            if (rect.Width <= 0 || rect.Height <= 0)
            {
                return;
            }
            // paint background
            g.FillRectangle(SystemBrushes.Control, new Rectangle(DrawingPosition.X, rect.Top, DrawingPosition.Width - 1, rect.Height));
            g.DrawLine(SystemPens.ControlDark, DrawingPosition.Right - 1, rect.Top, DrawingPosition.Right - 1, rect.Bottom);

            // paint icons
            foreach (Bookmark mark in TextArea.Document.BookmarkManager.Marks)
            {
                int lineNumber = TextArea.Document.GetVisibleLine(mark.LineNumber);
                int lineHeight = TextArea._FontHeight;
                int yPos       = lineNumber * lineHeight - TextArea.VirtualTop.Y;
                if (IsLineInsideRegion(yPos, yPos + lineHeight, rect.Y, rect.Bottom))
                {
                    if (lineNumber == TextArea.Document.GetVisibleLine(mark.LineNumber - 1))
                    {
                        // marker is inside folded region, do not draw it
                        continue;
                    }
                    mark.Draw(this, g, new Point(0, yPos));
                }
            }

            Painted?.Invoke(this, g, rect);
        }
Пример #2
0
 public Gadget(float price)
 {
     _Price    = price;
     _Switches = new Switch();
     _Buttons  = new Buttons();
     _Lights   = new Lights();
     _painted  = new Painted();
 }
Пример #3
0
 public Widget2(float price)
 {
     _Price   = price;
     _Gears   = new Gears();
     _Springs = new Springs();
     _Levers  = new Levers();
     _painted = new Painted();
 }
Пример #4
0
 public Gadget(float price, Powered.Power power)
 {
     _Price              = price;
     _Switches           = new Switch();
     _Buttons            = new Buttons();
     _Lights             = new Lights();
     _painted            = new Painted();
     _power              = new Powered();
     _power.DefaultPower = power;
 }
Пример #5
0
 public Widget(float Price)
 {
     _Price   = Price;
     _painted = new Painted();
 }
Пример #6
0
 public virtual void Paint(Graphics g, Rectangle rect)
 {
     Painted?.Invoke(this, g, rect);
 }