コード例 #1
0
		public MultipleChoice(Question question, SetEditor editor)
		{
			InitializeComponent();
			if(question != null)
			{
				button1.Text = "Apply";
				numericUpDown1.Value = question.choices.Count();
				textBox1.Text = question.question;

				textBox2.Text = question.choices[0];
				textBox3.Text = question.choices[1];
				if (numericUpDown1.Value > 2)
					textBox4.Text = question.choices[2];				
				if (numericUpDown1.Value > 3)
					textBox5.Text = question.choices[3];

				for (int i = 0; i < numericUpDown1.Value; i++ )
				{
					if (question.choices[i].ToLower().Equals(question.answer.ToLower()))
					{
						if (i == 0) radioButton1.Checked = true;
						else if (i == 1) radioButton2.Checked = true;
						else if (i == 2) radioButton3.Checked = true;
						else if (i == 3) radioButton4.Checked = true;
						break;
					}
			
				}

				this.question = question;
			}
			this.set = editor.set;
			this.editor = editor;
		}
コード例 #2
0
ファイル: FillIn.cs プロジェクト: Hitchhikrr/StudyBuddy
		public FillIn(Question question, SetEditor editor)
		{
			InitializeComponent();

			if(question != null)
			{
				textBox1.Text = question.question;
				textBox2.Text = question.answer;
				button1.Text = "Apply";
			}

			this.question = question;
			this.set = editor.set;
			this.editor = editor;
		}
コード例 #3
0
        public void AddEmptyRow(int setNumber)
        {
            SerieCellValueChangedController serieCellValueChangedController = new SerieCellValueChangedController(this);

            int newRowIndex = grid1.Rows.Count;

            grid1.Rows.Insert(newRowIndex);


            var lookupEditor             = new LookupEditEditor(typeof(Guid));
            LookUpColumnInfo selectedCol = (LookUpColumnInfo)cmbExerciseColumns.SelectedItem;

            lookupEditor.Control.SetDisplayColumn(selectedCol);

            grid1[newRowIndex, ExerciseColumnIndex] = new SourceGrid.Cells.Cell(null, lookupEditor);
            SourceGrid.Cells.Views.Cell readOnlyView = new SourceGrid.Cells.Views.Cell();
            grid1[newRowIndex, ExerciseColumnIndex].View           = readOnlyView;
            grid1[newRowIndex, ExerciseColumnIndex].View.ForeColor = ApplicationColors.FGNullText;
            grid1[newRowIndex, ExerciseColumnIndex].AddController(exerciseCellController);
            grid1[newRowIndex, ExerciseColumnIndex].Editor.NullDisplayString = StrengthTrainingEntryStrings.SelectExercise;
            grid1[newRowIndex, ExerciseColumnIndex].Column.Width             = 250;
            grid1[newRowIndex, CommentColumnIndex] = new SourceGrid.Cells.Cell(null, new MemoExEditEditor());
            readOnlyView = new SourceGrid.Cells.Views.Cell();
            //grid1[newRowIndex, 1].AddController(ee);
            grid1[newRowIndex, CommentColumnIndex].View = readOnlyView;
            grid1[newRowIndex, CommentColumnIndex].AddController(CommentableCellController);
            grid1[newRowIndex, CommentColumnIndex].Column.Width = 80;

            //string SerieRepetitionMask = string.Format(@"[0-9]*x[0-9]*[\{0}]?[0-9]*",System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            for (int i = 0; i < setNumber; i++)
            {
                //readOnlyView = new SourceGrid.Cells.Views.Cell();
                var maskEditor = new SetEditor();
                //maskEditor.MaskRegEx = SerieRepetitionMask;
                grid1[newRowIndex, StandardColumnNumber + i] = new SourceGrid.Cells.Cell(null, maskEditor);
                grid1[newRowIndex, StandardColumnNumber + i].AddController(serieCellValueChangedController);
                grid1[newRowIndex, StandardColumnNumber + i].AddController(popupMenuController);
                grid1[newRowIndex, StandardColumnNumber + i].View = new SetView();
            }
            UpdateCellsReadOnlyMode(grid1.Rows[newRowIndex]);
        }