-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.Designer.cs
More file actions
217 lines (187 loc) · 7.71 KB
/
Form1.Designer.cs
File metadata and controls
217 lines (187 loc) · 7.71 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
namespace FolderSizeScanner;
partial class Form1
{
private System.ComponentModel.IContainer components = null;
private TextBox txtPath = null!;
private ModernButton btnBrowse = null!;
private ModernButton btnScan = null!;
private ModernButton btnExport = null!;
private ModernTreeView treeResults = null!;
private ModernProgressBar progressBar = null!;
private Label lblStatus = null!;
private Label lblDepth = null!;
private NumericUpDown nudDepth = null!;
// Layout panels
private Panel pnlToolbar = null!;
private Panel pnlTreeCard = null!;
private Panel pnlFooter = null!;
private Panel pnlPathWrapper = null!;
private ContextMenuStrip ctxTree = null!;
private ToolStripMenuItem ctxScanFromHere = null!;
private PictureBox picLogo = null!;
private Label lblTitle = null!;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
txtPath = new TextBox();
btnBrowse = new ModernButton();
btnScan = new ModernButton();
btnExport = new ModernButton();
treeResults = new ModernTreeView();
progressBar = new ModernProgressBar();
lblStatus = new Label();
lblDepth = new Label();
nudDepth = new NumericUpDown();
pnlToolbar = new Panel();
pnlTreeCard = new Panel();
pnlFooter = new Panel();
pnlPathWrapper = new Panel();
SuspendLayout();
pnlToolbar.SuspendLayout();
pnlTreeCard.SuspendLayout();
pnlFooter.SuspendLayout();
// ── Footer panel (Dock=Bottom, must be added first) ─────────
pnlFooter.Dock = DockStyle.Bottom;
pnlFooter.Height = 40;
pnlFooter.BackColor = ModernTheme.FormBg;
pnlFooter.Padding = new Padding(4, 4, 4, 4);
// progressBar
progressBar.Dock = DockStyle.Top;
progressBar.Height = 6;
// lblStatus
lblStatus.Dock = DockStyle.Fill;
lblStatus.Text = "Ready. Select a folder and click Scan.";
lblStatus.Font = ModernTheme.FontStatus;
lblStatus.ForeColor = ModernTheme.TextSecondary;
lblStatus.TextAlign = ContentAlignment.MiddleLeft;
lblStatus.Padding = new Padding(0, 2, 0, 0);
pnlFooter.Controls.Add(lblStatus);
pnlFooter.Controls.Add(progressBar);
// ── Toolbar panel (Dock=Top) ────────────────────────────────
pnlToolbar.Dock = DockStyle.Top;
pnlToolbar.Height = 56;
pnlToolbar.BackColor = ModernTheme.CardBg;
pnlToolbar.Padding = new Padding(12, 12, 12, 12);
// picLogo
picLogo = new PictureBox();
picLogo.Dock = DockStyle.Left;
picLogo.Width = 32;
picLogo.SizeMode = PictureBoxSizeMode.Zoom;
picLogo.Margin = new Padding(0, 0, 6, 0);
picLogo.BackColor = Color.Transparent;
// lblTitle
lblTitle = new Label();
lblTitle.Dock = DockStyle.Left;
lblTitle.Width = 110;
lblTitle.Text = "Perimeter 9";
lblTitle.Font = new Font("Segoe UI", 9.5f, FontStyle.Bold);
lblTitle.ForeColor = Color.FromArgb(56, 107, 62);
lblTitle.TextAlign = ContentAlignment.MiddleLeft;
lblTitle.Padding = new Padding(2, 0, 4, 0);
// pnlPathWrapper — rounded border around textbox
pnlPathWrapper.Height = 32;
pnlPathWrapper.Dock = DockStyle.Fill;
pnlPathWrapper.BackColor = ModernTheme.CardBg;
pnlPathWrapper.Padding = new Padding(8, 4, 8, 4);
pnlPathWrapper.Paint += PnlPathWrapper_Paint;
// txtPath
txtPath.Dock = DockStyle.Fill;
txtPath.Font = ModernTheme.FontTextBox;
txtPath.BorderStyle = BorderStyle.None;
txtPath.BackColor = ModernTheme.CardBg;
txtPath.ForeColor = ModernTheme.TextPrimary;
txtPath.Text = @"C:\";
txtPath.PlaceholderText = "Select a folder to scan...";
txtPath.Enter += TxtPath_FocusChanged;
txtPath.Leave += TxtPath_FocusChanged;
pnlPathWrapper.Controls.Add(txtPath);
// lblDepth
lblDepth.Dock = DockStyle.Right;
lblDepth.Width = 48;
lblDepth.Text = "Depth:";
lblDepth.Font = ModernTheme.FontStatus;
lblDepth.ForeColor = ModernTheme.TextSecondary;
lblDepth.TextAlign = ContentAlignment.MiddleRight;
lblDepth.Padding = new Padding(4, 0, 0, 0);
// nudDepth
nudDepth.Dock = DockStyle.Right;
nudDepth.Width = 52;
nudDepth.Font = ModernTheme.FontTextBox;
nudDepth.Minimum = 1;
nudDepth.Maximum = 50;
nudDepth.Value = 3;
nudDepth.BorderStyle = BorderStyle.FixedSingle;
// btnBrowse
btnBrowse.Dock = DockStyle.Right;
btnBrowse.Width = 80;
btnBrowse.Text = "Browse";
btnBrowse.Margin = new Padding(4, 0, 4, 0);
btnBrowse.Click += BtnBrowse_Click;
// btnScan
btnScan.Dock = DockStyle.Right;
btnScan.Width = 80;
btnScan.Text = "Scan";
btnScan.IsPrimary = true;
btnScan.Margin = new Padding(4, 0, 4, 0);
btnScan.Click += BtnScan_Click;
// btnExport
btnExport.Dock = DockStyle.Right;
btnExport.Width = 80;
btnExport.Text = "Export";
btnExport.Enabled = false;
btnExport.Click += BtnExport_Click;
// Add toolbar controls (right-docked added first, then fill, then left)
pnlToolbar.Controls.Add(pnlPathWrapper);
pnlToolbar.Controls.Add(lblTitle);
pnlToolbar.Controls.Add(picLogo);
pnlToolbar.Controls.Add(lblDepth);
pnlToolbar.Controls.Add(nudDepth);
pnlToolbar.Controls.Add(btnBrowse);
pnlToolbar.Controls.Add(btnScan);
pnlToolbar.Controls.Add(btnExport);
// ── Tree card panel (Dock=Fill) ─────────────────────────────
pnlTreeCard.Dock = DockStyle.Fill;
pnlTreeCard.BackColor = ModernTheme.CardBg;
pnlTreeCard.Padding = new Padding(1);
pnlTreeCard.Margin = new Padding(12, 4, 12, 4);
pnlTreeCard.Paint += PaintCardPanel;
// ctxTree — context menu for tree nodes
ctxTree = new ContextMenuStrip();
ctxScanFromHere = new ToolStripMenuItem("Scan from here");
ctxScanFromHere.Click += CtxScanFromHere_Click;
ctxTree.Items.Add(ctxScanFromHere);
ctxTree.Opening += CtxTree_Opening;
// treeResults
treeResults.Dock = DockStyle.Fill;
treeResults.ContextMenuStrip = ctxTree;
treeResults.NodeMouseDoubleClick += TreeResults_NodeMouseDoubleClick;
pnlTreeCard.Controls.Add(treeResults);
// ── Form1 ───────────────────────────────────────────────────
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(900, 600);
BackColor = ModernTheme.FormBg;
Padding = new Padding(12);
DoubleBuffered = true;
Controls.Add(pnlTreeCard);
Controls.Add(pnlFooter);
Controls.Add(pnlToolbar);
MinimumSize = new Size(640, 420);
StartPosition = FormStartPosition.CenterScreen;
KeyPreview = true;
KeyDown += Form1_KeyDown;
Text = "Perimeter 9 Folder Size Scanner";
pnlToolbar.ResumeLayout(false);
pnlTreeCard.ResumeLayout(false);
pnlFooter.ResumeLayout(false);
ResumeLayout(false);
PerformLayout();
}
}