Esempio n. 1
0
        public Rectangle DrawGripper(Graphics g, Rectangle rect, CustomAppointment appointment, bool isSelected, int gripWidth, int hourLines, int halfHourHeight)
        {
            DrawEventArgs e = new DrawEventArgs(g, rect, appointment, isSelected, gripWidth);

            if (base.OnResolveDrawGripper(e))
            {
                return(rect);
            }
            Rectangle rc = CalculateGripRect(rect, appointment, hourLines, halfHourHeight);

            rc.Width = gripWidth + 1;
            if (base.m_useGradient)
            {
                if (appointment.GradientBackColor == null)
                {
                    new GradientColor(GradientFill.GetColorLighter(appointment.BorderColor), GradientFill.GetColorDarker(appointment.BorderColor), FillDirection.Vertical).DrawGradient(g, rc);
                    return(rc);
                }
                appointment.GradientBackColor.DrawGradient(g, rc);
                return(rc);
            }
            using (SolidBrush brush = new SolidBrush(appointment.BorderColor))
            {
                g.FillRectangle(brush, rc);
            }
            return(rc);
        }
Esempio n. 2
0
 public void DrawVistaGradient(Graphics gr, Rectangle rc)
 {
     GradientFill.DrawVistaGradient(gr, this.StartColor, rc, this.FillDirection);
 }
Esempio n. 3
0
 public void DrawGradient(Graphics gr, Rectangle rc)
 {
     GradientFill.Fill(gr, rc, this.StartColor, Color.Transparent, Color.Transparent, this.EndColor, this.FillDirection);
 }
Esempio n. 4
0
        internal Rectangle Draw(Graphics gr, Rectangle rect, Pen frame)
        {
            this.CreateGdiObjects();
            int       x          = rect.X;
            int       y          = rect.Y;
            Rectangle rectangle2 = rect;

            if (this.m_groupStyle == Resco.Controls.OutlookControls.GroupStyle.Links)
            {
                y += rect.Height - (this.CalculateHeight() + 1);
                rectangle2.Height = y - rect.Y;
                if (this.m_border)
                {
                    gr.DrawLine(frame, rect.X, y, rect.X + rect.Width, y);
                }
                y++;
            }
            int num3 = 0;

            foreach (Group group in base.List)
            {
                Rectangle rectangle;
                string    str;
                if (!group.Visible)
                {
                    continue;
                }
                switch (this.m_groupStyle)
                {
                case Resco.Controls.OutlookControls.GroupStyle.Buttons:
                    x = rect.X;
                    if (!this.m_ImageOnly)
                    {
                        break;
                    }
                    if (((this.m_ImageList != null) && (group.ImageIndex >= 0)) && (group.ImageIndex < this.m_ImageList.Images.Count))
                    {
                        using (Image image = this.m_ImageList.Images[group.ImageIndex])
                        {
                            Rectangle dest = new Rectangle(x, y, rect.Width, this.Height);
                            Rectangle src  = new Rectangle(0, 0, image.Width, image.Height);
                            this.DrawImage(gr, image, dest, src, group.m_ia, group.AutoTransparent);
                        }
                        x += rect.Width;
                    }
                    goto Label_0440;

                case Resco.Controls.OutlookControls.GroupStyle.Links:
                    if (!this.m_ImageOnly)
                    {
                        goto Label_05F9;
                    }
                    if (this.m_ImageList != null)
                    {
                        if ((group.ImageIndex >= 0) && (group.ImageIndex < this.m_ImageList.Images.Count))
                        {
                            using (Image image3 = this.m_ImageList.Images[group.ImageIndex])
                            {
                                Rectangle rectangle7 = new Rectangle(x, y, (int)(image3.Width * m_userScaleFactor.Width), this.Height);
                                Rectangle rectangle8 = new Rectangle(0, 0, image3.Width, image3.Height);
                                this.DrawImage(gr, image3, rectangle7, rectangle8, group.m_ia, group.AutoTransparent);
                            }
                        }
                        x += (int)(this.m_ImageList.ImageSize.Width * m_userScaleFactor.Width);
                        int num6 = x + ((int)(this.m_ImageList.ImageSize.Width * m_userScaleFactor.Width));
                        if (num6 > rect.Width)
                        {
                            y += this.Height;
                            x  = rect.X;
                        }
                    }
                    goto Label_08B7;

                default:
                    goto Label_08B7;
                }
                if (this.IndexOf(group) == this.m_selectedIndex)
                {
                    rectangle = new Rectangle(x, y, rect.Width, this.Height);
                    if (!this.m_UseVistaStyle)
                    {
                        gr.FillRectangle(this.m_brushSelGroupsBack, rectangle);
                    }
                    else
                    {
                        GradientFill.DrawVistaGradient(gr, this.SelBackColor, rectangle, FillDirection.Vertical);
                    }
                }
                else if (this.m_UseVistaStyle)
                {
                    rectangle = new Rectangle(x, y, rect.Width, this.Height);
                    GradientFill.DrawVistaGradient(gr, this.BackColor, rectangle, FillDirection.Vertical);
                }
                if (((this.m_ImageList != null) && (group.ImageIndex >= 0)) && (group.ImageIndex < this.m_ImageList.Images.Count))
                {
                    using (Image image2 = this.m_ImageList.Images[group.ImageIndex])
                    {
                        Rectangle rectangle5;
                        Rectangle rectangle6;
                        if (this.m_bAutoScaleEnabled)
                        {
                            rectangle5 = new Rectangle(x + ((int)(5f * m_scaleFactor.Width)), y, (int)(image2.Width * m_userScaleFactor.Width), this.Height);
                            rectangle6 = new Rectangle(0, (int)((((image2.Height * m_userScaleFactor.Height) - this.Height) / 2f) / m_userScaleFactor.Height), image2.Width, (int)(((float)this.Height) / m_userScaleFactor.Height));
                        }
                        else
                        {
                            int num4 = y + ((this.Height - image2.Height) / 2);
                            rectangle5 = new Rectangle(x + ((int)(5f * m_scaleFactor.Width)), num4, image2.Width, image2.Height);
                            rectangle6 = new Rectangle(0, 0, image2.Width, image2.Height);
                        }
                        this.DrawImage(gr, image2, rectangle5, rectangle6, group.m_ia, group.AutoTransparent);
                        x += 2 + rectangle5.Width;
                    }
                }
                Size size = gr.MeasureString(group.Text, this.Font).ToSize();
                if (this.IndexOf(group) == this.m_selectedIndex)
                {
                    rectangle = new Rectangle(x + ((int)(7f * m_scaleFactor.Width)), y + ((this.Height - size.Height) / 2), rect.Width, this.Height);
                    gr.DrawString(group.Text, this.Font, this.m_brushSelGroupsFore, rectangle);
                }
                else
                {
                    rectangle = new Rectangle(x + ((int)(7f * m_scaleFactor.Width)), y + ((this.Height - size.Height) / 2), rect.Width, this.Height);
                    gr.DrawString(group.Text, this.Font, this.m_brushGroupsFore, rectangle);
                }
Label_0440:
                if (this.m_border)
                {
                    gr.DrawRectangle(frame, rect.X, y, rect.Width - 1, this.Height);
                }
                y += this.Height;
                if (this.IndexOf(group) == this.m_selectedIndex)
                {
                    int num5 = ((rect.Height - y) + rect.Top) - (((this.VisibleCount() - num3) - 1) * this.Height);
                    rectangle2.Y      = y;
                    rectangle2.Height = (num5 < 0) ? 0 : num5;
                    y += (num5 < 0) ? 0 : num5;
                }
                goto Label_08B7;
Label_05F9:
                str  = group.Text + ((base.List.IndexOf(group) == (base.List.Count - 1)) ? "" : " ");
                size = gr.MeasureString(str, this.Font).ToSize();
                int num7 = (int)((((5f * m_scaleFactor.Width) + (2f * m_scaleFactor.Width)) + size.Width) + ((((this.m_ImageList != null) && (group.ImageIndex >= 0)) && (group.ImageIndex < this.m_ImageList.Images.Count)) ? (this.m_ImageList.ImageSize.Width * m_userScaleFactor.Width) : 0f));
                int num8 = x + num7;
                if (num8 > rect.Width)
                {
                    y += this.Height;
                    x  = rect.X;
                }
                if (((this.m_ImageList != null) && (group.ImageIndex >= 0)) && (group.ImageIndex < this.m_ImageList.Images.Count))
                {
                    using (Image image4 = this.m_ImageList.Images[group.ImageIndex])
                    {
                        Rectangle rectangle9  = new Rectangle(x + ((int)(5f * m_scaleFactor.Width)), y, (int)(image4.Width * m_userScaleFactor.Width), (int)(image4.Height * m_userScaleFactor.Height));
                        Rectangle rectangle10 = new Rectangle(0, 0, image4.Width, image4.Height);
                        this.DrawImage(gr, image4, rectangle9, rectangle10, group.m_ia, group.AutoTransparent);
                        x += (int)(image4.Width * m_userScaleFactor.Width);
                    }
                }
                if (this.IndexOf(group) == this.m_selectedIndex)
                {
                    rectangle = new Rectangle((int)((x + (2f * m_scaleFactor.Width)) + (5f * m_scaleFactor.Width)), y, rect.Width, this.Height);
                    gr.DrawString(str, this.Font, this.m_brushSelGroupsFore, rectangle);
                }
                else
                {
                    rectangle = new Rectangle((int)((x + (2f * m_scaleFactor.Width)) + (5f * m_scaleFactor.Width)), y, rect.Width, this.Height);
                    gr.DrawString(str, this.Font, this.m_brushGroupsFore, rectangle);
                }
                x += (int)((size.Width + (2f * m_scaleFactor.Width)) + (5f * m_scaleFactor.Width));
Label_08B7:
                num3++;
            }
            return(rectangle2);
        }