-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.cs
More file actions
72 lines (63 loc) · 2.33 KB
/
MainForm.cs
File metadata and controls
72 lines (63 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Windows.Forms;
namespace MimicMuseAI
{
public partial class MainForm : Form
{
private Panel mainPanel;
public MainForm()
{
InitializeComponent();
InitializeMenu();
InitializeMainPanel();
}
private void InitializeComponent()
{
this.mainPanel = new Panel();
this.SuspendLayout();
//
// mainPanel
//
this.mainPanel.Dock = DockStyle.Fill;
this.mainPanel.Name = "mainPanel";
this.mainPanel.TabIndex = 0;
//
// MainForm
//
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.mainPanel);
this.Name = "MainForm";
this.Text = "MimicMuseAI";
this.ResumeLayout(false);
this.PerformLayout();
}
private void InitializeMenu()
{
MenuStrip menuStrip = new MenuStrip();
ToolStripMenuItem bookWriterMenuItem = new ToolStripMenuItem("Book Writer");
ToolStripMenuItem chatMenuItem = new ToolStripMenuItem("Chat");
ToolStripMenuItem loreBookMenuItem = new ToolStripMenuItem("LoreBook");
ToolStripMenuItem settingsMenuItem = new ToolStripMenuItem("Settings");
bookWriterMenuItem.Click += (sender, e) => ShowControl(new BookWriterControl());
chatMenuItem.Click += (sender, e) => ShowControl(new ChatControl());
loreBookMenuItem.Click += (sender, e) => ShowControl(new LoreBookControl());
settingsMenuItem.Click += (sender, e) => ShowControl(new SettingsControl());
menuStrip.Items.Add(bookWriterMenuItem);
menuStrip.Items.Add(chatMenuItem);
menuStrip.Items.Add(loreBookMenuItem);
menuStrip.Items.Add(settingsMenuItem);
this.MainMenuStrip = menuStrip;
this.Controls.Add(menuStrip);
}
private void InitializeMainPanel()
{
ShowControl(new GreetingControl()); // Show greeting control by default
}
private void ShowControl(UserControl control)
{
mainPanel.Controls.Clear();
control.Dock = DockStyle.Fill;
mainPanel.Controls.Add(control);
}
}
}