コード例 #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         textContainer = null;
     }
 }
コード例 #2
0
        /// <summary>
        /// Override the parent, calculate the label number, than draw
        /// </summary>
        /// <param name="graphics"></param>
        /// <param name="rm"></param>
        public override void Draw(Graphics graphics, RenderMode rm)
        {
            graphics.SmoothingMode      = SmoothingMode.HighQuality;
            graphics.InterpolationMode  = InterpolationMode.HighQualityBicubic;
            graphics.CompositingQuality = CompositingQuality.HighQuality;
            graphics.PixelOffsetMode    = PixelOffsetMode.None;
            graphics.TextRenderingHint  = TextRenderingHint.AntiAliasGridFit;
            string    text      = ((Surface)Parent).CountStepLabels(this).ToString();
            Rectangle rect      = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
            Color     fillColor = GetFieldValueAsColor(FieldType.FILL_COLOR);
            Color     lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);

            if (_drawAsRectangle)
            {
                RectangleContainer.DrawRectangle(rect, graphics, rm, 0, Color.Transparent, fillColor, false);
            }
            else
            {
                EllipseContainer.DrawEllipse(rect, graphics, rm, 0, Color.Transparent, fillColor, false);
            }
            using (FontFamily fam = new FontFamily(FontFamily.GenericSansSerif.Name))
            {
                using (Font _font = new Font(fam, fontSize, FontStyle.Bold, GraphicsUnit.Pixel))
                {
                    TextContainer.DrawText(graphics, rect, 0, lineColor, false, _stringFormat, text, _font);
                }
            }
        }
コード例 #3
0
ファイル: Surface.cs プロジェクト: SupremeGenius/espUrl
        public ITextContainer AddTextContainer(string text, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, FontFamily family, float size, bool italic, bool bold, bool shadow, int borderSize, Color color, Color fillColor)
        {
            TextContainer textContainer = new TextContainer(this);

            textContainer.Text = text;
            textContainer.SetFieldValue(FieldType.FONT_FAMILY, family.Name);
            textContainer.SetFieldValue(FieldType.FONT_BOLD, bold);
            textContainer.SetFieldValue(FieldType.FONT_ITALIC, italic);
            textContainer.SetFieldValue(FieldType.FONT_SIZE, size);
            textContainer.SetFieldValue(FieldType.FILL_COLOR, fillColor);
            textContainer.SetFieldValue(FieldType.LINE_COLOR, color);
            textContainer.SetFieldValue(FieldType.LINE_THICKNESS, borderSize);
            textContainer.SetFieldValue(FieldType.SHADOW, shadow);
            // Make sure the Text fits
            textContainer.FitToText();
            // Align to Surface
            textContainer.AlignToParent(horizontalAlignment, verticalAlignment);

            //AggregatedProperties.UpdateElement(textContainer);
            AddElement(textContainer);
            return(textContainer);
        }
コード例 #4
0
 public TextChangeMemento(TextContainer textContainer)
 {
     this.textContainer = textContainer;
     oldText = textContainer.Text;
 }
コード例 #5
0
        public ITextContainer AddTextContainer(string text, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, FontFamily family, float size, bool italic, bool bold, bool shadow, int borderSize, Color color, Color fillColor)
        {
            TextContainer textContainer = new TextContainer(this);
            textContainer.Text = text;
            textContainer.SetFieldValue(FieldType.FONT_FAMILY, family.Name);
            textContainer.SetFieldValue(FieldType.FONT_BOLD, bold);
            textContainer.SetFieldValue(FieldType.FONT_ITALIC, italic);
            textContainer.SetFieldValue(FieldType.FONT_SIZE, size);
            textContainer.SetFieldValue(FieldType.FILL_COLOR, fillColor);
            textContainer.SetFieldValue(FieldType.LINE_COLOR, color);
            textContainer.SetFieldValue(FieldType.LINE_THICKNESS, borderSize);
            textContainer.SetFieldValue(FieldType.SHADOW, shadow);
            // Make sure the Text fits
            textContainer.FitToText();
            // Align to Surface
            textContainer.AlignToParent(horizontalAlignment, verticalAlignment);

            //AggregatedProperties.UpdateElement(textContainer);
            AddElement(textContainer);
            return textContainer;
        }