Exemplo n.º 1
0
        private void DefaultDrawItem(DrawStepListItemEventArgs e)
        {
            Color     fc = ForeColor, bc = BackColor;
            int       level = GetStepTextIndentLevel(e.Item);
            bool      isRTL = RightToLeft == System.Windows.Forms.RightToLeft.Yes;
            var       tffrtl = isRTL ? TextFormatFlags.Right : 0;
            Rectangle rect, prect;

            if (isRTL)
            {
                Split(e.Bounds, Width - bulletWidth, out rect, out prect);
                prect.X    = e.Bounds.Width - (bulletWidth * (level + 1));
                rect.Width = Width - (bulletWidth * (level + 1));
            }
            else
            {
                Split(e.Bounds, bulletWidth, out prect, out rect);
                prect.X = bulletWidth * level;
                rect.X  = bulletWidth * (level + 1);
            }
            if (!e.Completed)
            {
                fc = SystemColors.GrayText;
            }
            using (Brush br = new SolidBrush(bc))
                e.Graphics.FillRectangle(br, Rectangle.Union(rect, prect));
            TextRenderer.DrawText(e.Graphics, e.Completed ? (isRTL ? "3" : "4") : "a", ptrFont, prect, fc, defBulletTextFormat | tffrtl);
            TextRenderer.DrawText(e.Graphics, GetStepText(e.Item), e.Selected ? boldFont : Font, rect, fc, defStringTextFormat | tffrtl);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises the <see cref="E:DrawItem"/> event.
        /// </summary>
        /// <param name="e">The <see cref="DrawStepListItemEventArgs"/> instance containing the event data.</param>
        protected virtual void OnDrawItem(DrawStepListItemEventArgs e)
        {
            var h = DrawItem;

            if (h != null)
            {
                h(this, e);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            if (myParent == null)
            {
                return;
            }
            int y = Padding.Top;
            WizardPageCollection pages = myParent.Pages;
            bool hit = false;

            for (int i = 0; i < pages.Count; i++)
            {
                var curPage = pages[i];
                if (!curPage.Suppress)
                {
                    Size itemSize = new Size(Width - Padding.Horizontal, defItemHeight);
                    if (OwnerDraw)
                    {
                        var meArg = new MeasureStepListItemEventArgs(e.Graphics, Font, curPage, new Size(Width, defItemHeight));
                        OnMeasureItem(meArg);
                        itemSize = meArg.ItemSize;
                    }
                    if (y + itemSize.Height > (Height - Padding.Bottom))
                    {
                        break;
                    }
                    bool isSelected = myParent.SelectedPage == curPage;
                    if (isSelected)
                    {
                        hit = true;
                    }
                    var eArg = new DrawStepListItemEventArgs(e.Graphics, Font, new Rectangle(new Point(Padding.Left, y), itemSize), curPage, isSelected, hit);
                    if (OwnerDraw)
                    {
                        OnDrawItem(eArg);
                    }
                    else
                    {
                        DefaultDrawItem(eArg);
                    }
                    y += itemSize.Height;
                }
            }
        }
Exemplo n.º 4
0
        private void wizardControl1_DrawStepListItem(object sender, AeroWizard.DrawStepListItemEventArgs e)
        {
            string pre = e.Selected ? "> " : e.Completed ? "- " : "+ ";

            TextRenderer.DrawText(e.Graphics, pre + wizardControl1.GetStepText(e.Item), myFont, e.Bounds, ForeColor);
        }
Exemplo n.º 5
0
 private void list_DrawItem(object sender, DrawStepListItemEventArgs e)
 {
     OnDrawStepListItem(e);
 }
Exemplo n.º 6
0
 /// <summary>Raises the <see cref="E:DrawItem"/> event.</summary>
 /// <param name="e">The <see cref="DrawStepListItemEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDrawItem(DrawStepListItemEventArgs e) => DrawItem?.Invoke(this, e);