public StiOutlookPanel()
        {
            BackColor  = StiColors.Content;
            upBitmap   = StiImageUtils.GetImage("Stimulsoft.Controls", "Stimulsoft.Controls.Bmp.Up.bmp");
            downBitmap = StiImageUtils.GetImage("Stimulsoft.Controls", "Stimulsoft.Controls.Bmp.Down.bmp");

            headerStartColor         = StiColors.ControlStart;
            headerEndColor           = StiColors.ControlEnd;
            selectedHeaderStartColor = StiColors.ActiveCaptionStart;
            selectedHeaderEndColor   = StiColors.ActiveCaptionEnd;

            this.DockPadding.Left      =
                this.DockPadding.Right = 2;

            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.Selectable, true);

            this.Height = 50;
            this.Text   = "outlookPanel";

            SetLayout();
        }
Esempio n. 2
0
        public StiNumericUpDownBase()
        {
            buttonUpBitmap   = StiImageUtils.GetImage("Stimulsoft.Controls", "Stimulsoft.Controls.Bmp.SpinUp.bmp");
            buttonDownBitmap = StiImageUtils.GetImage("Stimulsoft.Controls", "Stimulsoft.Controls.Bmp.SpinDown.bmp");

            timer.Tick += new EventHandler(Tick);
        }
Esempio n. 3
0
 static StiButtonEditBase()
 {
     try
     {
         dropDownButtonBitmap = StiImageUtils.GetImage("Stimulsoft.Controls", "Stimulsoft.Controls.Bmp.DropDown.png");
     }
     catch
     {
     }
 }
 static StiTreeViewBox()
 {
     dropdownBitmap = StiImageUtils.GetImage("Stimulsoft.Controls", "Stimulsoft.Controls.Bmp.ComboDown.bmp");
 }
 static StiToolButton()
 {
     dropDownArrowBitmap = StiImageUtils.GetImage("Stimulsoft.Controls", "Stimulsoft.Controls.Bmp.DropDownArrow.bmp");
 }
        protected override void OnPaint(PaintEventArgs p)
        {
            var g = p.Graphics;

            #region Content
            var contentRect = new Rectangle(0, HeaderHeight, Width, Height - HeaderHeight - PanelDistance);

            if (BackgroundImage == null)
            {
                using (var brush = new SolidBrush(BackColor))
                {
                    g.FillRectangle(brush, contentRect.Left, contentRect.Top, contentRect.Width + 1, contentRect.Height + 1);
                }
            }
            else
            {
                StiControlPaint.DrawImageBackground(p.Graphics, BackgroundImage, contentRect);
            }

            if (DrawBorder)
            {
                g.DrawRectangle(BorderPen, 0, 0, Width - 1, Height - PanelDistance);
            }
            #endregion

            #region Header
            var headerRect = GetHeaderRect();
            var image      = !Collapsed ? upBitmap : downBitmap;

            Color textColor = Color.Black;

            #region Fill rectangle
            headerRect.Width++;
            headerRect.Height++;
            if (HeaderBackgroundImage == null)
            {
                if (Selected)
                {
                    if (isMouseOver)
                    {
                        using (var brush = new LinearGradientBrush(headerRect,
                                                                   StiColorUtils.Light(SelectedHeaderStartColor, 20),
                                                                   StiColorUtils.Light(SelectedHeaderEndColor, 20), 90))
                            g.FillRectangle(brush, headerRect);
                    }
                    else
                    {
                        using (var brush = new LinearGradientBrush(headerRect,
                                                                   SelectedHeaderStartColor,
                                                                   SelectedHeaderEndColor, 90))
                            g.FillRectangle(brush, headerRect);
                    }
                    textColor = SystemColors.ActiveCaptionText;
                }
                else
                {
                    if (isMouseOver)
                    {
                        using (var brush = new LinearGradientBrush(headerRect,
                                                                   StiColorUtils.Light(HeaderStartColor, 20),
                                                                   StiColorUtils.Light(HeaderEndColor, 20), 90))
                            g.FillRectangle(brush, headerRect);
                    }
                    else
                    {
                        using (var brush = new LinearGradientBrush(headerRect, HeaderStartColor, HeaderEndColor, 90))
                            g.FillRectangle(brush, headerRect);
                    }
                }
            }
            else
            {
                StiControlPaint.DrawImageBackground(p.Graphics, HeaderBackgroundImage, headerRect);
            }
            headerRect.Width--;
            headerRect.Height--;
            #endregion

            #region Draw button image
            if (image != null)
            {
                var imageRect = new Rectangle(headerRect.Width - 18, (headerRect.Height - 16) / 2, 16, 16);

                if (textColor != Color.Black && image != null)
                {
                    image = StiImageUtils.ReplaceImageColor((Bitmap)image, textColor, Color.Black);
                }
                g.DrawImage(image, imageRect);
            }
            #endregion

            #region Draw image
            int imageWidth = 0;
            if (Image != null)
            {
                var imageRect = new Rectangle(headerRect.X + 4,
                                              (headerRect.Height - Image.Size.Height) / 2, Image.Size.Width, Image.Size.Height);

                imageWidth = imageRect.Width + 2;

                g.DrawImage(Image, imageRect);
            }
            #endregion

            #region Draw header text
            var textRect = new Rectangle(5 + imageWidth, 0, headerRect.Width - 25 - imageWidth, headerRect.Height);

            if (textRect.Width > 0)
            {
                using (var sf = new StringFormat())
                {
                    sf.LineAlignment = StringAlignment.Center;
                    if (RightToLeft == RightToLeft.Yes)
                    {
                        sf.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
                    }

                    sf.FormatFlags = StringFormatFlags.NoWrap;
                    sf.Trimming    = StringTrimming.EllipsisCharacter;

                    sf.HotkeyPrefix = HotkeyPrefix.Hide;

                    if (!TitleColor.IsEmpty)
                    {
                        textColor = TitleColor;
                    }
                    using (Brush brush = new SolidBrush(textColor))
                    {
                        g.DrawString(Text, TitleFont, brush, textRect, sf);
                    }
                }
            }
            #endregion

            if (DrawBorder)
            {
                g.DrawRectangle(BorderPen, headerRect);
            }
            #endregion
        }
 /// <summary>
 /// Returns bitmap of this attribute.
 /// </summary>
 /// <returns>Image.</returns>
 public Bitmap GetImage()
 {
     return(StiImageUtils.GetImage(type, bitmapName));
 }