Ejemplo n.º 1
0
        private void DrawListOfHeaders()
        {
            int    top       = 8;
            int    paneIndex = 0;
            string header    = _headerLabel.Text;

            _controlPool.MoveControlsToPool();
            foreach (Pair pair in _panesList)
            {
                AbstractWizardPane pane  = (AbstractWizardPane)pair.Second;
                JetLinkLabel       label = (JetLinkLabel)_controlPool.GetControl();
                label.Text          = pane.Header;
                label.ClickableLink = (paneIndex <= _maxPaneIndex + 1) && label.Text != header;
                if (label.ClickableLink)
                {
                    if (label.Tag == null)
                    {
                        label.Click += new EventHandler(selectlabel_Click);
                    }
                    label.Tag = paneIndex;
                }
                ++paneIndex;
                label.Top    = top;
                label.Left   = 8 + 8 * (int)pair.First;
                label.Width  = _listPanel.Width - 8 - label.Left;
                label.Height = 17;
                label.Font   = new Font(_btnHelp.Font, FontStyle.Regular);
                if (label.Text == header)
                {
                    label.Font = new Font(label.Font, FontStyle.Bold);
                }
                top += 18;
            }
            _controlPool.RemovePooledControls();
        }
Ejemplo n.º 2
0
 public void RegisterPane(int priority, AbstractWizardPane pane)
 {
     _panesQueue.Push(-priority, pane);
     pane._parent = this;
     if (PaneRegistered != null)
     {
         PaneRegistered(pane);
     }
 }
Ejemplo n.º 3
0
        internal void OnPaneGotInvalid(AbstractWizardPane pane)
        {
            AbstractWizardPane currentPane = CurrentPane;

            if (currentPane != null && currentPane.Equals(pane))
            {
                _nextButton.Enabled = false;
            }
        }
Ejemplo n.º 4
0
        internal void OnDeregisterPane(AbstractWizardPane pane)
        {
            AbstractWizardPane currentPane = CurrentPane;

            if (currentPane != null && currentPane.Equals(pane))
            {
                _currentIndex = _minPaneIndex;
            }
            _cachedPanes.Remove(pane);
            InvalidateView();
        }
Ejemplo n.º 5
0
 public void DeregisterPane(AbstractWizardPane pane)
 {
     foreach (PriorityQueue.QueueEntry e in _panesQueue)
     {
         if (e.Value.Equals(pane))
         {
             _panesQueue.Remove(e);
             OnDeregisterPane(pane);
             break;
         }
     }
 }
Ejemplo n.º 6
0
        private void LeaveCurrentPane(PaneChangeReason reason)
        {
            AbstractWizardPane currentPane = CurrentPane;

            if (currentPane != null)
            {
                Control control = GetControl(currentPane);
                control.Visible = false;
                _paneControlPanel.Controls.Remove(control);
                currentPane.LeavePane(reason);
            }
        }
Ejemplo n.º 7
0
 private void InvalidateView(PriorityQueue panes, int indent)
 {
     foreach (PriorityQueue.QueueEntry e in panes)
     {
         AbstractWizardPane pane = (AbstractWizardPane)e.Value;
         pane.PaneGotValid     += OnPaneGotValid;
         pane.PaneGotInvalid   += OnPaneGotInvalid;
         pane.PaneRegistered   += OnRegisterPane;
         pane.PaneDeregistered += OnDeregisterPane;
         _panesList.Add(new Pair(indent, pane));
         InvalidateView(pane._panesQueue, indent + 1);
     }
 }
Ejemplo n.º 8
0
        private Control GetControl(AbstractWizardPane pane)
        {
            Control result = (Control)_cachedPanes[pane];

            if (result == null)
            {
                result = pane.Pane;
                DialogBase.AdjustContolProperties(result);
                pane.ShowPane();
                _cachedPanes[pane] = result;
            }
            return(result);
        }
Ejemplo n.º 9
0
        private void ShowActivePaneHelp()
        {
            string             topic       = null;
            AbstractWizardPane currentPane = CurrentPane;

            if (currentPane != null)
            {
                topic = currentPane.HelpKeyword;
            }
            if (topic == null)
            {
                topic = "/getstarted/indexing_your_computers_resources.html";
            }
            Help.ShowHelp(this, Core.UIManager.HelpFileName, topic);
        }
Ejemplo n.º 10
0
 private void InvalidateView()
 {
     LeaveCurrentPane(PaneChangeReason.Invalidate);
     foreach (Pair pair in _panesList)
     {
         AbstractWizardPane pane = (AbstractWizardPane)pair.Second;
         pane.PaneGotValid     -= OnPaneGotValid;
         pane.PaneGotInvalid   -= OnPaneGotInvalid;
         pane.PaneRegistered   -= OnRegisterPane;
         pane.PaneDeregistered -= OnDeregisterPane;
     }
     _panesList.Clear();
     InvalidateView(_panesQueue, 0);
     EnterCurrentPane(PaneChangeReason.Invalidate);
 }
Ejemplo n.º 11
0
        private void EnterCurrentPane(PaneChangeReason reason)
        {
            if (_maxPaneIndex < _currentIndex)
            {
                _maxPaneIndex = _currentIndex;
            }
            AbstractWizardPane currentPane = CurrentPane;

            if (currentPane != null)
            {
                Control control = GetControl(currentPane);
                _paneControlPanel.Controls.Add(control);
                control.Dock      = DockStyle.Fill;
                control.Visible   = true;
                _headerLabel.Text = currentPane.Header;
                Core.UserInterfaceAP.QueueJob(new MethodInvoker(DrawListOfHeaders));
                currentPane.EnterPane(reason);
            }
            _backButton.Enabled = _currentIndex > _minPaneIndex;
            _panePanel.Visible  = _currentIndex >= 0;
            _pictureBox.Visible = _currentIndex < 0;
            _nextButton.Text    = (_currentIndex < _panesList.Count - 1) ? "&Next >" : "Fi&nish";
        }
Ejemplo n.º 12
0
 public void RegisterPane(int priority, AbstractWizardPane pane)
 {
     _panesQueue.Push(-priority, pane);
     OnRegisterPane(pane);
 }
Ejemplo n.º 13
0
 internal void OnRegisterPane(AbstractWizardPane pane)
 {
     InvalidateView();
 }