Bloom.Workspace.WorkspaceView.HandleTabTextChanged C# (CSharp) Метод

HandleTabTextChanged() приватный Метод

Adjust the tool panel location when the chosen localization changes. See https://jira.sil.org/browse/BL-1212 for what can happen if we don't adjust. At the moment, we only widen, we never narrow the overall area allotted to the tab buttons. Button widths adjust themselves automatically to their Text width. There doesn't seem to be a built-in mechanism to limit the width to a given maximum so we implement such an operation ourselves.
private HandleTabTextChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        void HandleTabTextChanged(object sender, EventArgs e)
        {
            var btn = sender as Messir.Windows.Forms.TabStripButton;
            if (btn != null)
            {
                const string kEllipsis = "\u2026";
                // Preserve the original string as the tooltip.
                if (!btn.Text.EndsWith(kEllipsis))
                    btn.ToolTipText = btn.Text;
                // Ensure the button width is no more than 110 pixels.
                if (btn.Width > 110)
                {
                    using (Graphics g = btn.Owner.CreateGraphics())
                    {
                        btn.Text = ShortenStringToFit(btn.Text, 110, btn.Width, btn.Font, g);
                    }
                }
            }
            AdjustToolPanelLocation(false);
        }