示例#1
0
        private void InitializeComponent()
        {
            fStatusBar     = new StatusBar();
            sbpCurrentFps  = new StatusBarPanel();
            sbpKeysControl = new StatusBarPanel();

            SuspendLayout();

            sbpCurrentFps.Alignment = HorizontalAlignment.Center;
            sbpCurrentFps.AutoSize  = StatusBarPanelAutoSize.Contents;
            sbpCurrentFps.Text      = "Current: -- FPS";

            sbpKeysControl.Alignment = HorizontalAlignment.Left;
            sbpKeysControl.AutoSize  = StatusBarPanelAutoSize.Contents;
            sbpKeysControl.Text      = "Debug (D); Free-rotate (R); Time stop (T)";

            fStatusBar.Panels.AddRange(new StatusBarPanel[] { sbpCurrentFps, sbpKeysControl });
            fStatusBar.ShowPanels = true;

            fTreeVizView        = new TreeVizControl();
            fTreeVizView.Parent = this;
            fTreeVizView.Dock   = DockStyle.Fill;

            Controls.AddRange(new Control[] { fTreeVizView, fStatusBar });
            Size          = new Size(800, 600);
            StartPosition = FormStartPosition.CenterScreen;
            SizeChanged  += Form_SizeChanged;
            Activated    += Form_Activated;
            Load         += Form_Load;
            Closing      += Form_Closed;

            ResumeLayout();
        }
示例#2
0
        public void Update()
        {
            // to recalculate the coordinates of the spouses, because the coordinates of this person could change
            // "genSlice / 3" - it's radius of spouses
            PointF[] pts = TreeVizControl.GetCirclePoints(BeautySpouses, Pt, Spouses.Count, GenSlice / 3);
            for (int i = 0, count = Spouses.Count; i < count; i++)
            {
                TVPerson spp = Spouses[i];
                spp.Pt = pts[i];
            }

            // recalculate coordinates of visible children
            pts = TreeVizControl.GetCirclePoints(BeautyChilds, Pt, Childs.Count, BaseRadius / 2);
            for (int i = 0, count = Childs.Count; i < count; i++)
            {
                TVPerson chp = Childs[i];
                chp.Pt = pts[i];
            }
        }