Beispiel #1
0
 public void SetSolvable(Solvable solvable)
 {
     this.solvable = solvable;
     this.Text     = solvable.Name;
     UI.SetStatusColor(this, this.solvable.SolveState);
     this.solvable.NameChanged   += new NameChangedEventHandler(solvable_NameChanged);
     this.solvable.SolveComplete += new SolveCompleteEventHandler(solvable_SolveComplete);
     this.Validating             += new CancelEventHandler(SolvableNameTextBox_Validating);
     this.KeyUp += new KeyEventHandler(SolvableNameTextBox_KeyUp);
 }
Beispiel #2
0
 public void UnsetSolvable()
 {
     if (this.solvable != null)
     {
         this.Text = ".";
         UI.SetStatusColor(this, SolveState.NotSolved);
         this.solvable.NameChanged   -= new NameChangedEventHandler(solvable_NameChanged);
         this.solvable.SolveComplete -= new SolveCompleteEventHandler(solvable_SolveComplete);
         this.Validating             -= new CancelEventHandler(SolvableNameTextBox_Validating);
         this.KeyUp -= new KeyEventHandler(SolvableNameTextBox_KeyUp);
     }
 }
Beispiel #3
0
        public SolvableNameTextBox(Solvable solvable)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.solvable = solvable;
            this.Text     = solvable.Name;
            UI.SetStatusColor(this, this.solvable.SolveState);
            this.solvable.NameChanged   += new NameChangedEventHandler(solvable_NameChanged);
            this.solvable.SolveComplete += new SolveCompleteEventHandler(solvable_SolveComplete);
            this.Validating             += new CancelEventHandler(SolvableNameTextBox_Validating);
            this.KeyUp += new KeyEventHandler(SolvableNameTextBox_KeyUp);
        }
Beispiel #4
0
        private void InitControl()
        {
            this.isDirty    = false;
            this.isSelected = false;

            this.nameCtrl             = new TextBox();
            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.nameCtrl.Text   = this.solvable.Name;

            SetCtrlSize(this.nameCtrl);
            this.flowsheet.Controls.Add(this.nameCtrl);
            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();

            UI.SetStatusColor(this, this.solvable.SolveState);
            this.UpdateBackImage();
            g = this.CreateGraphics();
        }
Beispiel #5
0
 private void solvable_SolveComplete(object sender, SolveState solveState)
 {
     UI.SetStatusColor(this, solveState);
 }