예제 #1
0
        public void SetVarValueText(
            int index, string titleTxt, float maxValue, string fontTxt, string backTxt, Font font,
            Color color, RectangleF?incRect, float lineHeight, DrawPositionType drawPosType, bool isLimitBox)
        {
            ScTxtInfo txtInfo;

            if (rowTextInfoList[index] != null)
            {
                txtInfo = rowTextInfoList[index];
            }
            else
            {
                txtInfo = new ScTxtInfo(this);
            }

            txtInfo.maxVarValue    = maxValue;
            txtInfo.fontTxt        = fontTxt;
            txtInfo.backTxt        = backTxt;
            txtInfo.txtColor       = color;
            txtInfo.txtFont        = font;
            txtInfo.lineHeight     = lineHeight;
            txtInfo.incRect        = incRect;
            txtInfo.drawPosType    = drawPosType;
            txtInfo.isLimitBox     = isLimitBox;
            txtInfo.titleTxt       = titleTxt;
            txtInfo.isMultipleRow  = false;
            rowTextInfoList[index] = txtInfo;
        }
예제 #2
0
파일: ScVxButton.cs 프로젝트: zanderzhg/Sc
        public void SetText(int index, string txt, Font font, Color color)
        {
            ScTxtInfo txtInfo;

            if (rowTextInfoList[index] != null)
            {
                txtInfo = rowTextInfoList[index];
            }
            else
            {
                txtInfo = new ScTxtInfo();
            }

            txtInfo.txt            = txt;
            txtInfo.txtColor       = color;
            txtInfo.txtFont        = font;
            rowTextInfoList[index] = txtInfo;
        }
예제 #3
0
        public void SetText(int index, string txt, Font font, Color color, RectangleF?incRect, float lineHeight)
        {
            ScTxtInfo txtInfo;

            if (rowTextInfoList[index] != null)
            {
                txtInfo = rowTextInfoList[index];
            }
            else
            {
                txtInfo = new ScTxtInfo();
            }

            txtInfo.txt            = txt;
            txtInfo.txtColor       = color;
            txtInfo.txtFont        = font;
            txtInfo.lineHeight     = lineHeight;
            txtInfo.incRect        = incRect;
            rowTextInfoList[index] = txtInfo;
        }
예제 #4
0
파일: ScVxButton.cs 프로젝트: zanderzhg/Sc
        public void SetVarValueText(int index, float maxValue, string fontTxt, string backTxt, Font font, Color color, RectangleF?incRect, float lineHeight)
        {
            ScTxtInfo txtInfo;

            if (rowTextInfoList[index] != null)
            {
                txtInfo = rowTextInfoList[index];
            }
            else
            {
                txtInfo = new ScTxtInfo(this);
            }

            txtInfo.maxVarValue    = maxValue;
            txtInfo.fontTxt        = fontTxt;
            txtInfo.backTxt        = backTxt;
            txtInfo.txtColor       = color;
            txtInfo.txtFont        = font;
            txtInfo.lineHeight     = lineHeight;
            txtInfo.incRect        = incRect;
            rowTextInfoList[index] = txtInfo;
        }
예제 #5
0
        public void SetText(int index, string titleTxt, string txt, Font font, Color color, RectangleF?incRect, float lineHeight, DrawPositionType drawPosType, bool isLimitBox, bool isMultipleRow)
        {
            ScTxtInfo txtInfo;

            if (rowTextInfoList[index] != null)
            {
                txtInfo = rowTextInfoList[index];
            }
            else
            {
                txtInfo = new ScTxtInfo();
            }

            txtInfo.txt            = txt;
            txtInfo.txtColor       = color;
            txtInfo.txtFont        = font;
            txtInfo.lineHeight     = lineHeight;
            txtInfo.incRect        = incRect;
            txtInfo.drawPosType    = drawPosType;
            txtInfo.isLimitBox     = isLimitBox;
            txtInfo.titleTxt       = titleTxt;
            txtInfo.isMultipleRow  = isMultipleRow;
            rowTextInfoList[index] = txtInfo;
        }
예제 #6
0
파일: ScVxButton.cs 프로젝트: zanderzhg/Sc
        private void BtnLayer_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode     = SmoothingMode.HighQuality;
            graphis.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            RectangleF rect  = new RectangleF(0, 0, btnLayer.Width, btnLayer.Height);
            Brush      brush = new SolidBrush(bgColor);

            graphis.FillRectangle(brush, rect);
            brush.Dispose();

            if (!IsUsedProgressAnim)
            {
                Brush      progressBrush = new SolidBrush(progressbarColor);
                float      progressWidth = progress * 0.01f * btnLayer.Width;
                RectangleF progressRect  = new RectangleF(0, 0, progressWidth, btnLayer.Height);
                graphis.FillRectangle(progressBrush, progressRect);
                progressBrush.Dispose();
            }
            else
            {
                Brush      progressBrush;
                float      progressWidth;
                RectangleF progressRect;

                if (animProgress < 100)
                {
                    progressBrush = new SolidBrush(Color.FromArgb(130, progressbarColor));
                    progressWidth = progress * 0.01f * btnLayer.Width;
                    progressRect  = new RectangleF(0, 0, progressWidth, btnLayer.Height);
                    graphis.FillRectangle(progressBrush, progressRect);
                }

                progressBrush = new SolidBrush(Color.FromArgb(255, progressbarColor));
                progressWidth = animProgress * 0.01f * btnLayer.Width;
                progressRect  = new RectangleF(0, 0, progressWidth, btnLayer.Height);
                graphis.FillRectangle(progressBrush, progressRect);
                progressBrush.Dispose();
            }

            //
            ScTxtInfo txtInfo = new ScTxtInfo();

            for (int i = 0; i < TxtRowCount; i++)
            {
                rect = txtTable.GetCellContentRect(i, 0);


                if (rowTextInfoList[i] != null)
                {
                    if (rowTextInfoList[i].txt != null)
                    {
                        txtInfo.txt = rowTextInfoList[i].txt;
                    }
                    else
                    {
                        txtInfo.txt = "";
                    }

                    if (rowTextInfoList[i].txtFont != null)
                    {
                        txtInfo.txtFont = rowTextInfoList[i].txtFont;
                    }
                    else
                    {
                        txtInfo.txtFont = txtFont;
                    }

                    if (rowTextInfoList[i].txtColor != null)
                    {
                        txtInfo.txtColor = rowTextInfoList[i].txtColor;
                    }
                    else
                    {
                        txtInfo.txtColor = txtColor;
                    }
                }
                else
                {
                    continue;
                }

                brush = new SolidBrush(txtInfo.txtColor);
                DrawUtils.LimitBoxDraw(graphis, txtInfo.txt, txtInfo.txtFont, brush, rect, false, true, 0);
                brush.Dispose();
            }


            if (isShowGow)
            {
                //
                //  rect = new RectangleF(btnLayer.Width - 30, btnLayer.Height - 30, 30, 30);
                // GraphicsPath path = CreateGouPath(rect);
                graphis.FillPath(Brushes.Green, gouPath);
                //path.Dispose();
            }


            if (isSelected)
            {
                rect = new RectangleF(0, 0, btnLayer.Width - 1, btnLayer.Height - 1);
                GraphicsPath path = DrawUtils.CreateRoundedRectanglePath(rect, 6);

                Pen pen = new Pen(Color.FromArgb(155, Color.Black));
                graphis.DrawPath(pen, path);
                graphis.DrawPath(pen, path);
            }
        }
예제 #7
0
파일: ScVxButton.cs 프로젝트: zanderzhg/Sc
 public void SetVarValueText(int index, ScTxtInfo txtInfo)
 {
     txtInfo.AnimScaleEvent += TxtInfo_AnimScaleEvent;
     rowTextInfoList[index]  = txtInfo;
 }
예제 #8
0
        private void ScVxButton_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode     = SmoothingMode.HighQuality;
            graphis.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            Brush      brush;
            RectangleF rect;

            //bg

            if (state == 1 && !isSelected)
            {
                float      h = (Height / 2 - growHeight / 2);
                float      y = Height - growHeight - h;
                RectangleF r = new RectangleF(0, y, Width, h * 2);

                GraphicsPath path = new GraphicsPath();
                path.AddArc(r, 180, 180);
                path.AddLine(r.Right, r.Y + h, r.Right, Height);
                path.AddLine(r.Right, Height, 0, Height);
                path.AddLine(0, Height, 0, r.Y + h);
                path.CloseFigure();


                rect = new RectangleF(0, 0, Width, Height);
                LinearGradientBrush linearBrush = new LinearGradientBrush(rect, Color.FromArgb(0, 185, 212, 227), Color.FromArgb(enterHaloAlpha, 185, 212, 227), LinearGradientMode.Vertical);
                graphis.FillPath(linearBrush, path);

                path.Dispose();
                linearBrush.Dispose();

                //brush = new SolidBrush(enterHaloColor);
                //rect = new RectangleF(0, 0, Width, Height);
                //graphis.FillRectangle(brush, rect);
                //brush.Dispose();
            }

            if (isSelected == true)
            {
                rect = new RectangleF(0, 0, Width, Height);


                brush = new SolidBrush(Color.FromArgb(255, enterHaloColor));

                Pen pen  = new Pen(Color.FromArgb(160, 200, 213, 219));
                Pen pen2 = new Pen(Color.FromArgb(255, 29, 29, 39));

                graphis.FillRectangle(brush, rect);

                PointF pt1 = new PointF(0, 0);
                PointF pt2 = new PointF(0, Height);
                graphis.DrawLine(pen2, pt1, pt2);

                pt1 = new PointF(Width - 1, 0);
                pt2 = new PointF(Width - 1, Height);
                graphis.DrawLine(pen, pt1, pt2);


                pt1 = new PointF(0, 0);
                pt2 = new PointF(Width - 1, 0);
                graphis.DrawLine(pen2, pt1, pt2);

                pt1 = new PointF(0, Height - 1);
                pt2 = new PointF(Width - 1, Height - 1);
                graphis.DrawLine(pen, pt1, pt2);

                brush.Dispose();
            }

            //img
            if (img != null)
            {
                RectangleF imgRect = contentTable.GetCellContentRect(0, 0);
                graphis.DrawImage(img, imgRect, imgDisplayArea, GraphicsUnit.Pixel);
            }

            //txt
            ScTxtInfo txtInfo = new ScTxtInfo();

            for (int i = 0; i < TxtRowCount; i++)
            {
                rect = txtTable.GetCellContentRect(i, 0);

                if (rowTextInfoList[i] != null)
                {
                    if (rowTextInfoList[i].txt != null)
                    {
                        txtInfo.txt = rowTextInfoList[i].txt;
                    }
                    else
                    {
                        txtInfo.txt = "";
                    }

                    if (rowTextInfoList[i].txtFont != null)
                    {
                        txtInfo.txtFont = rowTextInfoList[i].txtFont;
                    }
                    else
                    {
                        txtInfo.txtFont = txtFont;
                    }

                    if (rowTextInfoList[i].txtColor != null)
                    {
                        txtInfo.txtColor = rowTextInfoList[i].txtColor;
                    }
                    else
                    {
                        txtInfo.txtColor = txtColor;
                    }

                    txtInfo.incRect = rowTextInfoList[i].incRect;
                }
                else
                {
                    continue;
                }


                RectangleF tmp;

                if (txtInfo.incRect == null)
                {
                    tmp = rect;
                }
                else
                {
                    RectangleF incRect = txtInfo.incRect.Value;
                    tmp = new RectangleF(rect.X + incRect.X, rect.Y + incRect.Y, rect.Width + incRect.Width, rect.Height + incRect.Height);
                }

                brush = new SolidBrush(txtInfo.txtColor);
                //   graphis.FillRectangle(Brushes.Blue, rect);
                DrawUtils.LimitBoxDraw(graphis, txtInfo.txt, txtInfo.txtFont, brush, tmp, false, true, 0);
                brush.Dispose();
            }
        }
예제 #9
0
        private void ScVxTxtInfoPlane_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.TextRenderingHint = TextRenderingHint.AntiAlias;

            Brush      brush;
            RectangleF rect;
            RectangleF titleRect = new RectangleF();

            //txt
            ScTxtInfo txtInfo = new ScTxtInfo();

            for (int i = 0; i < TxtRowCount; i++)
            {
                if (isShowFieldTitle)
                {
                    if (!isHorLayout)
                    {
                        rect      = txtTable.GetCellContentRect(i, 1);
                        titleRect = txtTable.GetCellContentRect(i, 0);
                    }
                    else
                    {
                        rect      = txtTable.GetCellContentRect(1, i);
                        titleRect = txtTable.GetCellContentRect(0, i);
                    }
                }
                else
                {
                    if (!isHorLayout)
                    {
                        rect = txtTable.GetCellContentRect(i, 0);
                    }
                    else
                    {
                        rect = txtTable.GetCellContentRect(0, i);
                    }
                }

                if (rowTextInfoList[i] != null)
                {
                    if (rowTextInfoList[i].txt != null)
                    {
                        txtInfo.txt = rowTextInfoList[i].txt;
                    }
                    else
                    {
                        txtInfo.txt = "";
                    }

                    if (rowTextInfoList[i].txtFont != null)
                    {
                        txtInfo.txtFont = rowTextInfoList[i].txtFont;
                    }
                    else
                    {
                        txtInfo.txtFont = txtFont;
                    }

                    if (rowTextInfoList[i].txtColor != null)
                    {
                        txtInfo.txtColor = rowTextInfoList[i].txtColor;
                    }
                    else
                    {
                        txtInfo.txtColor = txtColor;
                    }

                    txtInfo.incRect       = rowTextInfoList[i].incRect;
                    txtInfo.drawPosType   = rowTextInfoList[i].drawPosType;
                    txtInfo.isLimitBox    = rowTextInfoList[i].isLimitBox;
                    txtInfo.titleTxt      = rowTextInfoList[i].titleTxt;
                    txtInfo.isMultipleRow = rowTextInfoList[i].isMultipleRow;
                }
                else
                {
                    continue;
                }


                RectangleF tmp;

                if (txtInfo.incRect == null)
                {
                    tmp = rect;
                }
                else
                {
                    RectangleF incRect = txtInfo.incRect.Value;
                    tmp = new RectangleF(rect.X + incRect.X, rect.Y + incRect.Y, rect.Width + incRect.Width, rect.Height + incRect.Height);
                }

                brush = new SolidBrush(txtInfo.txtColor);
                //  graphis.FillRectangle(Brushes.Blue, rect);
                DrawUtils.LimitBoxDraw(graphis, txtInfo.txt, txtInfo.txtFont, brush, tmp, txtInfo.drawPosType, txtInfo.isLimitBox, txtInfo.isMultipleRow, 0);
                DrawUtils.LimitBoxDraw(graphis, txtInfo.titleTxt, txtInfo.txtFont, brush, titleRect, txtInfo.drawPosType, true, false, 0);
                brush.Dispose();
            }
        }