aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/MainMenu/MainMenu.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-11 08:21:41 -0400
committerMichael <[email protected]>2017-06-11 08:21:47 -0400
commit7ec048fe8536c9757eda47801af07956b826466d (patch)
treebcc0588ae5509ede6d7e916118040eae828e4600 /ShiftOS.WinForms/MainMenu/MainMenu.cs
parent997a81457ebb6d6523c36ca552cee143e0d92244 (diff)
downloadshiftos_thereturn-7ec048fe8536c9757eda47801af07956b826466d.tar.gz
shiftos_thereturn-7ec048fe8536c9757eda47801af07956b826466d.tar.bz2
shiftos_thereturn-7ec048fe8536c9757eda47801af07956b826466d.zip
More menu work.
Diffstat (limited to 'ShiftOS.WinForms/MainMenu/MainMenu.cs')
-rw-r--r--ShiftOS.WinForms/MainMenu/MainMenu.cs72
1 files changed, 60 insertions, 12 deletions
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs
index 4b510e2..e11edc2 100644
--- a/ShiftOS.WinForms/MainMenu/MainMenu.cs
+++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs
@@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -18,12 +19,60 @@ namespace ShiftOS.WinForms.MainMenu
{
InitializeComponent();
(desk as WinformsDesktop).ParentMenu = this;
+ this.FormBorderStyle = FormBorderStyle.None;
+ this.WindowState = FormWindowState.Maximized;
+#if DEBUG
+ var asm = Assembly.GetExecutingAssembly();
+ string asmName = asm.GetName().Name;
+ string vstring = "";
+ var version = asm.GetCustomAttributes(true).FirstOrDefault(x => x is AssemblyVersionAttribute) as AssemblyVersionAttribute;
+ if (version != null)
+ vstring = version.Version;
+ lbbuilddetails.Text = $"{asmName} - version number: {vstring} - THIS IS AN UNSTABLE RELEASE.";
+
+#else
+ lbbuilddetails.Hide();
+#endif
+ }
+
+ public void HideOptions()
+ {
+ pnloptions.Hide();
+ flmenu.BringToFront();
+ flmenu.CenterParent();
+ currentMenu = flmenu;
+ CategoryText = "Main menu";
+ }
+
+ public string CategoryText
+ {
+ get
+ {
+ return lbcurrentui.Text;
+ }
+ set
+ {
+ lbcurrentui.Text = value;
+ lbcurrentui.CenterParent();
+ lbcurrentui.Top = currentMenu.Top - (lbcurrentui.Height * 2);
+ }
+ }
+
+ private Control currentMenu = null;
+
+ private void MainMenu_Load(object sender, EventArgs e)
+ {
+ Tools.ControlManager.SetupControls(this);
+ shiftos.CenterParent();
+ shiftos.Top = 35;
+
+
var tickermove = new Timer();
var tickerreset = new Timer();
tickermove.Tick += (o, a) =>
{
- if(lbticker.Left <= (0 - lbticker.Width))
+ if (lbticker.Left <= (0 - lbticker.Width))
{
tickermove.Stop();
tickerreset.Start();
@@ -52,18 +101,9 @@ namespace ShiftOS.WinForms.MainMenu
flmenu.CenterParent();
tickerreset.Start();
- }
- public void HideOptions()
- {
- pnloptions.Hide();
- flmenu.BringToFront();
- flmenu.CenterParent();
- }
-
- private void MainMenu_Load(object sender, EventArgs e)
- {
- Tools.ControlManager.SetupControls(this);
+ currentMenu = flmenu;
+ CategoryText = "Main menu";
}
@@ -110,6 +150,9 @@ namespace ShiftOS.WinForms.MainMenu
flcampaign.Show();
flcampaign.BringToFront();
flcampaign.CenterParent();
+ currentMenu = flcampaign;
+ CategoryText = "Campaign";
+
}
private void button5_Click(object sender, EventArgs e)
@@ -135,6 +178,9 @@ namespace ShiftOS.WinForms.MainMenu
pnloptions.Show();
pnloptions.BringToFront();
pnloptions.CenterParent();
+ currentMenu = pnloptions;
+ CategoryText = "Settings";
+
}
private void opt_btncancel_Click(object sender, EventArgs e)
@@ -187,6 +233,8 @@ namespace ShiftOS.WinForms.MainMenu
flmenu.Show();
flmenu.BringToFront();
flmenu.CenterParent();
+ currentMenu = flmenu;
+ CategoryText = "Main menu";
}
private void btncontinue_Click(object sender, EventArgs e)