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(); }
public void RegisterPane(int priority, AbstractWizardPane pane) { _panesQueue.Push(-priority, pane); pane._parent = this; if (PaneRegistered != null) { PaneRegistered(pane); } }
internal void OnPaneGotInvalid(AbstractWizardPane pane) { AbstractWizardPane currentPane = CurrentPane; if (currentPane != null && currentPane.Equals(pane)) { _nextButton.Enabled = false; } }
internal void OnDeregisterPane(AbstractWizardPane pane) { AbstractWizardPane currentPane = CurrentPane; if (currentPane != null && currentPane.Equals(pane)) { _currentIndex = _minPaneIndex; } _cachedPanes.Remove(pane); InvalidateView(); }
public void DeregisterPane(AbstractWizardPane pane) { foreach (PriorityQueue.QueueEntry e in _panesQueue) { if (e.Value.Equals(pane)) { _panesQueue.Remove(e); OnDeregisterPane(pane); break; } } }
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); } }
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); } }
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); }
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); }
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); }
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"; }
public void RegisterPane(int priority, AbstractWizardPane pane) { _panesQueue.Push(-priority, pane); OnRegisterPane(pane); }
internal void OnRegisterPane(AbstractWizardPane pane) { InvalidateView(); }