Exemplo n.º 1
0
        /// <summary>
        /// Called when the whole program first loads
        /// </summary>
        private void VirtualLabToplevel_Load(object	sender,	System.EventArgs e)
        {
            // Display a "WELCOME SCREEN" allowing the user to chose the program type
            WelcomeScreen ws = new WelcomeScreen();
            DialogResult dResult = ws.ShowDialog();
            switch (dResult)
            {

                case DialogResult.Yes:  // practice mode
                    programMode = ProgramMode.Practice;
                    this.Text += " Practice Mode";
                    break;
                case DialogResult.No:	// evaluation mode
                    programMode = ProgramMode.Eval;
                    resultsShow.Visible = false;
                    pplotShowHide.Enabled = false;
                    this.Text += " Evaluation Mode";
                    pplotShowHide.Enabled = false;
                    break;
            }

            if (dResult != DialogResult.Cancel)
            {

                // get student parameters
                si.stName = ws.stName;
                si.stID = ws.stID;
                si.stCourse = ws.stCourse;
                si.stEmail = ws.stEmail;
                si.stProf = ws.stProf;

                // show the students name in title (if available
                if (si.stName != string.Empty)
                    Text += "                                             Clinician: " + si.stName;

                // construct and show children
                admtr = new Audiometer(
                    new Audiometer.presentationDelegate(presFunc),
                    new Audiometer.stateChangedDelegate(stChang));
                admtr.MdiParent = this;
                admtr.Show();
                admtr.Location = new Point(0, 0);
                admtr.Size = new Size(661, 460);

                // Patient Window
                //ptwind = new PatientWindow(pt); //Changes made 04/12/2011
                ptwind = new PatientWindow();
                ptwind.MdiParent = this;
                ptwind.Show();
                ptwind.Location = new Point(0, admtr.Height);
                ptwind.Size = new Size(400, 450);

                adgrm = new Audiogram();
                adgrm.vltl = this;
                adgrm.patient = pt; // delete me
                adgrm.MdiParent = this;
                adgrm.Show();
                adgrm.Location = new Point(admtr.Width,0);
                adgrm.SpAudInput.MdiParent = this;
                adgrm.SpAudInput.Location = new Point(750, 496);

                pplot = new Plateau_Plot.Plateau_Plot();
                pplot.MdiParent = this;
                pplot.Show();
                pplot.Location = new Point(adgrm.Width, adgrm.Height);
                pplot.Visible = false;

                // SRT
                srtWind = new SRT.SRT(
                    new SRT.SRT.ResponseDelegate(DoResponse),
                    new SRT.SRT.DoneDelegate(EnableSpeechMenu));
                srtWind.MdiParent = this;
                srtWind.Location = new Point(750, 496);
                srtWind.Hide();

                // WI
                wiWind = new WI.WI(
                    new WI.WI.DoneDelegate(EnableSpeechMenu),
                    new WI.WI.ResponseDelegate(DoResponse));
                wiWind.MdiParent = this;
                wiWind.Location = new Point(750, 496);
                wiWind.Hide();

                // show form
                this.Visible = true;
                WindowState = System.Windows.Forms.FormWindowState.Maximized;
                prevState = admtr.ameterSettings;
            } // end if ( dResult != Cancel )
        }