init commit
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Text;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using PokerStarsBotClientv2.Forms;
|
||||
|
||||
namespace PokerStarsBotClientv2
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
|
||||
// Fields
|
||||
private Panel leftBorderBtn;
|
||||
//private Form currentChildForm;
|
||||
private Form FormRun;
|
||||
private Form FormUploadAll;
|
||||
|
||||
// Constructor
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
HelperMethods.GetUserConfigFromDB();
|
||||
this.Text += " v" + Globals.LocalVersion;
|
||||
HelperMethods.MinimizeToTray(this);
|
||||
|
||||
// GUI
|
||||
leftBorderBtn = new Panel();
|
||||
leftBorderBtn.Size = new Size(10, 50);
|
||||
panelMenu.Controls.Add(leftBorderBtn);
|
||||
labelEmail.Text = Properties.Settings.Default.UserName;
|
||||
|
||||
// Create forms only once
|
||||
FormRun = new FormRun();
|
||||
FormUploadAll = new FormUploadAll();
|
||||
|
||||
// Default form on startup
|
||||
OpenChildForm(FormRun);
|
||||
}
|
||||
|
||||
// Structs
|
||||
private struct RGBColors
|
||||
{
|
||||
public static Color color1 = Color.FromArgb(255, 255, 255); // white
|
||||
public static Color color2 = Color.FromArgb(0, 174, 219); // metro blue
|
||||
public static Color color3 = Color.FromArgb(26, 32, 40); // pokerstarsbot blue
|
||||
public static Color color4 = Color.FromArgb(244, 244, 244); // f4f4f4
|
||||
public static Color color5 = Color.Gainsboro;
|
||||
public static Color color6 = Color.FromArgb(50, 62, 78); // pokerstarsblue lighter
|
||||
}
|
||||
|
||||
// Methods
|
||||
private void ActivateButton(object senderBtn, Color color)
|
||||
{
|
||||
if (senderBtn != null)
|
||||
{
|
||||
DisableButton();
|
||||
// Left boder button
|
||||
leftBorderBtn.BackColor = RGBColors.color2;
|
||||
leftBorderBtn.Visible = true;
|
||||
leftBorderBtn.BringToFront();
|
||||
}
|
||||
}
|
||||
|
||||
private void DisableButton()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OpenChildForm(Form childForm)
|
||||
{
|
||||
//currentChildForm = childForm;
|
||||
childForm.TopLevel = false;
|
||||
childForm.FormBorderStyle = FormBorderStyle.None;
|
||||
childForm.Dock = DockStyle.Fill;
|
||||
panelDesktop.Controls.Add(childForm);
|
||||
panelDesktop.Tag = childForm;
|
||||
childForm.BringToFront();
|
||||
childForm.Show();
|
||||
}
|
||||
|
||||
private void btnRun_Click(object sender, EventArgs e)
|
||||
{
|
||||
ActivateButton(sender, RGBColors.color5);
|
||||
OpenChildForm(FormRun);
|
||||
}
|
||||
|
||||
private void btnUploadAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
ActivateButton(sender, RGBColors.color5);
|
||||
OpenChildForm(FormUploadAll);
|
||||
}
|
||||
|
||||
private void panelLogo_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user