public WizardPage Add(WizardPage value)
        {
            // Use base class to process actual collection operation
            base.List.Add(value as object);

            return value;
        }
        public WizardPage Add(TabPage value)
        {
            // Create a WizardPage from the TabPage
            WizardPage wp = new WizardPage();
            wp.Title = value.Title;
            wp.Control = value.Control;
            wp.ImageIndex = value.ImageIndex;
            wp.ImageList = value.ImageList;
            wp.Icon = value.Icon;
            wp.Selected = value.Selected;
            wp.StartFocus = value.StartFocus;

            return Add(wp);
        }
예제 #3
0
        public WizardControl()
        {
            InitializeComponent();

            // No page currently selected
            _selectedPage = null;

            // Hook into tab control events
            _tabControl.SelectionChanged += new EventHandler(OnTabSelectionChanged);

            // Create our collection of wizard pages
            _wizardPages = new WizardPageCollection();

            // Hook into collection events
            _wizardPages.Cleared += new Collections.CollectionClear(OnWizardCleared);
            _wizardPages.Inserted += new Collections.CollectionChange(OnWizardInserted);
            _wizardPages.Removed += new Collections.CollectionChange(OnWizardRemoved);

            // Hook into drawing events
            _panelTop.Resize += new EventHandler(OnRepaintPanels);
            _panelTop.Paint += new PaintEventHandler(OnPaintTopPanel);
            _panelBottom.Resize += new EventHandler(OnRepaintPanels);
            _panelBottom.Paint += new PaintEventHandler(OnPaintBottomPanel);

            // Initialize state
            _showUpdate = _enableUpdate = Status.Default;
            _showCancel = _enableUpdate = Status.Default;
            _showBack = _enableBack = Status.Default;
            _showNext = _enableNext = Status.Default;
            _showFinish = _enableFinish = Status.Default;
            _showClose = _enableClose = Status.Default;
            _showHelp = _enableHelp = Status.Default;

            // Default properties
            ResetProfile();
            ResetTitle();
            ResetTitleFont();
            ResetTitleColor();
            ResetSubTitleFont();
            ResetSubTitleColor();
            ResetPicture();
            ResetAssignDefaultButton();

            // Position and enable/disable control button state
            UpdateControlButtons();
        }
예제 #4
0
 public virtual void OnWizardPageLeave(WizardPage wp)
 {
     if (WizardPageLeave != null)
         WizardPageLeave(wp, this);
 }
예제 #5
0
 public virtual void OnWizardPageEnter(WizardPage wp)
 {
     if (WizardPageEnter != null)
         WizardPageEnter(wp, this);
 }
예제 #6
0
        protected void OnTabSelectionChanged(object sender, EventArgs e)
        {
            // Update buttons to reflect change
            UpdateControlButtons();

            if (_tabControl.SelectedIndex != -1)
            {
                // Get the selected wizard page
                WizardPage wp = _wizardPages[_tabControl.SelectedIndex];

                // Should we be presented in full page?
                if (wp.FullPage)
                    EnterFullPage();
                else
                {
                    // Controller profile is not allowed to be outside of FullMode
                    if (_profile != Profiles.Controller)
                        LeaveFullPage();
                }
            }
            else
            {
                // Controller profile is not allowed to be outside of FullMode
                if (_profile != Profiles.Controller)
                    LeaveFullPage();
            }

            // Update manual drawn text
            _panelTop.Invalidate();

            // Generate raw selection changed event
            OnSelectionChanged(EventArgs.Empty);

            // Generate page leave event if currently on a valid page
            if (_selectedPage != null)
            {
                OnWizardPageLeave(_selectedPage);
                _selectedPage = null;
            }

            // Remember which is the newly seleced page
            if (_tabControl.SelectedIndex != -1)
                _selectedPage = _wizardPages[_tabControl.SelectedIndex] as WizardPage;

            // Generate page enter event is now on a valid page
            if (_selectedPage != null)
                OnWizardPageEnter(_selectedPage);
        }
 public void Remove(WizardPage value)
 {
     // Use base class to process actual collection operation
     base.List.Remove(value as object);
 }
 public void Insert(int index, WizardPage value)
 {
     // Use base class to process actual collection operation
     base.List.Insert(index, value as object);
 }
 public int IndexOf(WizardPage value)
 {
     // Find the 0 based index of the requested entry
     return base.List.IndexOf(value);
 }
예제 #10
0
 public bool Contains(WizardPage value)
 {
     // Use base class to process actual collection operation
     return base.List.Contains(value as object);
 }
예제 #11
0
 public void AddRange(WizardPage[] values)
 {
     // Use existing method to add each array entry
     foreach(WizardPage page in values)
         Add(page);
 }