private void drawStimulu() { int count = 0; Size size; showModel = true; stimuluControls.Clear(); foreach (string element in matchingGroups.ElementAt(groupCounter).getStimulusNames()) { if (stimuluType == 1 || stimuluType == 2) { newStimulu = ExpositionController.InitializeButton(element); newStimulu.Font = new Font("Arial", this.executingTest.ProgramInUse.StimuluSize, FontStyle.Bold); newStimulu.ForeColor = ColorTranslator.FromHtml(matchingGroups.ElementAt(groupCounter).getColors().ElementAt(count)); size = modelControl.PreferredSize; } else { newStimulu = ExpositionController.InitializeImageBox(executingTest.ProgramInUse.StimuluSize, Image.FromFile(element), false, this); newStimulu.Tag = element; size = modelControl.Size; } if (this.executingTest.ProgramInUse.RandomStimulusPosition) { newStimulu.Location = stimuluPosition.getRandomPosition(size); } else { newStimulu.Location = stimuluPosition.getPositon(size); } if (matchingGroups.ElementAt(groupCounter).getModelName().Equals(element)) { modelAsStimuluControl = newStimulu; } currentStimulus = matchingGroups.ElementAt(groupCounter); newStimulu.MouseClick += new System.Windows.Forms.MouseEventHandler(this.MatchingExposition_MouseClick); stimuluControls.Add(newStimulu); count++; } groupCounter++; if (groupCounter > this.executingTest.ProgramInUse.AttemptsNumber) { groupCounter = 0; } expositionBW.ReportProgress(currentExposition / (executingTest.ProgramInUse.AttemptsNumber * 2) * 100, stimuluControls); }
private void drawImage() { imgPictureBox = ExpositionController.InitializeImageBox(executingTest.ProgramInUse.StimuluSize, Image.FromFile(imagesList[imageCounter]), executingTest.ProgramInUse.ExpandImage, this); Point screenPosition = ScreenPosition(imgPictureBox.Size); imgPictureBox.Location = screenPosition; currentStimuli[0] = StrList.outPutItemName(imagesList[imageCounter]); currentLists[0] = executingTest.ProgramInUse.getImageListFile().ListName; imageCounter++; if (imageCounter == imagesList.Length) { imageCounter = 0; } expositionBW.ReportProgress(currentExposition / executingTest.ProgramInUse.NumExpositions * 100, imgPictureBox); }
private void drawModel() { Size size; List <Control> controls = new List <Control>(); showModel = false; if (stimuluType == 1 || stimuluType == 2) { modelControl = ExpositionController.InitializeButton(matchingGroups.ElementAt(groupCounter).getModelName()); modelControl.Font = new Font("Arial", this.executingTest.ProgramInUse.StimuluSize, FontStyle.Bold); modelControl.ForeColor = ColorTranslator.FromHtml(matchingGroups.ElementAt(groupCounter).getModelColor()); size = modelControl.PreferredSize; } else { modelControl = ExpositionController.InitializeImageBox(executingTest.ProgramInUse.StimuluSize, Image.FromFile(matchingGroups.ElementAt(groupCounter).getModelName()), false, this); size = modelControl.Size; } if (this.executingTest.ProgramInUse.RandomModelPosition) { modelControl.Location = stimuluPosition.getRandomPosition(size); } else { Point position = stimuluPosition.getPositon(size); modelControl.Location = position; } currentStimulus = matchingGroups.ElementAt(groupCounter); if (executingTest.ProgramInUse.EndExpositionWithClick) { modelControl.MouseClick += new System.Windows.Forms.MouseEventHandler(this.MatchingExposition_MouseClick); } else { modelControl.MouseClick += new System.Windows.Forms.MouseEventHandler(this.wrongClick_mouseClick); } controls.Add(modelControl); expositionBW.ReportProgress(currentExposition / (executingTest.ProgramInUse.AttemptsNumber * 2) * 100, controls); }