private void CancelButton_Click(object sender, EventArgs e)
        {
            if(m_modified == true)
            {
                FormConfirmDecision dlg = new FormConfirmDecision();
                dlg.Text = "Confirm Cancel";
                dlg.messageString = "Abandon changes to model?";
                dlg.button1String = "Confirm Cancel";
                dlg.button2String = "Do Not Cancel";
                dlg.SetLocation(OkButton);
                dlg.ShowDialog(this);

                if(dlg.buttonSelected == 2)
                    return;
                m_modified = false;
            }
            this.BringToFront();
            Dispose();
        }
 private void MyCancelButton_Click(object sender, EventArgs e)
 {
     if(m_bModified == true)
     {
         FormConfirmDecision dlg = new FormConfirmDecision();
         dlg.Text = "Confirm Cancel";
         dlg.messageString = "Cancel Changes To Rate Model?";
         dlg.button1String = "Confirm Cancel";
         dlg.button2String = "Do Not Cancel";
         dlg.SetLocation(MyOKButton);
         dlg.ShowDialog(this);
         if(dlg.buttonSelected == 2)
             return;
         m_bModified = false;
     }
     Dispose();
 }
 private void CancelButton_Click(object sender, EventArgs e)
 {
     if(m_modified == true)
     {
         FormConfirmDecision dlg = new FormConfirmDecision();
         dlg.Text = "Confirm Cancel";
         dlg.messageString = "Cancel Changes To Rate Model?";
         dlg.button1String = "Confirm Cancel";
         dlg.button2String = "Do Not Cancel";
         dlg.SetLocation(ModelOKButton);
         //dlg.SetNearbyLocation(this.Location.X + ModelOKButton.Location.X + ModelOKButton.Width - dlg.Width, this.Location.Y + ModelOKButton.Location.Y-dlg.Height - 5);
         dlg.ShowDialog(this);
         if(dlg.buttonSelected == 2)
             return;
         m_modified = false;
     }
     Dispose();
 }
 private int VerifySaveOldBeforeOpenNew()
 {
     if(m_speMdl.NeedSave == true)
     {
         FormConfirmDecision dlg = new FormConfirmDecision();
         dlg.button3Visible = true;
         dlg.Text = "Save Species Model?";
         dlg.messageString = "Current Model Has Been Modified But Not Saved!";
         dlg.button1String = "Do Not Save";
         dlg.button2String = "Save First";
         dlg.button3String = "Cancel";
         dlg.SetLocation(DoneButton);
         dlg.ShowDialog(this);
         return dlg.buttonSelected;
     }
     return 0;
 }
 private void DoneButton_Click(object sender, EventArgs e)
 {
     if(m_speMdl.NeedSave == true)
     {
         FormConfirmDecision dlg = new FormConfirmDecision();
         dlg.button3Visible = true;
         dlg.Text = "File Not Saved!";
         dlg.messageString = "Save Species Model Before Exiting?";
         dlg.button3String = "Save And Exit";
         dlg.button1String = "Cancel";
         dlg.button2String = "Exit Without\nSaving";
         dlg.SetLocation(DoneButton);
         dlg.ShowDialog(this);
         if(dlg.buttonSelected == 1) // cancel
         {
             this.BringToFront();
             return;
         }
         else if(dlg.buttonSelected == 2) // Exit without saving
         {
             Dispose();
         }
         else if(dlg.buttonSelected == 3) // Save and exit.
         {
             if(Save() == false)
                 return;
             Dispose();
         }
     }
     Dispose();
 }
        private void DoneButton_Click(object sender, EventArgs e)
        {
            int i;
            CBehavior beh;
            CEnvAttrBehTrans p;

            if(m_modified == true)
            {
                FormConfirmDecision dlg = new FormConfirmDecision();
                dlg.Text = "Confirm Changes";
                dlg.messageString = "Confirming changes updates all behaviors immediately.";
                dlg.button2String = "Confirm Changes And Done";
                dlg.button1String = "Continue Editing";
                dlg.button3String = "Abandon Updates And Done";
                dlg.button3Visible = true;
                dlg.SetLocation(DoneButton);
                dlg.ShowDialog(this);
                this.BringToFront();
                if(dlg.buttonSelected == 1)
                {
                    return;
                }
                if(dlg.buttonSelected == 3)
                {
                    Dispose();
                    return;
                }

                m_modified = false;

                for(i=0; i<m_spe.BehaviorCount && i<NUM_NRML_BUTTONS; i++)
                {
                    if(i == m_behIndex)
                        beh = m_beh;
                    else
                        beh = m_spe.GetBehaviorCopy(i);

                    switch(m_transModelType)
                    {
                   // case TRANSITIONALMODELTYPE.BEHAVIORAL:
                     //   p = beh.nrmlBehTrans;
                       // break;
                    case TRANSITIONALMODELTYPE.DEPTHENV:
                        p = beh.depthBehTrans;
                        break;
                    case TRANSITIONALMODELTYPE.TEMPERATUREENV:
                        p = beh.temperatureBehTrans;
                        break;
                    default:
                        p = beh.depthBehTrans;
//                        p = beh.nrmlBehTrans;
                        break;
                    }

                    p.vector.a = CStringUtil.SzVectorToDoubleArray(m_vectorTextBoxArray[i].Text);
                    //p.element.a = CStringUtil.SzToDouble(m_T50TextBoxArray[i].Text);
                    p.meanTimeInBehMinuites = CStringUtil.SzToDouble(m_T50TextBoxArray[i].Text);
                    p.slopeCoeff_goesAway = CStringUtil.SzToDouble(m_slopeTextBoxArray[i].Text);
                    m_spe.SetBehavior(i, beh);
                }
            }
            Dispose();
        }