/// <summary> /// Use this if we're looking at a part document. But it's also used were we're looking /// at an assembly because we use the same properties. /// </summary> /// <param name="md">A ModelDoc2 object.</param> private void SetupPart(ModelDoc2 md) { // Blow out any existing controls, and dump events. ClearControls(this); // Fill everything so it stretches. DockStyle d = DockStyle.Fill; // New model handler with current property (aquired in this.Connect...()) mrb = new ModelRedbrick(ref prop); // If it's not docked, dock it. mrb.Dock = d; // put the redbrick in this control Controls.Add(mrb); // Dock this control in the taskpane. Dock = d; foreach (Control item in mrb.Controls) { item.Dock = d; //item.ResumeLayout(true); } // Gonna use access to all these controls. ds = mrb.aDepartmentSelector; cs = mrb.aConfigurationSpecific; gp = mrb.aGeneralProperties; mp = mrb.aMachineProperties; op = mrb.aOps; // Part-related events. ConnectPartEvents(md); //ResumeLayout(true); // Boom, we're set up. PartSetup = true; }
private void Init() // If this didn't start out as a VSTA plugin, I probably wouldn't have { // to do this. //DockStyle d = DockStyle.None; gbSpecProp.Click += gbSpecProp_Click; gbGlobProp.Click += gbGlobProp_Click; ds = new DepartmentSelector(ref this.props); ds.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; //ds.Dock = d; cs = new ConfigurationSpecific(ref this.props); cs.Location = new System.Drawing.Point(3, 13); cs.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; //cs.Dock = d; gp = new GeneralProperties(ref this.props); gp.Location = new System.Drawing.Point(3, 13); gp.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; //gp.Dock = d; mp = new MachineProperties(ref this.props); mp.Location = new System.Drawing.Point(3, 13); mp.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; //mp.Dock = d; op = new Ops(ref this.props); op.Location = new System.Drawing.Point(3, 13); op.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; op.TabIndex = 2; //op.Dock = d; //ch = new CutlistHandler(ref this.props); //ch.TabIndex = 1; //ch.Dock = d; // If anything's not docked, dock it. //foreach (Control item in this.tlpMain.Controls) { // item.Dock = d; //} gbSpecProp.Controls.Add(cs); gbGlobProp.Controls.Add(gp); gbMachProp.Controls.Add(mp); tlp1.Controls.Add(ds); tlp1.Controls.Add(op); //gbCutlist.Controls.Add(ch); //tlpMain.ResumeLayout(true); ResumeLayout(false); PerformLayout(); }