コード例 #1
0
        protected void LayoutControls()
        {
            if (rootConditionControl != null)
            {
                int subtreeWidth   = rootConditionControl.GetSubtreeWidth(horizontalMargin, 0);
                int centerX        = subtreeWidth / 2 + AutoScrollPosition.X;
                int verticalOffset = rootConditionControl.Height / 2 + verticalMargin + AutoScrollPosition.Y;
                rootConditionControl.Center = new Point(centerX, verticalOffset);

                rootConditionControl.LayoutChildControls(horizontalMargin, verticalMargin);
            }
        }
コード例 #2
0
        public override void LayoutChildControls(int horizontalMargin, int verticalMargin)
        {
            ConditionControlBase rightControl = SubconditionControls[0];
            ConditionControlBase leftControl  = SubconditionControls[1];

            int rihgtSubtreeWidth = rightControl.GetSubtreeWidth(horizontalMargin, 0);
            int leftSubtreeWidth  = leftControl.GetSubtreeWidth(horizontalMargin, 0);

            int x = Center.X + rihgtSubtreeWidth / 2;
            int y = Bounds.Bottom + 2 * verticalMargin + rightControl.Height / 2;

            //int y = Bounds.Y + Bounds.Height + 2 * verticalMargin + rightControl.Height / 2;
            rightControl.Center = new Point(x, y);


            x = Center.X - leftSubtreeWidth / 2;
            y = Bounds.Bottom + 2 * verticalMargin + leftControl.Height / 2;
            //y = Bounds.Y + Bounds.Height + 2 * verticalMargin + leftControl.Height / 2;
            leftControl.Center = new Point(x, y);

            base.LayoutChildControls(horizontalMargin, verticalMargin);
        }