-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimberPaletteControl.Designer.cs
More file actions
228 lines (208 loc) · 12 KB
/
Copy pathTimberPaletteControl.Designer.cs
File metadata and controls
228 lines (208 loc) · 12 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
218
219
220
221
222
223
224
225
226
227
228
using System.Drawing;
using System.Windows.Forms;
namespace TimberDraw
{
// Managed-timber assembly palette (TPanel / the shell's Assembly tab). Two flat sections
// (the sticky Section catalogue and the Brace spec) over ONE bottom action bar carrying
// every verb as full-span rows (the Joints-tab look). The assign two-box is GONE -- the
// Browser tab is the single assign surface. Layout is hand-coded here.
partial class TimberPaletteControl : System.Windows.Forms.UserControl
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null)) components.Dispose();
base.Dispose(disposing);
}
// Section editor
private TreeView treeSections;
private TextBox txtType, txtWidth, txtDepth;
private Button btnAdd, btnUpdate, btnRemove;
// Brace spec (foot/head legs + angle; the two checked rows compute the third)
private CheckBox chkFoot, chkHead, chkAngle;
private TextBox txtFoot, txtHead, txtAngle;
private ComboBox cmbBracePlace; // Back / Center / Front on the narrower host
private Panel groupBrace;
// Verbs (bottom action bar): orientation presets, place & connect, edit & nodes.
private Button btnPlan, btnBent, btnWall;
private Button btnPlace, btnSpan, btnJoin, btnFit, btnScarf, btnJoist;
private Button btnMove, btnRotate, btnScan, btnSection;
// Footer
private Label lblBuild;
// Container: a scrolling top-down flow of the two spec sections; verbs live in the
// bottom bar, not in the flow.
private FlowLayoutPanel flowEdit;
private Panel groupSection;
// A flat section: bold header band docked over a pinned-dark panel. The header must
// dock TOP here: PaneRows.HeaderCell is Dock=Fill for table cells, and Fill inside a
// plain Panel would cover the whole section and swallow every click.
private static Panel Section(string title, int w, int h)
{
var p = new Panel { Size = new Size(w, h), BackColor = Theme.Bg };
System.Windows.Forms.Label hdr = PaneRows.HeaderCell(title);
hdr.Dock = DockStyle.Top;
p.Controls.Add(hdr);
return p;
}
// Pixel-placed control helpers for the section interiors, styled through the Theme.
private static Label Cap(string text, int x, int y)
{
Label l = Theme.Caption(text);
l.Location = new Point(x, y);
l.Padding = new Padding(0);
return l;
}
private static Button Btn(string text, int x, int y, int w)
{
Button b = Theme.Button(text);
b.Location = new Point(x, y);
b.Size = new Size(w, 25);
return b;
}
private static CheckBox Chk(string text, int x, int y)
{
CheckBox c = Theme.Check(text);
c.Location = new Point(x, y);
return c;
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
const int GW = 234; // section width
// ---- Section (tree; data entry stacked; catalog buttons beside their fields) ----
treeSections = new TreeView
{
Location = new Point(8, 24),
Size = new Size(GW - 16, 368), // doubled (Robert: the selector needed the room)
HideSelection = false,
ShowLines = true,
ShowRootLines = true
};
// Stacked data entry: Type, then W, then D -- each label left, field on its own row.
txtType = new TextBox { Location = new Point(48, 400), Size = new Size(174, 22) };
txtWidth = new TextBox { Location = new Point(48, 428), Size = new Size(60, 22) };
txtDepth = new TextBox { Location = new Point(48, 456), Size = new Size(60, 22) };
btnAdd = Btn("Add", 8, 488, 70);
btnUpdate = Btn("Update", 82, 488, 70);
btnRemove = Btn("Remove", 156, 488, 70);
groupSection = Section("Section", GW, 526);
groupSection.Controls.Add(treeSections);
groupSection.Controls.Add(Cap("Type", 12, 403));
groupSection.Controls.Add(txtType);
groupSection.Controls.Add(Cap("W", 12, 431));
groupSection.Controls.Add(txtWidth);
groupSection.Controls.Add(Cap("D", 12, 459));
groupSection.Controls.Add(txtDepth);
groupSection.Controls.Add(btnAdd);
groupSection.Controls.Add(btnUpdate);
groupSection.Controls.Add(btnRemove);
// ---- Brace (foot/head legs + angle; check two, the third is computed) ----
chkFoot = Chk("Foot leg", 12, 28);
chkHead = Chk("Head leg", 12, 56);
chkAngle = Chk("Angle (deg)", 12, 84);
txtFoot = new TextBox { Location = new Point(150, 25), Size = new Size(60, 22) };
txtHead = new TextBox { Location = new Point(150, 53), Size = new Size(60, 22) };
txtAngle = new TextBox { Location = new Point(150, 81), Size = new Size(60, 22) };
cmbBracePlace = new ComboBox
{
Location = new Point(150, 109),
Size = new Size(75, 22),
DropDownStyle = ComboBoxStyle.DropDownList
};
cmbBracePlace.Items.AddRange(new object[] { "Back", "Center", "Front" });
groupBrace = Section("Brace (knee)", GW, 142);
groupBrace.Controls.Add(chkFoot);
groupBrace.Controls.Add(chkHead);
groupBrace.Controls.Add(chkAngle);
groupBrace.Controls.Add(txtFoot);
groupBrace.Controls.Add(txtHead);
groupBrace.Controls.Add(txtAngle);
groupBrace.Controls.Add(Cap("Placement", 12, 112));
groupBrace.Controls.Add(cmbBracePlace);
// ---- Bottom action bar: every verb in LABELED groups (Robert's ask), rows regrouped
// so each caption is honest: UCS presets / verbs that CREATE timbers / verbs that
// reshape ONE timber / placement moves / node scan. ----
btnPlan = Theme.Button("Plan");
btnBent = Theme.Button("Bent");
btnWall = Theme.Button("Wall");
btnPlace = Theme.Button("Place");
btnSpan = Theme.Button("Span");
btnJoin = Theme.Button("Brace"); // TJoin -- connect two picked timbers with a brace
btnFit = Theme.Button("Fit");
btnScarf = Theme.Button("Scarf");
btnJoist = Theme.Button("Joist");
btnSection = Theme.Button("Section"); // re-section any managed timber in place (TSection)
btnMove = Theme.Button("Move");
btnRotate = Theme.Button("Rotate");
btnScan = Theme.Button("Scan");
Panel bar = ActionBar.Build(
ActionBar.Caption("UCS preset"),
ActionBar.Row(btnPlan, btnBent, btnWall),
ActionBar.Caption("Build timbers"),
ActionBar.Row(btnPlace, btnSpan, btnJoin, btnJoist),
ActionBar.Caption("Shape timber"),
ActionBar.Row(btnFit, btnScarf, btnSection),
ActionBar.Caption("Position"),
ActionBar.Row(btnMove, btnRotate),
ActionBar.Caption("Connectivity"),
ActionBar.Row(btnScan));
// ---- Footer: build stamp (so a stale NETLOAD is obvious) ----
lblBuild = new Label
{
Text = "Build ...",
AutoSize = true,
ForeColor = Theme.SubtleFg,
Margin = new Padding(6, 6, 0, 6),
Dock = DockStyle.Bottom
};
// ---- Root: sections flow on top; bar + footer dock at the bottom. Later-added
// bottom docks sit LOWER, so add footer after the bar. ----
flowEdit = new FlowLayoutPanel
{
Dock = DockStyle.Fill,
FlowDirection = FlowDirection.TopDown,
WrapContents = false,
AutoScroll = true,
Padding = new Padding(2)
};
flowEdit.Controls.Add(groupSection);
flowEdit.Controls.Add(groupBrace);
// Plain-language tooltips on every control (Robert's ask -- the tab explains itself).
var tip = new ToolTip(this.components) { AutoPopDelay = 20000, InitialDelay = 400, ReshowDelay = 100, ShowAlways = true };
tip.SetToolTip(treeSections, "Your saved section catalog. Selecting a size makes it the STICKY section -- Place / Span / Brace / Joist use it without asking.");
tip.SetToolTip(txtType, "Member type for this catalog entry (Post, Girt, Brace, Joist, Summer...).");
tip.SetToolTip(txtWidth, "Section width in inches.");
tip.SetToolTip(txtDepth, "Section depth in inches.");
tip.SetToolTip(btnAdd, "Add Type / W / D as a new catalog entry.");
tip.SetToolTip(btnUpdate, "Change the selected entry to the fields' values.");
tip.SetToolTip(btnRemove, "Delete the selected entry from the catalog.");
tip.SetToolTip(chkFoot, "Brace FOOT leg: distance from the corner along the first member. Check TWO of the three -- the third is computed.");
tip.SetToolTip(chkHead, "Brace HEAD leg: distance from the corner along the second member. Check TWO of the three -- the third is computed.");
tip.SetToolTip(chkAngle, "Brace angle in degrees. Check TWO of the three -- the third is computed.");
tip.SetToolTip(txtFoot, "Foot leg length, inches.");
tip.SetToolTip(txtHead, "Head leg length, inches.");
tip.SetToolTip(txtAngle, "Brace angle, degrees.");
tip.SetToolTip(cmbBracePlace, "Where the brace sits across the joint, registered against the NARROWER of the two picked timbers: Back/Front flush a face, Center centers in the slack -- the same rule as the frame recipe's Placement. TJoin's ghost prompt offers Flip if Back/Front lands on the wrong side.");
tip.SetToolTip(btnPlan, "Set the UCS flat on the floor (plan) for placing.");
tip.SetToolTip(btnBent, "Set the UCS to a bent elevation for placing.");
tip.SetToolTip(btnWall, "Set the UCS to a wall elevation for placing.");
tip.SetToolTip(btnPlace, "TPlace: one timber of the sticky section -- pick a point and a direction.");
tip.SetToolTip(btnSpan, "TSpan: pick two timbers; a new member fills the gap between their facing faces.");
tip.SetToolTip(btnJoin, "TJoin: pick two faces -- facing = square filler, angled = mitered knee brace (uses the Brace legs / angle above).");
tip.SetToolTip(btnJoist, "TJoist: fill between two picked carriers with a row of PLAIN joists -- cut the end dovetails later with TJointAll.");
tip.SetToolTip(btnFit, "TFit: trim or extend a picked end onto a target face; the other end stays put.");
tip.SetToolTip(btnScarf, "TScarf: split a timber into two pieces with a scarf splice.");
tip.SetToolTip(btnSection, "TSection: re-section a timber (new W x D) in place.");
tip.SetToolTip(btnMove, "Plain AutoCAD MOVE -- the button is identical to typing it. Joinery travels with the timber; run TJointSync after it lands.");
tip.SetToolTip(btnRotate, "Plain AutoCAD ROTATE -- the button is identical to typing it.");
tip.SetToolTip(btnScan, "TScan: rescan face coincidence and mark the connection nodes.");
this.Controls.Add(flowEdit);
this.Controls.Add(bar);
this.Controls.Add(lblBuild);
flowEdit.SendToBack();
this.Name = "TimberPaletteControl";
this.Size = new Size(GW + 24, 560);
Theme.Apply(this); // pins every container + inputs to the shared palette
}
}
}