2017-03-17 19:31:41 -04:00
|
|
|
|
using System;
|
2017-03-18 17:26:56 -04:00
|
|
|
|
using TimeHACK.Engine.Template;
|
2017-03-26 13:28:05 -04:00
|
|
|
|
using System.Windows.Forms;
|
2017-03-17 19:31:41 -04:00
|
|
|
|
|
|
|
|
|
namespace TimeHACK.Engine
|
|
|
|
|
{
|
2017-03-26 13:28:05 -04:00
|
|
|
|
public class WindowManager
|
2017-03-17 19:31:41 -04:00
|
|
|
|
{
|
2017-03-26 17:16:44 -04:00
|
|
|
|
public void StartWinClassic(UserControl content, String title, PictureBox icon, Boolean MaxButton, Boolean MinButton)
|
2017-03-17 19:31:41 -04:00
|
|
|
|
{
|
2017-03-26 13:28:05 -04:00
|
|
|
|
// Setup Window
|
2017-03-18 17:26:56 -04:00
|
|
|
|
WinClassic app = new WinClassic();
|
|
|
|
|
app.Title.Text = title;
|
2017-03-26 13:28:05 -04:00
|
|
|
|
app.Width = content.Width + 8;
|
|
|
|
|
app.Height = content.Height + 26;
|
|
|
|
|
content.Parent = app.programContent;
|
|
|
|
|
content.BringToFront();
|
|
|
|
|
content.Dock = DockStyle.Fill;
|
|
|
|
|
if (icon == null)
|
|
|
|
|
{
|
|
|
|
|
icon = app.programIcon;
|
|
|
|
|
icon.Image = Properties.Resources.nullIcon;
|
|
|
|
|
}
|
|
|
|
|
app.programIcon.Image = icon.Image;
|
|
|
|
|
|
|
|
|
|
// Check if Max button is enabled
|
|
|
|
|
if (MaxButton == false)
|
|
|
|
|
{
|
|
|
|
|
app.maximizebutton.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check if Min button is enabled
|
|
|
|
|
if (MinButton == false)
|
|
|
|
|
{
|
|
|
|
|
app.minimizebutton.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Show the app
|
|
|
|
|
app.Show();
|
|
|
|
|
|
|
|
|
|
|
2017-03-17 19:31:41 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-26 13:28:05 -04:00
|
|
|
|
}
|