コード例 #1
0
        private static int PopupPos = InitialPopupPos;         // incremental popup positioning

        /// <summary>
        /// Constructor
        /// </summary>
        public RelatedStructureBrowser()
        {
            InitializeComponent();

            RelatedStructuresControl.BorderStyle = BorderStyle.None;             // hide border needed at design time

            RSM = new RelatedStructureControlManager();
            RelatedStructuresControl.RSM = RSM;
            RSM.RSC = RelatedStructuresControl;

            return;
        }
コード例 #2
0
        void Initialize2(
            MRUEdit clc,
            Form parentForm,
            ContentsTreeControl contentsTree,
            bool newPopup)
        {
            QuickSearchPopup qsp = this;             // debug

            //if (newPopup) // just created?
            if (!Initialized)
            {
                Visible = false;
                //Width = 236; // set proper size
                //Height = 186;

                Point p  = clc.PointToScreen(new Point(0, clc.Bottom));
                Point p2 = parentForm.PointToClient(p);
                Left = p.X;                  // position below input control
                Top  = p.Y + clc.Height * 2;

                BringToFront();

                ContentsTree = contentsTree;

                RelatedStructuresControl rsp = RelatedStructuresControl;

                InitialStructurePanelWidth = StructurePanel.Width;                 //rsp.Width + 12; // initial StructurePanel width
                InitialStructurePanelWidthWithoutRelatedStructureOptions = rsp.MoleculeControl.Right + 10;

                //InitialStructurePanelWidth = 400; // debug

                InitialStructurePanelHeight = rsp.Top + rsp.MoleculeControl.Height + 15;                 // initial StructurePanel height to just below structure box
                StructurePanel.Dock         = DockStyle.Fill;

                OtherCidsList.Visible = false;

                MoleculeControl strBox     = RelatedStructuresControl.MoleculeControl; // make structure box wider to the left
                int             newBoxLeft = 4;
                int             dx         = strBox.Left - newBoxLeft;                 // amount to widen structure box
                int             w2         = strBox.Width + dx;
                int             h2         = strBox.Height;

                RSM = new RelatedStructureControlManager();
                RelatedStructuresControl.RSM = RSM;
                RSM.RSC = RelatedStructuresControl;
                RSM.HideUndefinedStructureList = true;                 // don't show structure panel until after search complete

                RelatedStructuresControl.RenderSearchResultsCompleteCallBack = RenderSearchResultsCompleteCallBack;

                RelatedStructuresControl.SetupCheckmarks();

                Initialized = true;
            }

            CommandLineControl  = clc;                 // associated command line comtrol
            clc.GotFocus       += CommandLine_GotFocus;
            clc.KeyDown        += CommandLine_KeyDown; // add command line events for us
            clc.KeyUp          += CommandLine_KeyUp;
            clc.PreviewKeyDown += CommandLine_PreviewKeyDown;

            if (!Timer.Enabled)
            {
                Timer.Enabled = true;
                PreviousInput = "";                 // need to clear to get redisplay of structure
            }

            return;
        }