Example #1
0
        /// <summary>
        /// Handle changes in the size of the underlying view.
        /// </summary>
        protected void OnViewSizeChanged(object sender, FwViewSizeEventArgs e)
        {
            // For now, just handle changes in the height.
            var vrl  = (VectorReferenceLauncher)Control;
            var view = (VectorReferenceView)vrl.MainControl;
            int hMin = ContainingDataTree.GetMinFieldHeight();
            int h1   = view.RootBox.Height;

            Debug.Assert(e.Height == h1);
            int hOld = TreeNode.Height;
            int hNew = Math.Max(h1, hMin) + 3;

            if (hNew != hOld)
            {
                // JohnT: why all these -1's?
                Height = hNew - 1;
                // JohnT: don't know why we need this, vrl is the slice's control and is supposed to
                // be docked to fill the slice. But if we don't do it, there are cases where
                // narrowing the window makes the slice higher but not the embedded control.
                // The tree node is also supposed to be docked, but again, if we don't do this
                // then the tree node doesn't fill the height of the window, and clicks at the
                // bottom of it may not work.
                TreeNode.Height = hNew - 1;
                vrl.Height      = hNew - 1;
                // This seems to be really not needed, the view height is docked to the launcher's.
//				view.Height = hNew - 1;
            }
            if (Height != hNew - 1)
            {
                Height = hNew - 1;
            }
        }
Example #2
0
        /// <summary>
        /// Handle changes in the size of the underlying view.
        /// </summary>
        protected void OnViewSizeChanged(object sender, FwViewSizeEventArgs e)
        {
            // For now, just handle changes in the height.
            PhoneEnvReferenceLauncher rl   = (PhoneEnvReferenceLauncher)this.Control;
            PhoneEnvReferenceView     view = (PhoneEnvReferenceView)rl.MainControl;

            if (ContainingDataTree == null)
            {
                return;                 // called too soon, from initial layout before connected.
            }
            int hMin = ContainingDataTree.GetMinFieldHeight();
            int h1   = view.RootBox.Height;

            Debug.Assert(e.Height == h1);
            int hOld = TreeNode == null ? 0 : TreeNode.Height;
            int hNew = Math.Max(h1, hMin) + 3;

            if (hNew != hOld)
            {
                if (TreeNode != null)
                {
                    TreeNode.Height = hNew;
                }
                Height = hNew - 1;
            }
        }
        /// <summary>
        /// Handle changes in the size of the underlying view.
        /// </summary>
        protected void OnViewSizeChanged(object sender, FwViewSizeEventArgs e)
        {
            // When height is more than one line (e.g., long definition without gloss),
            // this can get called initially before it has a parent.
            if (ContainingDataTree == null)
            {
                return;
            }
            // For now, just handle changes in the height.
            var arl  = (AtomicReferenceLauncher)Control;
            var view = (AtomicReferenceView)arl.MainControl;
            int hMin = ContainingDataTree.GetMinFieldHeight();
            int h1   = view.RootBox.Height;

            Debug.Assert(e.Height == h1);
            int hOld = TreeNode.Height;
            int hNew = Math.Max(h1, hMin) + 3;

            if (hNew > hOld)
            {
                TreeNode.Height = hNew;
                arl.Height      = hNew - 1;
                view.Height     = hNew - 1;
                Height          = hNew;
            }
        }
        /// <summary>
        /// This code exactly matches code in ReferenceVectorSlice; could we refactor somehow?
        /// </summary>
        /// <param name="e"></param>
        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);

            if (this.Width == m_dxLastWidth)
            {
                return;
            }

            m_dxLastWidth = Width;             // BEFORE doing anything, actions below may trigger recursive call.
            ReferenceLauncher rl   = (ReferenceLauncher)this.Control;
            SimpleRootSite    view = (SimpleRootSite)rl.MainControl;

            view.PerformLayout();
            int h1   = view.RootBox.Height;
            int hNew = Math.Max(h1, ContainingDataTree.GetMinFieldHeight());

            //When the slice is first created view.RootBox.Height is 0 and
            //GetMinFieldHeight returns a constant of 18 so this is too short
            //especially with Arabic scripts  (see LT-7327)
            hNew = Math.Max(hNew, Font.Height) + 3;
            if (hNew != this.Height)
            {
                this.Height = hNew;
            }
        }
Example #5
0
        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);
            if (Width == m_dxLastWidth)
            {
                return;
            }
            m_dxLastWidth = Width;             // BEFORE doing anything, actions below may trigger recursive call.
            var vrl  = (VectorReferenceLauncher)Control;
            var view = (VectorReferenceView)vrl.MainControl;

            view.PerformLayout();
            int h1   = view.RootBox.Height;
            int hNew = Math.Max(h1, ContainingDataTree.GetMinFieldHeight()) + 3;

            if (hNew != Height)
            {
                Height = hNew;
            }
        }
Example #6
0
        /// <summary>
        /// Handle changes in the size of the underlying view.
        /// </summary>
        protected void OnViewSizeChanged(object sender, FwViewSizeEventArgs e)
        {
            // For now, just handle changes in the height.
            AtomicReferenceLauncher arl  = (AtomicReferenceLauncher)this.Control;
            AtomicReferenceView     view = (AtomicReferenceView)arl.MainControl;
            int hMin = ContainingDataTree.GetMinFieldHeight();
            int h1   = view.RootBox.Height;

            Debug.Assert(e.Height == h1);
            int hOld = TreeNode.Height;
            int hNew = Math.Max(h1, hMin) + 3;

            if (hNew > hOld)
            {
                TreeNode.Height = hNew;
                arl.Height      = hNew - 1;
                view.Height     = hNew - 1;
                this.Height     = hNew;
            }
        }