protected virtual void OnLayoutWizardButtons(WizardButtonsLayoutEventArgs e) { if (LayoutWizardButtons != null) LayoutWizardButtons(this, e); }
private void RepositionButtons() { int x=panelFooter.Width-m_ButtonSpacingMajor; int y=(panelFooter.Height-m_ButtonHeight)/2; WizardButtonsLayoutEventArgs e=new WizardButtonsLayoutEventArgs(); if (buttonHelp.Visible) { x -= buttonHelp.Width; e.HelpButtonBounds = new Rectangle(x, y, buttonHelp.Width, m_ButtonHeight); x -= m_ButtonSpacingMajor; } if (buttonCancel.Visible) { x -= buttonCancel.Width; e.CancelButtonBounds = new Rectangle(x, y, buttonCancel.Width, m_ButtonHeight); x -= m_ButtonSpacingMajor; } if (buttonFinish.Visible) { x -= buttonFinish.Width; e.FinishButtonBounds = new Rectangle(x, y, buttonFinish.Width, m_ButtonHeight); if(m_FinishButtonAlwaysVisible) x -= m_ButtonSpacingMajor; else x -= m_ButtonSpacingMinor; } if (buttonNext.Visible) { x -= buttonNext.Width; e.NextButtonBounds = new Rectangle(x, y, buttonNext.Width, m_ButtonHeight); x -= m_ButtonSpacingMinor; } if (buttonBack.Visible) { x -= buttonBack.Width; e.BackButtonBounds = new Rectangle(x, y, buttonBack.Width, m_ButtonHeight); x -= m_ButtonSpacingMinor; } if (IsRightToLeft) { int xOffset = panelFooter.Width-x; if (!e.HelpButtonBounds.IsEmpty) { Rectangle r = e.HelpButtonBounds; e.HelpButtonBounds = new Rectangle(panelFooter.Width - r.Right, r.Y, r.Width, r.Height); } if (!e.CancelButtonBounds.IsEmpty) { Rectangle r = e.CancelButtonBounds; e.CancelButtonBounds = new Rectangle(panelFooter.Width - r.Right, r.Y, r.Width, r.Height); } if (!e.FinishButtonBounds.IsEmpty) { Rectangle r = e.FinishButtonBounds; e.FinishButtonBounds = new Rectangle(panelFooter.Width - r.Right, r.Y, r.Width, r.Height); } if (!e.NextButtonBounds.IsEmpty) { Rectangle r = e.NextButtonBounds; e.NextButtonBounds = new Rectangle(panelFooter.Width - r.Right, r.Y, r.Width, r.Height); } if (!e.BackButtonBounds.IsEmpty) { Rectangle r = e.BackButtonBounds; e.BackButtonBounds = new Rectangle(panelFooter.Width - r.Right, r.Y, r.Width, r.Height); } } OnLayoutWizardButtons(e); if (buttonHelp.Visible) buttonHelp.Bounds = e.HelpButtonBounds; if (buttonCancel.Visible) buttonCancel.Bounds = e.CancelButtonBounds; if (buttonNext.Visible) buttonNext.Bounds = e.NextButtonBounds; if (buttonFinish.Visible) buttonFinish.Bounds = e.FinishButtonBounds; if (buttonBack.Visible) buttonBack.Bounds = e.BackButtonBounds; }