Exemplo n.º 1
0
        private void AddToFavoritesButton_Click(object sender, EventArgs e)
        {
            Point p = RetrieveModel.PointToScreen(new System.Drawing.Point(0, AddToFavoritesButton.Height));

            MoleculeSelectorControl.AddToFavoritesList(QueryMolCtl, GetSearchType());
            QueryMolCtl.Focus();             // move focus away
        }
Exemplo n.º 2
0
        /// <summary>
        /// ShowFavoriteMoleculeMenu
        /// </summary>
        /// <param name="location"></param>
        /// <param name="molEditorCtl"></param>
        /// <param name="qc"></param>

        public static void SelectFavoriteMolecule(
            MoleculeControl molEditorCtl,
            QueryColumn qc = null)
        {
            MoleculeSelectorControl i = new MoleculeSelectorControl();

            i.MolEditorCtl = molEditorCtl;
            i.Qc           = qc;
            i.SelectFavoriteMolecule();
        }
Exemplo n.º 3
0
        /// <summary>
        /// ShowModelSelectionMenu - static method
        /// </summary>
        /// <param name="location"></param>
        /// <param name="molEditorCtl"></param>
        /// <param name="qc"></param>

        public static void ShowModelSelectionMenu(
            Point location,
            MoleculeControl molEditorCtl,
            StructureSearchType searchType,
            QueryColumn qc = null)
        {
            MoleculeSelectorControl i = new MoleculeSelectorControl();

            i.MolEditorCtl        = molEditorCtl;
            i.Qc                  = qc;
            i.StructureSearchType = searchType;
            i.NewMoleculeMenu.Show(location);
            return;
        }
Exemplo n.º 4
0
        private void OK_Click(object sender, EventArgs e)
        {
            Psc.Molecule = QueryMolCtl.Molecule.Clone();
            Psc.Molecule.RemoveStructureCaption();             // remove any structure caption that may cause a problem

            try
            {
                if (None.Checked || Lex.IsNullOrEmpty(Psc.Molecule.PrimaryValue))                 // say none if checked or no structure
                {
                    Psc.SearchType = StructureSearchType.Unknown;
                }
                else if (SubStruct.Checked)
                {
                    SSOptions.GetValues(Psc);
                }
                else if (Similarity.Checked)
                {
                    SimOptions.GetValues(Psc);
                }
                else if (Full.Checked)
                {
                    FSOptions.GetValues(Psc);
                }
                else if (SmallWorld.Checked)
                {
                    SmallWorldOptions.GetValues(Psc);
                    UpdateAssociatedSmallWorldQueryColumns(Psc);
                }

                else
                {
                    throw new Exception("No recognized search type checked");                  // shouldn't happen
                }
                Psc.ConvertToQueryColumnCriteria(Qc);
            }

            catch (Exception ex)
            {
                MessageBoxMx.ShowError(ex.Message);
                return;
            }

            MoleculeSelectorControl.AddToMruList(QueryMolCtl, Psc.SearchType);

            DialogResult = DialogResult.OK;
            return;
        }
Exemplo n.º 5
0
        /// <summary>
        /// ShowMruMoleculeMenu
        /// </summary>
        /// <param name="location"></param>
        /// <param name="molEditorCtl"></param>
        /// <param name="qc"></param>

        public static void SelectMruMolecule(
            MoleculeControl molEditorCtl,
            QueryColumn qc = null)
        {
            MoleculeSelectorControl i = new MoleculeSelectorControl();

            i.MolEditorCtl = molEditorCtl;
            i.Qc           = qc;
            MoleculeList sl = GetMruMoleculesList();

            i.Text = "Recent Query Structures";

            //for (int i1 = 0; i1 < sl.Count; i1++) // rename to integers 1 to N
            //{
            //	sl[i1].Name = (i1 + 1).ToString();
            //}

            i.StructureListControl.Setup(sl, i.ListItemSelectedCallback);
            i.ShowDialog(SessionManager.ActiveForm);
            return;
        }
Exemplo n.º 6
0
        private void RunQueryButton_Click(object sender, EventArgs e)
        {
            if (!ValidateFormAndBuildQuery())
            {
                return;
            }

            PreserveRelatedCheckmarkPreferences();

            MoleculeSelectorControl.AddToMruList(QueryMolCtl, StructureSearchType.Unknown);

            Query q = RelatedCompoundsQuery;

            this.Hide();
            bool success = QbUtil.RunPopupQuery(q, q.Name, OutputDest.WinForms, ExitingQueryResultsCallBack);

            if (!success)
            {
                this.Show();
            }

            return;
        }
Exemplo n.º 7
0
 private void RetrieveFavoritesButton_Click(object sender, EventArgs e)
 {
     MoleculeSelectorControl.SelectFavoriteMolecule(QueryMolCtl);
     QueryMolCtl.Focus();             // move focus away
 }
Exemplo n.º 8
0
        private void RetrieveModel_Click(object sender, EventArgs e)
        {
            Point p = RetrieveModel.PointToScreen(new System.Drawing.Point(0, RetrieveModel.Height));

            MoleculeSelectorControl.ShowModelSelectionMenu(p, QueryMolCtl, GetSearchType());
        }