Skip to content

Commit

Permalink
remove use of tabcontrol
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaProductions committed May 30, 2024
1 parent a1d3794 commit e21ee4e
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 158 deletions.
12 changes: 0 additions & 12 deletions Rectify11Installer/Core/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,18 +462,6 @@ public class RectifyPages
public static DebugPage DebugPage = new();
public static DefenderPage DefenderPage = new();
}
public class TabPages
{
public static Controls.DarkAwareTabPage eulPage;
public static Controls.DarkAwareTabPage installPage;
public static Controls.DarkAwareTabPage themePage;
public static Controls.DarkAwareTabPage cmenupage;
public static Controls.DarkAwareTabPage debPage;
public static Controls.DarkAwareTabPage progressPage;
public static Controls.DarkAwareTabPage summaryPage;
public static Controls.DarkAwareTabPage wlcmPage;
public static Controls.DarkAwareTabPage defenderPage;
}
public class InstallOptions
{
public static bool InstallEP { get; set; }
Expand Down
1 change: 0 additions & 1 deletion Rectify11Installer/Pages/CMenuPage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/DebugPage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/DefenderPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public partial class DefenderPage : WizardPage
public DefenderPage()
{
InitializeComponent();
this.Page = Rectify11Installer.Core.TabPages.defenderPage;
}
#endregion
}
Expand Down
1 change: 0 additions & 1 deletion Rectify11Installer/Pages/EulaPage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/InstallConfirmation.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/InstallOptnsPage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/ProgressPage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/ThemeChoicePage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/WelcomePage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Rectify11Installer/Pages/WizardPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public partial class WizardPage : UserControl
public Image SideImage { get; set; }
public bool HeaderVisible { get; set; }
public bool FooterVisible { get; set; }
public TabPage Page { get; set; }
public bool UpdateFrame { get; set; }
public bool IsWelcomePage { get; set; }
public bool NextButtonEnabled { get; set; }
Expand Down
115 changes: 2 additions & 113 deletions Rectify11Installer/frmWizard.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 17 additions & 23 deletions Rectify11Installer/frmWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ private void Application_Idle(object sender, EventArgs e)
RectifyPages.InstallConfirmation = new InstallConfirmation(this);
RectifyPages.ProgressPage = new ProgressPage(this);

TabPages.eulPage.Controls.Add(RectifyPages.EulaPage);
TabPages.installPage.Controls.Add(RectifyPages.InstallOptnsPage);
TabPages.themePage.Controls.Add(RectifyPages.ThemeChoicePage);
TabPages.cmenupage.Controls.Add(RectifyPages.CMenuPage);
TabPages.debPage.Controls.Add(RectifyPages.DebugPage);
TabPages.progressPage.Controls.Add(RectifyPages.ProgressPage);
TabPages.defenderPage.Controls.Add(RectifyPages.DefenderPage);

RectifyPages.WelcomePage.InstallButton.Click += InstallButton_Click;
RectifyPages.WelcomePage.UninstallButton.Click += UninstallButton_Click;
nextButton.Click += NextButton_Click;
Expand Down Expand Up @@ -125,19 +117,21 @@ private void FrmWizard_Shown(object sender, EventArgs e)
}
}

TabPages.wlcmPage.Controls.Add(RectifyPages.WelcomePage);
RectifyPages.WelcomePage.UninstallButton.Enabled = InstallStatus.IsRectify11Installed;
if (InstallStatus.IsRectify11Installed) _acknowledged = true;
}
#endregion
#region Navigation
private WizardPage CurrentPage;
private void Navigate(WizardPage page)
{
CurrentPage = page;
headerText.Text = page.WizardHeader;
sideImage.Image = page.SideImage;
tableLayoutPanel1.Visible = page.HeaderVisible;
tableLayoutPanel2.Visible = page.FooterVisible;
navPane.SelectedTab = page.Page;
navPane.Controls.Clear();
navPane.Controls.Add(page);
if (!sideImage.Enabled)
sideImage.Enabled = true;
if (!ThemeUtil.IsUsingDarkMode)
Expand Down Expand Up @@ -175,20 +169,20 @@ private void FrmWizard_FormClosing(object sender, FormClosingEventArgs e)
}
private void NextButton_Click(object sender, EventArgs e)
{
if (navPane.SelectedTab == TabPages.defenderPage)
if (CurrentPage == RectifyPages.DefenderPage)
{
if (!_acknowledged) Navigate(RectifyPages.EulaPage);
else Navigate(RectifyPages.InstallOptnsPage);
}
else if (navPane.SelectedTab == TabPages.eulPage)
else if (CurrentPage == RectifyPages.EulaPage)
{
if (!_acknowledged)
{
_acknowledged = true;
}
Navigate(RectifyPages.InstallOptnsPage);
}
else if (navPane.SelectedTab == TabPages.installPage)
else if (CurrentPage == RectifyPages.InstallOptnsPage)
{
ExtrasOptions.UpdateIRectify11();
if (InstallOptions.InstallThemes)
Expand All @@ -204,7 +198,7 @@ private void NextButton_Click(object sender, EventArgs e)
Navigate(RectifyPages.InstallConfirmation);
}
}
else if (navPane.SelectedTab == TabPages.themePage)
else if (CurrentPage == RectifyPages.ThemeChoicePage)
{
if (InstallOptions.InstallShell)
{
Expand All @@ -215,39 +209,39 @@ private void NextButton_Click(object sender, EventArgs e)
Navigate(RectifyPages.InstallConfirmation);
}
}
else if (navPane.SelectedTab == TabPages.cmenupage)
else if (CurrentPage == RectifyPages.CMenuPage)
{
Navigate(RectifyPages.InstallConfirmation);
}
else if (navPane.SelectedTab == TabPages.summaryPage)
else if (CurrentPage == RectifyPages.InstallConfirmation)
{
Navigate(RectifyPages.ProgressPage);
}
}

private void BackButton_Click(object sender, EventArgs e)
{
if (navPane.SelectedTab == TabPages.defenderPage)
if (CurrentPage == RectifyPages.DefenderPage)
{
Navigate(RectifyPages.WelcomePage);
}
else if (navPane.SelectedTab == TabPages.eulPage)
else if (CurrentPage == RectifyPages.EulaPage)
{
Navigate(RectifyPages.DefenderPage);
}
else if (navPane.SelectedTab == TabPages.installPage)
else if (CurrentPage == RectifyPages.InstallOptnsPage)
{
Navigate(RectifyPages.WelcomePage);
}
else if (navPane.SelectedTab == TabPages.themePage)
else if (CurrentPage == RectifyPages.ThemeChoicePage)
{
Navigate(RectifyPages.InstallOptnsPage);
}
else if (navPane.SelectedTab == TabPages.debPage)
else if (CurrentPage == RectifyPages.DebugPage)
{
Navigate(RectifyPages.WelcomePage);
}
else if (navPane.SelectedTab == TabPages.cmenupage)
else if (CurrentPage == RectifyPages.CMenuPage)
{
if (InstallOptions.InstallThemes)
{
Expand All @@ -258,7 +252,7 @@ private void BackButton_Click(object sender, EventArgs e)
Navigate(RectifyPages.InstallOptnsPage);
}
}
else if (navPane.SelectedTab == TabPages.summaryPage)
else if (CurrentPage == RectifyPages.InstallConfirmation)
{
if (InstallOptions.InstallShell)
{
Expand Down

0 comments on commit e21ee4e

Please sign in to comment.