public LibraryForm() { InitializeComponent(); SetText(); // Make initial elements var PObject = new xPObject(); var PLink = new xPLink(); var PBox = new xPBox(); PObject.Canvas = Share.GetDotImage(); PObject.Dots[0].X = (Int16)(PObject.Canvas.Width / 2); PObject.Dots[0].Y = (Int16)(PObject.Canvas.Height / 2); PObject.ID = PLink.ID = PBox.ID = 1; PObject.Revision = PLink.Revision = PBox.Revision = 1; PObject.NodeName = "Dot"; PLink.NodeName = "Link"; PBox.NodeName = "Box"; PObject.FileName = Options.RootObjects + (Options.RootObjects != "" ? "\\" : "") + "1" + Options.RECORD_EXT_OBJECT; PLink.FileName = Options.RootLinks + (Options.RootLinks != "" ? "\\" : "") + "1" + Options.RECORD_EXT_LINK; PBox.FileName = Options.RootBoxes + (Options.RootBoxes != "" ? "\\" : "") + "1" + Options.RECORD_EXT_BOX; PObject.isPrototype = PLink.isPrototype = PBox.isPrototype = true; // Register elements Options.PObjects.Add(PObject); Options.PLinks.Add(PLink); Options.PBoxes.Add(PBox); // Load elements trees LoadElements(Options.RootObjects, "*" + Options.RECORD_EXT_OBJECT, Options.PObjects, () => new xPObject()); LoadElements(Options.RootLinks, "*" + Options.RECORD_EXT_LINK, Options.PLinks, () => new xPLink()); LoadElements(Options.RootBoxes, "*" + Options.RECORD_EXT_BOX, Options.PBoxes, () => new xPBox()); // Make trees BuildTree(tvObjects, Options.PObjects); BuildTree(tvLinks, Options.PLinks); BuildTree(tvBoxes, Options.PBoxes); // Select roots tvObjects.SelectedNode = tvObjects.Nodes[0]; tvLinks.SelectedNode = tvLinks.Nodes[0]; tvBoxes.SelectedNode = tvBoxes.Nodes[0]; }
public BoxEditForm(xPBox pBox, UInt64 NodeParent = 1) { InitializeComponent(); if (pBox == null) { pBox = new xPBox(); pBox.NodeParent = NodeParent; pBox.FileName = Options.RootBoxes + (Options.RootBoxes != "" ? "\\" : "") + pBox.ID.ToString() + Options.RECORD_EXT_BOX; Text = Options.LangCur.lEETitleAdd + " " + Options.LangCur.lEETitleBox; } else { Text = Options.LangCur.lEETitleEdit + " " + Options.LangCur.lEETitleBox; } PBox = pBox; IsRoot = (PBox.ID == 1); // Share chkIsPrototype.Enabled = tbNode.Enabled = (PBox.ID != 1); // lblNode.Text = Options.LangCur.lEENodeName; chkIsPrototype.Text = Options.LangCur.lEEPrototype; lblName.Text = Options.LangCur.lEEName; lblID.Text = Options.LangCur.lEEID; lblRevision.Text = Options.LangCur.lEERevision; // Fill tbNode.Text = PBox.NodeName; chkIsPrototype.Checked = PBox.isPrototype; tbName.Text = PBox.Name; tbID.Text = PBox.ID.ToString(); tbRevision.Text = DateTime.FromBinary(PBox.Revision).ToString(Options.TIME_FORMAT); tbDescription.Text = PBox.Description; // Own lblType.Text = Options.LangCur.lBEType; lblLineThick.Text = Options.LangCur.lEELineThick; lblLineStyle.Text = Options.LangCur.lEELineStyle; lblText.Text = Options.LangCur.lBEText; lblTextAlign.Text = Options.LangCur.lEEAlign; toolTip.SetToolTip(btnLineColor, Options.LangCur.hEEColorPick); toolTip.SetToolTip(btnFont, Options.LangCur.hEEColorPick); // Fill CBB Type cbbType.Items.Add(Options.LangCur.lBEType0Text); cbbType.Items.Add(Options.LangCur.lBEType1Rectangle); cbbType.Items.Add(Options.LangCur.lBEType2Ellipse); // Fill CBB Align cbbAlign.Items.Add(Options.LangCur.lEEAlign0TL); cbbAlign.Items.Add(Options.LangCur.lEEAlign1TC); cbbAlign.Items.Add(Options.LangCur.lEEAlign2TR); cbbAlign.Items.Add(Options.LangCur.lEEAlign3ML); cbbAlign.Items.Add(Options.LangCur.lEEAlign4MC); cbbAlign.Items.Add(Options.LangCur.lEEAlign5MR); cbbAlign.Items.Add(Options.LangCur.lEEAlign6BL); cbbAlign.Items.Add(Options.LangCur.lEEAlign7BC); cbbAlign.Items.Add(Options.LangCur.lEEAlign8BR); // Fill cbbType.SelectedIndex = (int)PBox.BoxType; nudThick.Value = (int)PBox.Pen.Width; btnLineColor.BackColor = PBox.Pen.Color; cbbStyle.SelectedIndex = (int)PBox.Pen.DashStyle; tbText.Text = PBox.Text; cbbAlign.SelectedIndex = (int)PBox.TextAlign; btnFontColor.BackColor = PBox.TextColor; SetAndShowFont(PBox.Font); }