Example #1
0
 private void DrawHeaders(IDrawingGraphics gr)
 {
     foreach (var h in this.pivotItems)
     {
         gr.Style(this.HeaderStylePassive).DrawText(h.Title).MoveRelX(this.headerPadding);
     }
 }
Example #2
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(this.Style)
                .DrawText(this.title)
                .MoveTo(0, 0);

            base.Draw(drawingGraphics);
        }
Example #3
0
 public override void Draw(IDrawingGraphics g)
 {
     g.Style(this.Style);
     if (clickTimer != null){
     g.Bold(true);
     }
     g.DrawText(this.Text);
 }
Example #4
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(this.Style)
            .DrawText(this.title)
            .MoveTo(0, 0);

            base.Draw(drawingGraphics);
        }
Example #5
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(MetroTheme.PhoneTextPanoramaSectionTitleStyle)
                .DrawText(this.title)
                .MoveTo(0, 0);

            base.Draw(drawingGraphics);
        }
Example #6
0
 public override void Draw(IDrawingGraphics g)
 {
     g.Style(this.Style);
     if (clickTimer != null)
     {
         g.Bold(true);
     }
     g.DrawText(this.Text);
 }
Example #7
0
        protected virtual void Relayout(IDrawingGraphics dg)
        {
            if (this.AutoSizeMode != AutoSizeModeOptions.None)
            {
                var height = 0;
                switch (this.AutoSizeMode)
                {
                case AutoSizeModeOptions.OneLineAutoHeight:
                    height = dg.Style(this.Style)
                             .CalculateTextSize(this.text ?? "").Height;
                    break;

                case AutoSizeModeOptions.WrapText:
                    height = dg.Style(this.Style)
                             .CalculateMultilineTextHeight(this.text ?? "", this.Size.Width);
                    break;
                }
                this.Size = new Size(this.Size.Width, height);
            }
        }
Example #8
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            // field border
            drawingGraphics.Color(MetroTheme.PhoneAccentBrush);
            drawingGraphics.FillRectangle(0, 0, Size.Width, Size.Height);

            // font example
            drawingGraphics.Style(new TextStyle(_textStyle.FontFamily, _textStyle.FontSize, _textStyle.Foreground));
            drawingGraphics.MoveRelX(4).DrawText(Caption());

            base.Draw(drawingGraphics);
        }
Example #9
0
        private void DrawTextSamples(IDrawingGraphics gr)
        {
            var text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";

            var textWidth = this.Content.Size.Width - 24;

            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawText(text).MoveTo(0, gr.Bottom + 10);
            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawMultiLineText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawMultiLineText(text, textWidth).MoveTo(0, gr.Bottom + 10);

            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawText(text).MoveTo(0, gr.Bottom + 10);
            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawMultiLineText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawMultiLineText(text, textWidth).MoveTo(0, gr.Bottom + 10);
        }
Example #10
0
        private void DrawTextSamples(IDrawingGraphics gr)
        {
            var text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";

            var textWidth = this.Content.Size.Width - 24;

            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawText(text).MoveTo(0, gr.Bottom + 10);
            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawMultiLineText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawMultiLineText(text, textWidth).MoveTo(0, gr.Bottom + 10);

            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawText(text).MoveTo(0, gr.Bottom + 10);
            gr.Style(MetroTheme.PhoneTextTitle3Style).DrawText("DrawMultiLineText()").MoveTo(0, gr.Bottom);
            gr.Style(MetroTheme.PhoneTextSmallStyle).DrawMultiLineText(text, textWidth).MoveTo(0, gr.Bottom + 10);
        }
Example #11
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(this.Style);

            switch (this.AutoSizeMode)
            {
                case AutoSizeModeOptions.None:
                case AutoSizeModeOptions.OneLineAutoHeight:
                    drawingGraphics.DrawText(this.text);
                    break;
                case AutoSizeModeOptions.WrapText:
                    drawingGraphics.DrawMultiLineText(this.text, this.Size.Width, this.Size.Height);
                    break;
            }
        }
Example #12
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Color(MetroTheme.PhoneTextBoxBrush);
            drawingGraphics.FillRectangle(0, 0, Size.Width, Size.Height);

            drawingGraphics.Color(MetroTheme.PhoneTextBoxBorderBrush);
            drawingGraphics.PenWidth(MetroTheme.PhoneBorderThickness.BorderThickness.Pixels);
            drawingGraphics.DrawRectangle(0, 0, Size.Width, Size.Height);

            drawingGraphics.Style(this.Style);

            if (MultiLine)
                drawingGraphics.DrawMultiLineText(this._text, this.Size.Width, this.Size.Height);
            else
                drawingGraphics.DrawText(this._text);
        }
Example #13
0
 public override void Draw(IDrawingGraphics g)
 {
     g.Style(this.Style);
     if (clickTimer != null){
     g.Bold(true);
     }
     g.DrawText(this.Text);
     /*
             g
             .DrawImage(icon, 10, 0, icon_width, icon_width)
             .PenWidth(3)
             .Style(HOBD.theme.PhoneTextNormalStyle)
             .MoveTo(icon_width + 10, 0)
             .DrawMultiLineText(alabel, g.Width - g.X)
             .MoveX(icon_width + 10)
             .Style(HOBD.theme.PhoneTextSmallStyle)
             .DrawText(value)
     */
 }
Example #14
0
        public override void Draw(IDrawingGraphics g)
        {
            g.Style(this.Style);
            if (clickTimer != null)
            {
                g.Bold(true);
            }
            g.DrawText(this.Text);

            /*
             *          g
             *          .DrawImage(icon, 10, 0, icon_width, icon_width)
             *          .PenWidth(3)
             *          .Style(HOBD.theme.PhoneTextNormalStyle)
             *          .MoveTo(icon_width + 10, 0)
             *          .DrawMultiLineText(alabel, g.Width - g.X)
             *          .MoveX(icon_width + 10)
             *          .Style(HOBD.theme.PhoneTextSmallStyle)
             *          .DrawText(value)
             */
        }
Example #15
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(this.Style);
            if(AdaptFontSize)
            {
                if(!FontSizeAdapted)
                {
                    Size targetSize;
                    NewFontSize = drawingGraphics.CalculateFontSizeForArea(this.title, new Size(this.Width, Body.Location.Y), out targetSize);
                    FontSizeAdapted = true;
                }
            } else {
                NewFontSize = Style.FontSize;
            }
            drawingGraphics
                .FontSize(NewFontSize)
                .DrawText(this.title)
                .MoveTo(0, 0);

            base.Draw(drawingGraphics);
        }
Example #16
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            if (this.needUpdate)
            {
                this.Relayout(drawingGraphics);
                this.needUpdate = false;
            }

            drawingGraphics.Style(this.Style);

            switch (this.AutoSizeMode)
            {
            case AutoSizeModeOptions.None:
            case AutoSizeModeOptions.OneLineAutoHeight:
                drawingGraphics.DrawText(this.text);
                break;

            case AutoSizeModeOptions.WrapText:
                drawingGraphics.DrawMultiLineText(this.text, this.Size.Width, this.Size.Height);
                break;
            }
        }
Example #17
0
 protected virtual void Relayout(IDrawingGraphics dg, string text)
 {
     TextSize = dg.Style(this.Style).CalculateTextSize(text);
     if (this.AutoSizeMode != AutoSizeModeOptions.None)
     {
         int height = 0;
         switch (this.AutoSizeMode)
         {
             case AutoSizeModeOptions.OneLineAutoHeight:
                 this.Size = new Size(TextSize.Width, TextSize.Height);
                 break;
             case AutoSizeModeOptions.OneLineAutoHeightFixedWidth:
                 height = TextSize.Height;
                 this.Size = new Size(this.Size.Width, height);
                 break;
             case AutoSizeModeOptions.WrapText:
                 height = dg.Style(this.Style)
                     .CalculateMultilineTextHeight(text, this.Size.Width);
                 this.Size = new Size(this.Size.Width, height);
                 break;
         }
     }
 }
Example #18
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            var ctext = text;

            if (this.needUpdate)
            {
                DoRelayout(drawingGraphics);
                this.needUpdate = false;
            }

            drawingGraphics.Style(this.Style);

            /* WTF????
            if (this.AutoSizeMode == AutoSizeModeOptions.None ||
                this.AutoSizeMode == AutoSizeModeOptions.OneLineAutoHeightFixedWidth)
            {
                while (TextSize.Width.ToPixels() > this.Width)
                {
                    ctext = ctext.Substring(0, ctext.Length-3)+"..";
                    Relayout(drawingGraphics, ctext);
                }
            }
            */

            switch (this.AutoSizeMode)
            {
                case AutoSizeModeOptions.None:
                case AutoSizeModeOptions.OneLineAutoHeightFixedWidth:
                case AutoSizeModeOptions.OneLineAutoHeight:
                    drawingGraphics.DrawText(ctext);
                    break;
                case AutoSizeModeOptions.WrapText:
                    drawingGraphics.DrawMultiLineText(ctext, this.Size.Width, this.Size.Height);
                    break;
            }
        }
Example #19
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            if (m_pressed)
            {
                drawingGraphics.Color(this.BorderColor);
                drawingGraphics.FillRectangle(0, 0, 40, 40);
            }
            else
            if (m_checked)
            {
                drawingGraphics.Color(this.BorderColor);
                drawingGraphics.PenWidth(2);
                drawingGraphics.DrawRectangle(0, 0, 40, 40);

                drawingGraphics.FillRectangle(5, 5, 35, 35);
            }
            else
            {
                // unchecked unpressed
                drawingGraphics.Color(this.BackgroundColor);
                drawingGraphics.FillRectangle(0, 0, 40, 40);

                drawingGraphics.Color(this.BorderColor);
                drawingGraphics.PenWidth(2);
                drawingGraphics.DrawRectangle(0, 0, 40, 40);
            }

            drawingGraphics.Style(this.Style);

            switch (this.AutoSizeMode)
            {
                case AutoSizeModeOptions.None:
                case AutoSizeModeOptions.OneLineAutoHeight:
                    drawingGraphics.MoveX(60).DrawText(m_text);
                    break;
                case AutoSizeModeOptions.WrapText:
                    drawingGraphics.MoveX(60).DrawMultiLineText(m_text, this.Size.Width, this.Size.Height);
                    break;
            }
        }
Example #20
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            if (m_pressed)
            {
                drawingGraphics.Color(BorderColor);
                drawingGraphics.FillRectangle(0, 0, this.Size.Width, this.Size.Height);

                drawingGraphics.Style(new TextStyle(Style.FontFamily, Style.FontSize, BackgroundColor));
            }
            else
            {
                drawingGraphics.Color(BackgroundColor);
                drawingGraphics.FillRectangle(0, 0, this.Size.Width, this.Size.Height);

                drawingGraphics.Color(this.BorderColor);
                drawingGraphics.PenWidth(3);
                drawingGraphics.DrawRectangle(0, 0, this.Size.Width, this.Size.Height);
                drawingGraphics.PenWidth(1);

                drawingGraphics.Style(this.Style);
            }

            switch (this.AutoSizeMode)
            {
                case AutoSizeModeOptions.None:
                case AutoSizeModeOptions.OneLineAutoHeight:
                    {
                        int width = drawingGraphics.CalculateTextWidth(m_text);
                        drawingGraphics.MoveX((this.Size.Width - width) / 2).DrawText(m_text);
                        break;
                    }
                case AutoSizeModeOptions.WrapText:
                    drawingGraphics.DrawMultiLineText(m_text, this.Size.Width, this.Size.Height);
                    break;
            }
        }
Example #21
0
File: Pivot.cs Project: flts/fleux
 private void DrawHeaders(IDrawingGraphics gr)
 {
     foreach (var h in this.pivotItems)
     {
         gr.Style(this.HeaderStylePassive).DrawText(h.Title).MoveRelX(this.headerPadding);
     }
 }
Example #22
0
        private void DrawHeaders(IDrawingGraphics gr)
        {
            var style = MetroTheme.PhoneTextPageTitle2Style;

            foreach (var h in this.pivotItems)
            {
                style.Foreground = MetroTheme.PhoneSubtleBrush;
                gr.Style(style).DrawText(h.Title).MoveRelX(this.headerPadding);
            }
        }