예제 #1
0
        /// <summary>
        /// Raises the <see cref="E:AeroWizard.StepWizardControl.MeasureStepListItem" /> event.
        /// </summary>
        /// <param name="e">The <see cref="MeasureStepListItemEventArgs"/> instance containing the event data.</param>
        protected virtual void OnMeasureStepListItem(MeasureStepListItemEventArgs e)
        {
            var h = MeasureStepListItem;

            if (h != null)
            {
                h(this, e);
            }
        }
예제 #2
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;
            }
            var y     = Padding.Top;
            var pages = myParent.Pages;
            var hit   = false;

            for (var i = 0; i < pages.Count; i++)
            {
                var curPage = pages[i];
                if (!curPage.Suppress)
                {
                    var 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;
                    }
                    var 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;
                }
            }
        }
예제 #3
0
 /// <summary>
 /// Raises the <see cref="E:MeasureItem"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MeasureStepListItemEventArgs"/> instance containing the event data.</param>
 protected virtual void OnMeasureItem(MeasureStepListItemEventArgs e)
 {
     MeasureItem?.Invoke(this, e);
 }
예제 #4
0
 private void list_MeasureItem(object sender, MeasureStepListItemEventArgs e)
 {
     OnMeasureStepListItem(e);
 }