public ExpertWeightedJudgementPollPanel(int index, Alternative alternative, OnAnsweredHandler answeredHandler) : base() { BackColor = defaultColor; Location = new Point(3, 3); Name = "pollPanel"; Size = new Size(759, 125); TabIndex = 14; // // indexLabel // indexLabel = new Label(); indexLabel.AutoSize = true; indexLabel.Font = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(204))); indexLabel.Location = new Point(3, 12); indexLabel.Name = "indexLabel"; indexLabel.Size = new Size(25, 24); indexLabel.TabIndex = 14; indexLabel.Tag = "index"; indexLabel.Text = index + "."; // // allternativeLabel // allternativeLabel = new Label(); allternativeLabel.Font = new Font("Microsoft Sans Serif", 13F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(204))); allternativeLabel.Location = new Point(44, 12); allternativeLabel.Name = "allternativeLabel"; allternativeLabel.Size = new Size(553, 51); allternativeLabel.TabIndex = 12; allternativeLabel.Text = alternative.description; // // estimateLabel // estimateLabel = new Label(); estimateLabel.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); estimateLabel.Location = new Point(652, 0); estimateLabel.Name = "estimateLabel"; estimateLabel.Size = new Size(107, 34); estimateLabel.TabIndex = 19; estimateLabel.Text = "Оценка:"; estimateLabel.TextAlign = ContentAlignment.MiddleCenter; // // estimateNumeric // estimateNumeric = new NumericUpDown(); estimateNumeric.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); estimateNumeric.Location = new Point(652, 37); estimateNumeric.Name = "estimateNumeric"; estimateNumeric.Size = new Size(104, 26); estimateNumeric.TabIndex = 18; estimateNumeric.ValueChanged += new EventHandler(numericUpDown1_ValueChanged); estimateNumeric.ValueChanged += (sender, e) => answeredHandler?.Invoke(index, (int)estimateNumeric.Value); estimateNumeric.Maximum = ExpertWeightedJudgementTest.pointsRemaining; // Controls.Add(indexLabel); Controls.Add(allternativeLabel); Controls.Add(estimateLabel); Controls.Add(estimateNumeric); }
public ExpertFullPairPollPanel(int index, Alternative[] alternativePair, OnAnsweredHandler answeredHandler, int trackBarMaxValue, Matrix matrix) : this(index, alternativePair, answeredHandler, trackBarMaxValue) { int value = (int)Math.Round(matrix.values[alternativePair[0].index, alternativePair[1].index] * trackBarMaxValue, MidpointRounding.AwayFromZero); value = value > trackBarMaxValue ? trackBarMaxValue : value; value = value < 0 ? 0 : value; trackBar.Value = value; BackColor = answeredColor; isAnswered = true; }
public ExpertWeightedJudgementPollPanel(int index, Alternative alternative, OnAnsweredHandler clickedHandler, Matrix matrix) : this(index, alternative, clickedHandler) { int value = (int)Math.Round(matrix.values[0, index] * ExpertWeightedJudgementTest.MAX_POINTS, MidpointRounding.AwayFromZero); estimateNumeric.Value = value; if (value == 0) { BackColor = defaultColor; } else { BackColor = answeredColor; } }
public ExpertRangPollPanel(int index, Alternative alternative, OnAnsweredHandler clickedHandler, Matrix matrix) : this(index, alternative, clickedHandler) { int value = (int)Math.Round(matrix.values[0, index], MidpointRounding.AwayFromZero); if (value < estimateNumeric.Minimum) { BackColor = defaultColor; } else { estimateNumeric.Value = value; BackColor = answeredColor; isAnswered = true; } }
public PollPanel(int index, Alternative[] alternativePair, OnAnsweredHandler answeredHandler, Matrix matrix) : this(index, alternativePair, answeredHandler) { BackColor = answeredColor; if (Math.Abs(matrix.values[alternativePair[0].index, alternativePair[1].index] - 1.0d) < 0.01) { answersCheckedListBox.SetItemChecked(0, true); } else if (Math.Abs(matrix.values[alternativePair[1].index, alternativePair[0].index] - 1.0d) < 0.01) { answersCheckedListBox.SetItemChecked(1, true); } else if (Math.Abs(matrix.values[alternativePair[0].index, alternativePair[1].index] - 0.5d) < 0.01 && Math.Abs(matrix.values[alternativePair[1].index, alternativePair[0].index] - 0.5d) < 0.01) { answersCheckedListBox.SetItemChecked(0, true); answersCheckedListBox.SetItemChecked(1, true); } else { BackColor = defaultColor; } }
public PollPanel(int index, Alternative[] alternativePair, OnAnsweredHandler answeredHandler) : base() { BackColor = defaultColor; Location = new Point(3, 3); Name = "pollPanel"; Size = new Size(759, 125); TabIndex = 14; // // indexLabel // indexLabel = new Label(); indexLabel.AutoSize = true; indexLabel.Font = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(204))); indexLabel.Location = new Point(3, 12); indexLabel.Name = "label4"; indexLabel.Size = new Size(25, 24); indexLabel.TabIndex = 14; indexLabel.Tag = "index"; indexLabel.Text = (index + 1).ToString() + "."; // // answersCheckedListBox // answersCheckedListBox = new CheckedListBox(); answersCheckedListBox.Font = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); answersCheckedListBox.FormattingEnabled = true; answersCheckedListBox.Location = new Point(4, 50); answersCheckedListBox.Name = "answersCheckedListBox"; answersCheckedListBox.Size = new Size(752, 52); answersCheckedListBox.TabIndex = 13; answersCheckedListBox.CheckOnClick = true; answersCheckedListBox.ItemCheck += (sender, e) => { BackColor = answeredColor; int checkedIndicesCount = answersCheckedListBox.CheckedItems.Count; if (e.NewValue == CheckState.Unchecked) { checkedIndicesCount--; } else if (e.NewValue == CheckState.Checked) { checkedIndicesCount++; } answeredHandler?.Invoke(index, new int[] { alternativePair[0].index, alternativePair[1].index }, checkedIndicesCount, e.Index); }; answersCheckedListBox.Items.Clear(); for (int j = 0; j < alternativePair.Length; j++) { answersCheckedListBox.Items.Add(alternativePair[j].description); } // // questionLabel // questionLabel = new Label(); questionLabel.AutoSize = true; questionLabel.Font = new Font("Microsoft Sans Serif", 13F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(204))); questionLabel.Location = new Point(44, 12); questionLabel.Name = "label2"; questionLabel.Size = new Size(524, 22); questionLabel.TabIndex = 12; questionLabel.Text = "Какой вариант по Вашему мнению наиболее удачный?"; // Controls.Add(indexLabel); Controls.Add(answersCheckedListBox); Controls.Add(questionLabel); }
public ExpertFullPairPollPanel(int index, Alternative[] alternativePair, OnAnsweredHandler answeredHandler, int trackBarMaxValue) : base() { questionIndex = index; this.answeredHandler = answeredHandler; BackColor = defaultColor; Location = new Point(3, 3); Name = "pollPanel"; Size = new Size(759, 161); // // indexLabel // indexLabel = new Label(); indexLabel.AutoSize = true; indexLabel.Font = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(204))); indexLabel.Location = new Point(10, 14); indexLabel.Name = "indexLabel"; indexLabel.Size = new Size(25, 24); indexLabel.TabIndex = 16; indexLabel.Tag = "index"; indexLabel.Text = index + "."; // // label2 // descriptionLabel = new Label(); descriptionLabel.AutoSize = true; descriptionLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); descriptionLabel.Location = new System.Drawing.Point(44, 12); descriptionLabel.Name = "label2"; descriptionLabel.Size = new System.Drawing.Size(524, 22); descriptionLabel.TabIndex = 12; descriptionLabel.Text = "Какой вариант по Вашему мнению наиболее удачный?"; // // trackBar1 // trackBar = new TrackBar(); trackBar.Location = new System.Drawing.Point(4, 108); trackBar.Name = "trackBar"; trackBar.Size = new System.Drawing.Size(752, 45); trackBar.TabIndex = 15; trackBar.Maximum = trackBarMaxValue; trackBar.Value = trackBar.Maximum / 2; trackBar.ValueChanged += trackBar_ValueChanged; // // label5 // alternative0Label = new Label(); alternative0Label.BackColor = System.Drawing.Color.White; alternative0Label.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; alternative0Label.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); alternative0Label.Location = new System.Drawing.Point(4, 50); alternative0Label.Name = "alternative0Label"; alternative0Label.Size = new System.Drawing.Size(375, 55); alternative0Label.TabIndex = 16; alternative0Label.Text = alternativePair[0].description; alternative0Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label6 // alternative1Label = new Label(); alternative1Label.BackColor = System.Drawing.Color.White; alternative1Label.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; alternative1Label.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); alternative1Label.Location = new System.Drawing.Point(382, 50); alternative1Label.Name = "alternative1Label"; alternative1Label.Size = new System.Drawing.Size(374, 55); alternative1Label.TabIndex = 17; alternative1Label.Text = alternativePair[1].description; alternative1Label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // Controls.Add(indexLabel); Controls.Add(descriptionLabel); Controls.Add(alternative0Label); Controls.Add(alternative1Label); Controls.Add(trackBar); }
public ExpertRangPollPanel(int index, Alternative alternative, OnAnsweredHandler answeredHandler) : base() { questionIndex = index; this.answeredHandler = answeredHandler; BackColor = defaultColor; Location = new Point(3, 3); Name = "pollPanel"; Size = new Size(759, 125); // // indexLabel // indexLabel = new Label(); indexLabel.AutoSize = true; indexLabel.Font = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(204))); indexLabel.Location = new Point(10, 14); indexLabel.Name = "indexLabel"; indexLabel.Size = new Size(25, 24); indexLabel.TabIndex = 16; indexLabel.Tag = "index"; indexLabel.Text = index + "."; // // allternativeLabel // allternativeLabel = new Label(); allternativeLabel.Font = new Font("Microsoft Sans Serif", 13F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(204))); allternativeLabel.Location = new Point(51, 14); allternativeLabel.Name = "allternativeLabel"; allternativeLabel.Size = new Size(568, 51); allternativeLabel.TabIndex = 15; allternativeLabel.Text = alternative.description; // // estimateLabel // estimateLabel = new Label(); estimateLabel.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); estimateLabel.Location = new Point(649, 7); estimateLabel.Name = "estimateLabel"; estimateLabel.Size = new Size(107, 34); estimateLabel.TabIndex = 21; estimateLabel.Text = "Оценка:"; estimateLabel.TextAlign = ContentAlignment.MiddleCenter; // // estimateNumeric // estimateNumeric = new NumericUpDown(); estimateNumeric.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); estimateNumeric.Location = new Point(649, 44); estimateNumeric.Maximum = 10; estimateNumeric.Minimum = 0; estimateNumeric.Name = "estimateNumeric"; estimateNumeric.Size = new Size(104, 26); estimateNumeric.TabIndex = 20; estimateNumeric.Value = 0; estimateNumeric.ValueChanged += estimateNumeric_ValueChanged; // Controls.Add(indexLabel); Controls.Add(allternativeLabel); Controls.Add(estimateLabel); Controls.Add(estimateNumeric); }