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. AtomicReferenceLauncher arl = (AtomicReferenceLauncher)this.Control; AtomicReferenceView view = (AtomicReferenceView)arl.MainControl; view.PerformLayout(); int h1 = view.RootBox.Height; int hNew = Math.Max(h1, ContainingDataTree.GetMinFieldHeight()) + 3; if (hNew != this.Height) { this.Height = hNew; } }
/// <summary> /// Keep the view width equal to the launcher width minus the button width. /// </summary> /// <param name="e"></param> protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); if (m_panel != null && m_atomicRefView != null) { int w = Width - m_panel.Width; int h1 = RootBoxHeight; if (w < 0) { w = 0; } if (w == m_atomicRefView.Width) { return; // cuts down on recursive calls. } m_atomicRefView.Width = w; m_atomicRefView.PerformLayout(); int h2 = RootBoxHeight; CheckViewSizeChanged(h1, h2); } }