コード例 #1
0
 private void DrawHeaders(IDrawingGraphics gr)
 {
     foreach (var h in this.pivotItems)
     {
         gr.Style(this.HeaderStylePassive).DrawText(h.Title).MoveRelX(this.headerPadding);
     }
 }
コード例 #2
0
ファイル: PanoramaSection.cs プロジェクト: hksonngan/fleux
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(this.Style)
                .DrawText(this.title)
                .MoveTo(0, 0);

            base.Draw(drawingGraphics);
        }
コード例 #3
0
ファイル: DynamicElement.cs プロジェクト: cail/hobd
 public override void Draw(IDrawingGraphics g)
 {
     g.Style(this.Style);
     if (clickTimer != null){
     g.Bold(true);
     }
     g.DrawText(this.Text);
 }
コード例 #4
0
ファイル: PanoramaSection.cs プロジェクト: hksonngan/fleux
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(this.Style)
            .DrawText(this.title)
            .MoveTo(0, 0);

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

            base.Draw(drawingGraphics);
        }
コード例 #6
0
ファイル: DynamicElement.cs プロジェクト: leewoody/hobd
 public override void Draw(IDrawingGraphics g)
 {
     g.Style(this.Style);
     if (clickTimer != null)
     {
         g.Bold(true);
     }
     g.DrawText(this.Text);
 }
コード例 #7
0
ファイル: TextElement.cs プロジェクト: hksonngan/fleux
        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);
            }
        }
コード例 #8
0
ファイル: FontEdit.cs プロジェクト: SeregaPru/metrohome65
        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);
        }
コード例 #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);
        }
コード例 #10
0
ファイル: TextPage.cs プロジェクト: hksonngan/fleux
        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);
        }
コード例 #11
0
ファイル: TextElement.cs プロジェクト: SeregaPru/metrohome65
        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;
            }
        }
コード例 #12
0
ファイル: TextBox.cs プロジェクト: SeregaPru/metrohome65
        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);
        }
コード例 #13
0
ファイル: IconTextElement.cs プロジェクト: victorchalian/hobd
 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)
     */
 }
コード例 #14
0
ファイル: IconTextElement.cs プロジェクト: leewoody/hobd
        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)
             */
        }
コード例 #15
0
ファイル: PanoramaSection.cs プロジェクト: cail/fleux
        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);
        }
コード例 #16
0
ファイル: TextElement.cs プロジェクト: hksonngan/fleux
        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;
            }
        }
コード例 #17
0
ファイル: TextElement.cs プロジェクト: cail/fleux
 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;
         }
     }
 }
コード例 #18
0
ファイル: TextElement.cs プロジェクト: cail/fleux
        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;
            }
        }
コード例 #19
0
ファイル: CheckBox.cs プロジェクト: SeregaPru/metrohome65
        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;
            }
        }
コード例 #20
0
ファイル: Button.cs プロジェクト: SeregaPru/metrohome65
        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;
            }
        }
コード例 #21
0
ファイル: Pivot.cs プロジェクト: flts/fleux
 private void DrawHeaders(IDrawingGraphics gr)
 {
     foreach (var h in this.pivotItems)
     {
         gr.Style(this.HeaderStylePassive).DrawText(h.Title).MoveRelX(this.headerPadding);
     }
 }
コード例 #22
0
ファイル: Pivot.cs プロジェクト: SeregaPru/metrohome65
        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);
            }
        }