Example #1
0
        public cFeedBackMessage Run()
        {
            WindowToDisplay = new FormForDisplay();

            if ((ControlToDisplay == null)||(ControlToDisplay.Controls.Count==0))
            {
                base.FeedBackMessage.IsSucceed = false;
                base.FeedBackMessage.Message += ": No input defined!";
                return base.FeedBackMessage;
            }
            else
            {
                //this.Title = ControlToDisplay.Title;

                ControlToDisplay.Width = WindowToDisplay.Width - 34;
                ControlToDisplay.Height = WindowToDisplay.Height - 50;

                ControlToDisplay.Controls[0].Width = WindowToDisplay.Width - 34;
                ControlToDisplay.Controls[0].Height = WindowToDisplay.Height - 50;

                ControlToDisplay.Location = new System.Drawing.Point(5, 5);

                ControlToDisplay.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom
                 | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
            }
            WindowToDisplay.Controls.Add(ControlToDisplay);

            WindowToDisplay.Text = base.Title;
            return base.FeedBackMessage;
        }
Example #2
0
        public cFeedBackMessage Run()
        {
            FormForDisplay WindowToDisplay = new FormForDisplay();
            WindowToDisplay.Text = "Plates Selection";
            WindowToDisplay.FormBorderStyle = FormBorderStyle.Sizable;

            PanelForPlatesSelection PlateSelectionPanel = new PanelForPlatesSelection(this.IsCheckBoxes, ListInitialPlates, IsCheckOnlyActive);
            PlateSelectionPanel.Height = WindowToDisplay.Height - 70;
            PlateSelectionPanel.Width = WindowToDisplay.Width - 30;
               // PlateSelectionPanel.SelectAll();
            //ClassSelectionPanel.Select(0);
            //ClassSelectionPanel.Select(1);
            PlateSelectionPanel.Location = new System.Drawing.Point(5, 5);
            //PlateSelectionPanel.Width = 300;
            //PlateSelectionPanel.Height = PlateSelectionPanel.ListCheckBoxes.Count * 25;
            PlateSelectionPanel.BorderStyle = BorderStyle.Fixed3D;
            PlateSelectionPanel.Anchor =(System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom
                        | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
            // MyPanel.Controls.Add(ClassSelectionPanel);

            Button ReturnButton = new Button();
            ReturnButton.Text = "Ok";
            ReturnButton.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);

            ReturnButton.DialogResult = DialogResult.OK;
            ReturnButton.Location = new System.Drawing.Point(PlateSelectionPanel.Location.X, PlateSelectionPanel.Location.Y + PlateSelectionPanel.Height );
            WindowToDisplay.Controls.Add(ReturnButton);

            WindowToDisplay.Controls.Add(PlateSelectionPanel);
            WindowToDisplay.Width = PlateSelectionPanel.Width + 28;
            WindowToDisplay.Height = PlateSelectionPanel.Height + ReturnButton.Height + 48;

            if (WindowToDisplay.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Selection aborded !";
                return FeedBackMessage;
            }

            this.ListSelectedPlates = PlateSelectionPanel.GetListSelectedPlates();

            if (this.ListSelectedPlates.Count == 0)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No class selected !";
                return FeedBackMessage;
            }
            return FeedBackMessage;
        }
Example #3
0
        void DisplayGraphItem(object sender, EventArgs e)
        {
            FormForDisplay TMPWin = new FormForDisplay();
            Panel Pan = new Panel();
            Pan.Show();

            cExtendedList ListValue = new cExtendedList();
            for (int Idx = 0; Idx < this.listViewForClassifHistory.Items.Count; Idx++)
            {
               // this.listViewForCellPopulations.Items[Idx];
                ListValue.Add(double.Parse(this.listViewForClassifHistory.Items[Idx].SubItems[2].Text));
            }

             //   ListValue.Name = this.dt.Columns[e.ColumnIndex].ColumnName;

            cPanelHisto PanelHisto = new cPanelHisto(ListValue, eGraphType.LINE, eOrientation.HORIZONTAL);
            TMPWin.Controls.Add(PanelHisto.WindowForPanelHisto.panelForGraphContainer);
            TMPWin.Show();
        }
Example #4
0
        public cFeedBackMessage Run()
        {
            //if (GlobalInfo == null)
            //{
            //    base.FeedBackMessage.IsSucceed = false;
            //    return base.FeedBackMessage;
            //}
            FormForDisplay WindowToDisplay = new FormForDisplay();
            WindowToDisplay.Text = "Class Selection";
            WindowToDisplay.FormBorderStyle = FormBorderStyle.FixedSingle;

            PanelForClassSelection ClassSelectionPanel = new PanelForClassSelection(this.IsCheckBoxes, this.ClassType);
            //ClassSelectionPanel.Height = WindowToDisplay.Height;

            if ((IsSelectAll) && (this.IsCheckBoxes))
            {
                ClassSelectionPanel.SelectAll();
            }
            else
            {
                ClassSelectionPanel.UnSelectAll();
                ClassSelectionPanel.Select(0);
                ClassSelectionPanel.Select(1);
            }
            ClassSelectionPanel.Location = new System.Drawing.Point(10, 10);
            ClassSelectionPanel.Width = 150;
            ClassSelectionPanel.Height = ClassSelectionPanel.ListCheckBoxes.Count * 25;
            ClassSelectionPanel.BorderStyle = BorderStyle.Fixed3D;
            // MyPanel.Controls.Add(ClassSelectionPanel);

            Button ReturnButton = new Button();
            ReturnButton.Text = "Ok";
            ReturnButton.DialogResult = DialogResult.OK;
            ReturnButton.Location = new System.Drawing.Point(ClassSelectionPanel.Location.X, ClassSelectionPanel.Location.Y + ClassSelectionPanel.Height + 5);
            WindowToDisplay.Controls.Add(ReturnButton);

            WindowToDisplay.Controls.Add(ClassSelectionPanel);
            WindowToDisplay.Width = ClassSelectionPanel.Width + 28;
            WindowToDisplay.Height = ClassSelectionPanel.Height + ReturnButton.Height + 48;

            if (WindowToDisplay.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Selection aborded !";
                return FeedBackMessage;
            }

            List<bool> ListBool = ClassSelectionPanel.GetListSelectedClass();

            int NumSelected = 0;
            this.ListSelectedClass = new cExtendedList();
            foreach (var item in ListBool)
            {
                if (item)
                {
                    this.ListSelectedClass.Add(1);
                    NumSelected++;
                }
                else
                    this.ListSelectedClass.Add(0);
            }

            if (NumSelected == 0)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No class selected !";
                return FeedBackMessage;
            }

            return FeedBackMessage;
        }
Example #5
0
        public cFeedBackMessage Run()
        {
            FormForDisplay WindowToDisplay = new FormForDisplay();
            WindowToDisplay.Text = "Well Properties Selection";
            WindowToDisplay.FormBorderStyle = FormBorderStyle.Sizable;

            WellPropertySelection = new PanelForWellPropertySelection(this.IsCheckBoxes);
            if (this.IsCheckBoxes == false)
            {
                if (IsCheckOnlyActive)
                {

                    // get the active property
                    foreach (var item in cGlobalInfo.WindowHCSAnalyzer.toolStripDropDownButtonDisplayMode.DropDownItems)
                    {
                        if (item.GetType() == typeof(ToolStripMenuItem))
                        {
                            ToolStripMenuItem TmpMenuItem = ((ToolStripMenuItem)item);
                            if (TmpMenuItem.Checked)
                            {
                                int IdxToBeChecked = 0;
                                foreach (var ItemFromList in WellPropertySelection.ListRadioButtons)
                                {
                                    if (ItemFromList.Tag == TmpMenuItem.Tag)
                                    {
                                        WellPropertySelection.Select(IdxToBeChecked);
                                        goto ENDLOOP;
                                    }
                                    IdxToBeChecked++;
                                }
                                break;
                            }
                        }
                    }
                }
                //else
                    WellPropertySelection.Select(0);
            }

            ENDLOOP: ;
            //WellPropertySelection.GetListSelectedPlates();
            WellPropertySelection.Height = WindowToDisplay.Height - 70;
            WellPropertySelection.Width = WindowToDisplay.Width - 30;
               // PlateSelectionPanel.SelectAll();
            //ClassSelectionPanel.Select(0);
            //ClassSelectionPanel.Select(1);
            WellPropertySelection.Location = new System.Drawing.Point(5, 5);
            //PlateSelectionPanel.Width = 300;
            //PlateSelectionPanel.Height = PlateSelectionPanel.ListCheckBoxes.Count * 25;
            WellPropertySelection.BorderStyle = BorderStyle.Fixed3D;
            WellPropertySelection.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom
                        | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
            // MyPanel.Controls.Add(ClassSelectionPanel);

            Button ReturnButton = new Button();
            ReturnButton.Text = "Ok";
            ReturnButton.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);

            ReturnButton.DialogResult = DialogResult.OK;
            ReturnButton.Location = new System.Drawing.Point(WellPropertySelection.Location.X, WellPropertySelection.Location.Y + WellPropertySelection.Height);
            WindowToDisplay.Controls.Add(ReturnButton);

            WindowToDisplay.Controls.Add(WellPropertySelection);
            WindowToDisplay.Width = WellPropertySelection.Width + 28;
            WindowToDisplay.Height = WellPropertySelection.Height + ReturnButton.Height + 48;

            if (WindowToDisplay.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Selection aborded !";
                return FeedBackMessage;
            }

            //this.ListSelectedPlates = PlateSelectionPanel.GetListSelectedPlates();

            //if (this.ListSelectedPlates.Count == 0)
            //{
            //    FeedBackMessage.IsSucceed = false;
            //    FeedBackMessage.Message = "No class selected !";
            //    return FeedBackMessage;
            //}
            return FeedBackMessage;
        }
Example #6
0
        public cFeedBackMessage Run()
        {
            FormForDisplay WindowToDisplay = new FormForDisplay();
            WindowToDisplay.Text = "Class Selection";
            WindowToDisplay.FormBorderStyle = FormBorderStyle.FixedSingle;

            PanelForClassSelection ClassSelectionPanel = new PanelForClassSelection( this.IsCheckBoxes, this.ClassType);

            //ClassSelectionPanel.Height = WindowToDisplay.Height;
            if (this.IsSelectAll && this.IsCheckBoxes)
            {
                ClassSelectionPanel.SelectAll();
            }
            else
            {
                ClassSelectionPanel.UnSelectAll();
                ClassSelectionPanel.Select(0);
                ClassSelectionPanel.Select(1);
            }
            ClassSelectionPanel.Location = new System.Drawing.Point(10, 10);
            ClassSelectionPanel.Width = 150;

            if(IsCheckBoxes)
                ClassSelectionPanel.Height = ClassSelectionPanel.ListCheckBoxes.Count*25;
            else
                ClassSelectionPanel.Height = ClassSelectionPanel.ListRadioButtons.Count * 25;
            ClassSelectionPanel.BorderStyle = BorderStyle.Fixed3D;
               // MyPanel.Controls.Add(ClassSelectionPanel);

            Button ReturnButton = new Button();
            ReturnButton.Text = "Ok";
            ReturnButton.DialogResult = DialogResult.OK;
            ReturnButton.Location = new System.Drawing.Point(ClassSelectionPanel.Location.X, ClassSelectionPanel.Location.Y + ClassSelectionPanel.Height + 5);
            WindowToDisplay.Controls.Add(ReturnButton);

            WindowToDisplay.Controls.Add(ClassSelectionPanel);
            WindowToDisplay.Width = ClassSelectionPanel.Width + 28;
            WindowToDisplay.Height = ClassSelectionPanel.Height + ReturnButton.Height+ 48;

            if (WindowToDisplay.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Selection aborded !";
                return FeedBackMessage;
            }

            List<bool> ListBool = ClassSelectionPanel.GetListSelectedClass();

            int NumSelected = 0;

            this.ListSelectedClass = new cExtendedTable();
            this.ListSelectedClass.Name = "List Class Selected";
            this.ListSelectedClass.Add(new cExtendedList());

            this.ListSelectedClass[0].ListTags = new List<object>();

            int Idx = 0;
            foreach (var item in ListBool)
            {
                if (item)
                {
                    this.ListSelectedClass[0].Add(1);
                    if(this.ClassType== eClassType.WELL)
                        this.ListSelectedClass[0].ListTags.Add(cGlobalInfo.ListWellClasses[Idx]);
                    else if(this.ClassType == eClassType.PHENOTYPE)
                        this.ListSelectedClass[0].ListTags.Add(cGlobalInfo.ListCellularPhenotypes[Idx]);

                    NumSelected++;
                }
                else
                {
                    this.ListSelectedClass[0].Add(0);
                    this.ListSelectedClass[0].ListTags.Add(null);

                }
                Idx++;
            }

            if (NumSelected==0)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No class selected !";
                return FeedBackMessage;
            }

            //if (NumSelected < MinNumberOfClass)
            //{
            //    FeedBackMessage.IsSucceed = false;
            //    FeedBackMessage.Message = "At least "+MinNumberOfClass+" class have to be selected !";
            //    return FeedBackMessage;
            //}

            return FeedBackMessage;
        }
Example #7
0
        private void displayReferenceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (cGlobalInfo.CurrentScreening.Reference == null)
            {
                MessageBox.Show("No reference curve generated. Switch to Distribution mode.\n", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            FormForDisplay TMPWin = new FormForDisplay();
            cExtendedList ListValues = cGlobalInfo.CurrentScreening.Reference.GetValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx);
            ListValues.Name = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();

            cPanelHisto PanelHisto = new cPanelHisto(ListValues, eGraphType.HISTOGRAM, eOrientation.HORIZONTAL);

            //  cDisplayHisto CpdToDisplayHisto = new cDisplayHisto();
            TMPWin.Controls.Add(PanelHisto.WindowForPanelHisto.panelForGraphContainer);

            //TMPWin.panel.Controls.Add(CpdToDisplayHisto);
            TMPWin.ShowDialog();

            //  cWindowToDisplayHisto NewWindow = new cWindowToDisplayHisto(CompleteScreening,CompleteScreening.Reference.GetValues(CompleteScreening.ListDescriptors.CurrentSelectedDescriptor));
            //   NewWindow.Show();
            //    NewWindow.chartForSimpleForm.ChartAreas.Add(CurrentChartArea);

            // cWindowToDisplayScatter NewWindow = new cWindowToDisplayScatter();
            //   NewWindow.chartForSimpleForm.Controls.Add(CompleteScreening.Reference.GetChart(CompleteScreening.ListDescriptors.CurrentSelectedDescriptor));
            //  NewWindow.Show();
            //cDisplayGraph DispGraph = new cDisplayGraph(CompleteScreening.Reference[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].ToArray(),
            //    CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName() + " - Reference distribution.");
        }
        public cFeedBackMessage Run(cGlobalInfo GlobalInfo)
        {
            FormForDisplay WindowToDisplay = new FormForDisplay();
            WindowToDisplay.Text = "2 Classes Selection";
            WindowToDisplay.FormBorderStyle = FormBorderStyle.FixedSingle;

            PanelForClassSelection ClassSelectionPanel1 = new PanelForClassSelection(PanelLeft_IsCheckBoxes, this.ClassType);
            ClassSelectionPanel1.UnSelectAll();
            ClassSelectionPanel1.Select(0);
            ClassSelectionPanel1.Location = new System.Drawing.Point(10, 10);
            ClassSelectionPanel1.Width = 140;
            if(ClassSelectionPanel1.ListCheckBoxes!=null)
                ClassSelectionPanel1.Height = ClassSelectionPanel1.ListCheckBoxes.Count*25;
            else
                ClassSelectionPanel1.Height = ClassSelectionPanel1.ListRadioButtons.Count * 25;
            ClassSelectionPanel1.BorderStyle = BorderStyle.Fixed3D;

            PanelForClassSelection ClassSelectionPanel2 = new PanelForClassSelection( PanelRight_IsCheckBoxes, this.ClassType);
            ClassSelectionPanel2.UnSelectAll();
            ClassSelectionPanel2.Select(1);
            ClassSelectionPanel2.Location = new System.Drawing.Point(10 + ClassSelectionPanel1.Width, 10);
            ClassSelectionPanel2.Width = 140;
            if (ClassSelectionPanel2.ListCheckBoxes != null)
                ClassSelectionPanel2.Height = ClassSelectionPanel2.ListCheckBoxes.Count * 25;
            else
                ClassSelectionPanel2.Height = ClassSelectionPanel2.ListRadioButtons.Count * 25;
            ClassSelectionPanel2.BorderStyle = BorderStyle.Fixed3D;

            Button ReturnButton = new Button();
            ReturnButton.Text = "Ok";
            ReturnButton.DialogResult = DialogResult.OK;
            ReturnButton.Location = new System.Drawing.Point(ClassSelectionPanel1.Location.X, ClassSelectionPanel1.Location.Y + ClassSelectionPanel1.Height + 5);
            WindowToDisplay.Controls.Add(ReturnButton);

            WindowToDisplay.Controls.Add(ClassSelectionPanel1);
            WindowToDisplay.Controls.Add(ClassSelectionPanel2);
            WindowToDisplay.Width = ClassSelectionPanel1.Width + ClassSelectionPanel2.Width + 28;
            WindowToDisplay.Height = ClassSelectionPanel1.Height + ReturnButton.Height+ 48;

            if (WindowToDisplay.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Selection aborded !";
                return FeedBackMessage;
            }

            List<bool> ListBool1 = ClassSelectionPanel1.GetListSelectedClass();
            List<bool> ListBool2 = ClassSelectionPanel2.GetListSelectedClass();

            int NumSelected = 0;
            this.ListSelectedClass = new cExtendedTable();

            foreach (var item in ListBool1)
            {
                this.ListSelectedClass.Add(new cExtendedList());
                if (item)
                {
                    this.ListSelectedClass[0].Add(1);
                    NumSelected++;
                }
                else
                    this.ListSelectedClass[0].Add(0);
            }
            foreach (var item in ListBool2)
            {
                this.ListSelectedClass.Add(new cExtendedList());
                if (item)
                {
                    this.ListSelectedClass[1].Add(1);
                    NumSelected++;
                }
                else
                    this.ListSelectedClass[1].Add(0);
            }

            return FeedBackMessage;
        }