Ejemplo n.º 1
0
            public FindPersonThread(FamilyTreeStoreBaseClass familyTree, string personXref, HandleNewIndividual individualCallback)
            {
                this.familyTree  = familyTree;
                backgroundWorker = new BackgroundWorker();

                this.personCallback      = individualCallback;
                backgroundWorker.DoWork += new DoWorkEventHandler(DoWork);
                //backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Completed);
                backgroundWorker.RunWorkerAsync(personXref);
                this.personXref = personXref;
                trace.TraceInformation("FindPersonThread(" + personXref + ")-started");
            }
Ejemplo n.º 2
0
        public AsyncTreePanel1()
        {
            scaleFactorVertical = (float)(0.0);
            personControlList   = new Dictionary <string, IndividualButton>();
            familyControlList   = new Dictionary <string, FamilyButton>();
            personThreadList    = new Dictionary <string, FindPersonThread>();
            familyThreadList    = new Dictionary <string, FindFamilyThread>();

            generationNoCtrl = new ComboBox();

            layout = new TreeViewLayout();
            for (int i = 9; i >= 2; i--)
            {
                generationNoCtrl.Items.Add(i.ToString());
            }
            //generationNoCtrl.Font = new System.Drawing.Font("Segue UI", 9F);
            //scaleFactorVertical = (float)generationNoCtrl.Font.Height / (float)generationNoCtrl.Font.Size;
            generationNoCtrl.SelectedItem = layout.GetGenerations().ToString();
            //generationNoCtrl.Width = (int)(40 * scaleFactorVertical);
            //generationNoCtrl.Height = (int)(generationNoCtrl.Font.Height * 1.5);

            font = new System.Drawing.Font("Segue UI", 9F);

            SetControlSize(generationNoCtrl, 25, font);

            //generationNoCtrl.SelectedItemChanged += GenerationNoCtrl_SelectedItemChanged;

            this.Controls.Add(generationNoCtrl);

            generationNoChange      = new Button();
            generationNoChange.Text = "Go";
            generationNoChange.Left = generationNoCtrl.Right;
            //generationNoChange.Font = new System.Drawing.Font("Segue UI", 9F);
            //Debug.WriteLine("fontsize " + generationNoChange.Font.Height + " sz " + generationNoChange.Font.Size + " sz-pt " + generationNoChange.Font.SizeInPoints);
            //generationNoChange.Width = (int)(30 * scaleFactorVertical);
            generationNoChange.MouseClick += generationNoChange_MouseClick;
            //generationNoChange.Height = (int)(generationNoChange.Font.Height * 1.5);
            SetControlSize(generationNoChange, 20, font);
            this.Controls.Add(generationNoChange);

            /*Button check = new Button();
             * check.Text = "Check";
             * check.Left = generationNoChange.Right;
             * //check.Width = (int)(50 * scaleFactorVertical);
             * check.MouseClick += check_MouseClick;
             * //check.Font = new System.Drawing.Font("Segue UI", 9F);
             * //check.Height = (int)(check.Font.Height * 1.5);
             * SetControlSize(check, 40, font);
             * this.Controls.Add(check);
             */
            /*Button force = new Button();
             * force.Text = "Force";
             * force.Left = check.Right;
             * //force.Width = (int)(50 * scaleFactorVertical);
             * force.MouseClick += force_MouseClick;
             * //force.Font = new System.Drawing.Font("Segue UI", 9F);
             * //force.Height = (int)(force.Font.Height * 1.5);
             * SetControlSize(force, 40, font);
             * this.Controls.Add(force);
             */
            mainPanel = new Panel();
            //mainPanel.VerticalScroll.Visible = true;
            //mainPanel.HorizontalScroll.Visible = true;
            mainPanel.AutoScroll = true;
            mainPanel.Dock       = DockStyle.Fill;
            mainPanel.Top        = generationNoCtrl.Bottom;
            //SetStyle(ControlStyles.FixedHeight | ControlStyles.FixedWidth, true);
            //ScrollBars =
            //AutoScroll = true;
            mainPanel.Font = font;// new System.Drawing.Font("Segue UI", 9F);
            this.Controls.Add(mainPanel);

            parentForm = null;

            trace.TraceInformation("AsyncTreePanel1::AsyncTreePanel1()");



            handleNewIndividual = new HandleNewIndividual(HandleNewIndividual_Function);
            handleNewFamily     = new HandleNewFamily(HandleNewFamily_Function);

            //this.VScroll = true;
            //this.HScroll = true;
            //SetStyle(ControlStyles.FixedHeight | ControlStyles.FixedWidth, true);
            //ScrollBars =
            //AutoScroll = true;
            this.Dock = DockStyle.Fill;

            updateDelay = null;

            this.VisibleChanged += TreeViewPanel_VisibleChanged;
        }