Example #1
0
        public Message()
        {
            InitializeComponent();

            pFontSize = 10;
            pFont     = FontVault.GetFontVault().GetFont(FontVault.AvailableFonts.MyriadPro, pFontSize);
            pBoldFont = FontVault.GetFontVault().GetFont(FontVault.AvailableFonts.MyriadProBold, pFontSize);

            this.Paint  += new PaintEventHandler(Message_Paint);
            this.Resize += new EventHandler(Message_Resize);

            Diameter = 20.0f;
            Radius   = Diameter / 2.0f;

            GradientPen    = new Pen(Color.Black);
            GradientStart  = Color.FromArgb(252, 252, 252);
            GradientFinish = Color.FromArgb(223, 223, 223);
            GradientColors = Gradient.ComputeGradient(GradientStart, GradientFinish, this.Height);
            UpdateGradients();

            BorderColor = Color.FromArgb(152, 152, 152);
            BorderPen   = new Pen(BorderColor);

            pTextColor = Color.Black;
            TextBrush  = new SolidBrush(pTextColor);

            pHeight = 150;
            pWidth  = 450;

            TextLines     = null;
            TextSplitters = new string[1] {
                " "
            };
        }
Example #2
0
        public TextBox()
        {
            InitializeComponent();

            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.UpdateStyles();

            this.Paint            += new PaintEventHandler(TextBox_Paint);
            this.Resize           += new EventHandler(TextBox_Resize);
            this.GotFocus         += new EventHandler(TextBox_GotFocus);
            this.LostFocus        += new EventHandler(TextBox_LostFocus);
            TextField.GotFocus    += new EventHandler(TextField_GotFocus);
            TextField.LostFocus   += new EventHandler(TextField_LostFocus);
            TextField.TextChanged += new EventHandler(TextField_TextChanged);
            TextField.KeyPress    += new KeyPressEventHandler(TextField_KeyPress);

            pFontSize      = 10;
            pFont          = FontVault.GetFontVault().GetFont(FontVault.AvailableFonts.MyriadPro, pFontSize);
            TextField.Font = pFont;

            StartColor   = Color.FromArgb(200, 200, 200);
            FinishColor  = Color.FromArgb(170, 170, 170);
            BorderColors = Gradient.ComputeGradient(StartColor, FinishColor, GRADIENT_DISTANCE);

            BorderPen    = new Pen(Color.Black);
            ColorCounter = 0;

            this.BackColor = Color.White;
            bShowBorder    = true;
        }
        private void UpdateBG()
        {
            if (this.Height > 0)
            {
                m_bgImage = new Bitmap(this.Width, this.Height);
                Color[] caBgColors = Gradient.ComputeGradient(BackgroundGradientStart, BackgroundGradientFinish, this.Width);

                for (int c = 0; c < this.Width; c++)
                {
                    for (int r = 0; r < this.Height; r++)
                    {
                        m_bgImage.SetPixel(c, r, caBgColors[c]);
                    }
                }
            }
        }
Example #4
0
        public static void DrawDropShadow(System.Drawing.Graphics gCanvas, Rectangle rImageArea, Color cStartColor, Color cEndColor, int iShadowWidth)
        {
            Color[] acColors   = Gradient.ComputeGradient(cStartColor, cEndColor, iShadowWidth);
            Pen     pShadowPen = new Pen(Color.Black);

            rImageArea.Width  += ((iShadowWidth * 2) - 1);
            rImageArea.Height += ((iShadowWidth * 2) - 1);
            rImageArea.X      -= iShadowWidth;
            rImageArea.Y      -= iShadowWidth;

            for (int i = 0; i < iShadowWidth; i++)
            {
                pShadowPen.Color = acColors[i];
                gCanvas.DrawRectangle(pShadowPen, rImageArea);
                rImageArea.X++;
                rImageArea.Y++;
                rImageArea.Width  -= 2;
                rImageArea.Height -= 2;
            }
        }
 private void UpdateGradients()
 {
     NPGradientColors   = Gradient.ComputeGradient(NPGradientStart, NPGradientFinish, this.Height);
     PGradientColors    = Gradient.ComputeGradient(PGradientStart, PGradientFinish, this.Height);
     HoldGradientColors = Gradient.ComputeGradient(HoldGradientStart, HoldGradientFinish, this.Height);
 }
Example #6
0
 private void ComputeGradients()
 {
     GradientColors = Gradient.ComputeGradient(GradientStart, GradientFinish, this.Height);
 }
 private void UpdateGradients()
 {
     SelectedGradientColors = Gradient.ComputeGradient(SelectedGradientStart, SelectedGradientFinish, this.Height);
 }
Example #8
0
 private void UpdateGradients()
 {
     m_acGradientColors = Gradient.ComputeGradient(m_cGradientStart, m_cGradientFinish, this.Height);
 }
Example #9
0
 private void ComputeGradients()
 {
     UpperGradient = Gradient.ComputeGradient(UpperGradientStart, UpperGradientFinish, UPPER_GRADIENT_HEIGHT);
     LowerGradient = Gradient.ComputeGradient(LowerGradientStart, LowerGradientFinish, this.Height - UPPER_GRADIENT_HEIGHT);
 }
 private void UpdateGradients()
 {
     GradientColors = Gradient.ComputeGradient(GradientStart, GradientFinish, this.Width);
 }
 private void UpdateGradients()
 {
     GradientColors = Gradient.ComputeGradient(GradientStart, GradientFinish, (int)Diameter);
 }
Example #12
0
 private void UpdateGradients()
 {
     PressedColors    = Gradient.ComputeGradient(PGradientStart, PGradientFinish, this.Height);
     NotPressedColors = Gradient.ComputeGradient(NPGradientStart, NPGradientFinish, this.Height);
 }
Example #13
0
 private void UpdateGradients()
 {
     GradientColors = Gradient.ComputeGradient(GradientStart, GradientFinish, pTabHeight + (int)TabRadius + 1);
 }
Example #14
0
 private void UpdateGradients()
 {
     NPGradientColors = Gradient.ComputeGradient(NPGradientStart, NPGradientFinish, BOXDIM);
     PGradientColors  = Gradient.ComputeGradient(PGradientStart, PGradientFinish, BOXDIM);
 }
Example #15
0
 private void CalculateGradients()
 {
     m_acOnGradient  = Gradient.ComputeGradient(m_cOnStart, m_cOnFinish, this.Height);
     m_acOffGradient = Gradient.ComputeGradient(m_cOffStart, m_cOffFinish, this.Height);
 }