public SolvableControl(Flowsheet flowsheet, Point location, Solvable solvable) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.solvable = solvable; this.flowsheet = flowsheet; this.Location = location; this.isDirty = false; //this.IsSelected = false; this.isSelected = false; //this.IsShownInEditor = true; this.isShownInEditor = true; this.nameCtrl = new TextBox(); //this.nameCtrl.BackColor = new UI().NAME_CTRL_COLOR; this.nameCtrl.BackColor = UI.NAME_CTRL_COLOR; this.nameCtrl.BorderStyle = System.Windows.Forms.BorderStyle.None; this.nameCtrl.ReadOnly = true; this.nameCtrl.WordWrap = false; this.nameCtrl.AutoSize = false; this.nameCtrl.Enabled = false; FontFamily ff = this.nameCtrl.Font.FontFamily; Font f = new Font(ff, 7); this.nameCtrl.Font = f; // the size is overriden in the extended class this.nameCtrl.Height = f.Height + 1; this.nameCtrl.Width = 60; this.NameControl.Text = this.Solvable.Name; UI.SetCtrlSize(this.NameControl); this.flowsheet.Controls.Add(this.NameControl); this.toolTip = new ToolTip(); this.UpdateToolTipText(); this.Solvable.NameChanged += new NameChangedEventHandler(Solvable_NameChanged); this.Solvable.SolveComplete += new SolveCompleteEventHandler(Solvable_SolveComplete); this.LocationChanged += new EventHandler(SolvableControl_LocationChanged); this.flowsheet.EvaporationAndDryingSystem.SystemChanged += new SystemChangedEventHandler(EvaporationAndDryingSystem_SystemChanged); this.DrawSelection(); }
private void Solvable_NameChanged(object sender, string newName, string oldName) { this.flowsheet.ConnectionManager.SetOwner(this.NameControl.Text, newName); this.NameControl.Text = newName; UI.SetCtrlSize(this.NameControl); }