Example #1
0
 /// <summary>
 /// Adds the specified number.
 /// </summary>
 /// <param name="num">The number.</param>
 /// <param name="seg">The seg.</param>
 public void Add(int num, SegmentsList seg)
 {
     if (this.Contains(num) == false)
     {
         this.Dictionary.Add(num, seg);
     }
     else
     {
         this[num] = seg;
     }
 }
Example #2
0
        /// <summary>
        /// Draw the segments in on state
        /// </summary>
        /// <param name="gr">The gr.</param>
        /// <param name="rc">The rc.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        protected virtual bool DrawValue(Graphics gr, RectangleF rc)
        {
            if (this.Display == null)
            {
                return(false);
            }

            if (this.valuesSegments.Contains(this.Display.Value) == false)
            {
                return(false);
            }

            SegmentsList list = this.valuesSegments[this.Display.Value];

            if (list == null)
            {
                return(false);
            }

            SolidBrush br = new SolidBrush(this.Display.ForeColor);

            foreach (char ch in list)
            {
                Segment seg = this.segments[ch];
                if (seg != null)
                {
                    GraphicsPath pth = new GraphicsPath();

                    for (int idx = 0; idx < seg.PointsIndexs.Length - 1; idx++)
                    {
                        PointF pt1 = this.points[seg.PointsIndexs[idx]];
                        PointF pt2 = this.points[seg.PointsIndexs[idx + 1]];
                        pth.AddLine(pt1, pt2);
                    }
                    pth.CloseFigure();

                    gr.FillPath(br, pth);

                    pth.Dispose();
                }
            }

            if (this.Display.ShowDP != false)
            {
                gr.FillEllipse(br, this.rectDP);
            }

            br.Dispose();

            return(true);
        }
Example #3
0
        /// <summary>
        /// Create the dictionary of the segments
        /// for the number values
        /// </summary>
        protected virtual void CreateSegmentsValuesList()
        {
            SegmentsList list = new SegmentsList();

            list.Add('A');
            list.Add('B');
            list.Add('C');
            list.Add('D');
            list.Add('E');
            list.Add('F');
            this.valuesSegments.Add(0, list);

            list = new SegmentsList();
            list.Add('B');
            list.Add('C');
            this.valuesSegments.Add(1, list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('B');
            list.Add('G');
            list.Add('E');
            list.Add('D');
            this.valuesSegments.Add(2, list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('B');
            list.Add('G');
            list.Add('C');
            list.Add('D');
            this.valuesSegments.Add(3, list);

            list = new SegmentsList();
            list.Add('F');
            list.Add('G');
            list.Add('B');
            list.Add('C');
            this.valuesSegments.Add(4, list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('F');
            list.Add('G');
            list.Add('C');
            list.Add('D');
            this.valuesSegments.Add(5, list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('F');
            list.Add('G');
            list.Add('C');
            list.Add('D');
            list.Add('E');
            this.valuesSegments.Add(6, list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('B');
            list.Add('C');
            this.valuesSegments.Add(7, list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('B');
            list.Add('C');
            list.Add('D');
            list.Add('E');
            list.Add('F');
            list.Add('G');
            this.valuesSegments.Add(8, list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('B');
            list.Add('C');
            list.Add('D');
            list.Add('F');
            list.Add('G');
            this.valuesSegments.Add(9, list);

            list = new SegmentsList();
            list.Add('G');
            this.valuesSegments.Add((int)'-', list);

            list = new SegmentsList();
            list.Add('A');
            list.Add('D');
            list.Add('E');
            list.Add('F');
            list.Add('G');
            this.valuesSegments.Add((int)'E', list);
        }