// ------------------------------------------------------
        /// <summary>
        /// Asks the current page for the states of the wizard buttons and
        /// updates their enablements appropriately.
        /// </summary>
        public void RefreshButtons()
        {
            if (pages.Count == 0)
            {
                return;
            }

            WizardPageControl currentPage = pages[currentPageIndex];

            if (currentPageIndex == 0)
            {
                backButton.Enabled = false;
            }
            else
            {
                backButton.Enabled = currentPage.IsBackEnabled;
            }

            if (currentPageIndex == pages.Count - 1)
            {
                nextButton.Enabled = false;
            }
            else
            {
                nextButton.Enabled = currentPage.IsNextEnabled;
            }

            finishButton.Enabled = currentPage.IsFinishEnabled;
        }
        // ------------------------------------------------------
        /// <summary>
        /// Called when the Next button is clicked.
        /// </summary>
        /// <param name="sender">
        /// The sender of the event.
        /// </param>
        /// <param name="e">
        /// An <code>EventArgs</code> object.
        /// </param>
        private void nextButton_Click(object sender, EventArgs e)
        {
            RemoveCurrentPage();

            WizardPageControl currentPage = pages[currentPageIndex];

            currentPageIndex++;
            WizardPageControl nextPage = pages[currentPageIndex];

            currentPage.OnGoingToNextPage(nextPage);
            nextPage.OnComingFromPreviousPage(currentPage);

            LoadCurrentPage();
            RefreshButtons();
        }
        // ------------------------------------------------------
        /// <summary>
        /// Called when the Back button is clicked.
        /// </summary>
        /// <param name="sender">
        /// The sender of the event.
        /// </param>
        /// <param name="e">
        /// An <code>EventArgs</code> object.
        /// </param>
        private void backButton_Click(object sender, EventArgs e)
        {
            RemoveCurrentPage();

            WizardPageControl currentPage = pages[currentPageIndex];

            currentPageIndex--;
            WizardPageControl previousPage = pages[currentPageIndex];

            currentPage.OnGoingToPreviousPage(previousPage);
            previousPage.OnComingFromNextPage(currentPage);

            LoadCurrentPage();
            RefreshButtons();
        }
        //~ Methods ..........................................................

        // ------------------------------------------------------
        /// <summary>
        /// Adds a wizard page to the wizard.
        /// </summary>
        /// <param name="page">
        /// The page to be added to the wizard.
        /// </param>
        public void AddPage(WizardPageControl page)
        {
            Size size     = pageContainer.Size;
            Size pageSize = page.Size;

            pages.Add(page);
            page.Wizard = this;

            if (pageSize.Width > size.Width)
            {
                size.Width = pageSize.Width;
            }

            if (pageSize.Height > size.Height)
            {
                size.Height = pageSize.Height;
            }

            this.Size = new Size(size.Width + 406 - 384,
                                 size.Height + 334 - 168);
        }
Exemple #5
0
 // ------------------------------------------------------
 /// <summary>
 /// Called when this page is about to be loaded, having arrived from
 /// the next one.
 /// </summary>
 /// <param name="nextPage">
 /// The next page that was left.
 /// </param>
 public virtual void OnComingFromNextPage(WizardPageControl nextPage)
 {
 }
Exemple #6
0
 // ------------------------------------------------------
 /// <summary>
 /// Called when this page is about to be loaded, having arrived from
 /// the previous one.
 /// </summary>
 /// <param name="previousPage">
 /// The previous page that was left.
 /// </param>
 public virtual void OnComingFromPreviousPage(
     WizardPageControl previousPage)
 {
 }
Exemple #7
0
 // ------------------------------------------------------
 /// <summary>
 /// Called when this page is being left for the previous one.
 /// </summary>
 /// <param name="previousPage">
 /// The previous page that will be loaded.
 /// </param>
 public virtual void OnGoingToPreviousPage(
     WizardPageControl previousPage)
 {
 }
Exemple #8
0
        //~ Methods ..........................................................

        // ------------------------------------------------------
        /// <summary>
        /// Called when this page is being left for the next one.
        /// </summary>
        /// <param name="nextPage">
        /// The next page that will be loaded.
        /// </param>
        public virtual void OnGoingToNextPage(WizardPageControl nextPage)
        {
        }
Exemple #9
0
        public override void OnGoingToNextPage(WizardPageControl nextPage)
        {
            NewCxxTestSuiteWizardPage2 page2 = (NewCxxTestSuiteWizardPage2)nextPage;

            page2.PopulateWithHeader(headerUnderTest);
        }