Пример #1
0
        public override void Redraw(Rect region)
        {
            Driver.SetAttribute(ColorScheme.Normal);
            DrawFrame(region, padding: 0, fill: true);

            for (int i = 0; i < barItems.Children.Length; i++)
            {
                var item = barItems.Children [i];
                Move(1, i + 1);
                Driver.SetAttribute(item == null ? Colors.Base.Focus : i == current ? ColorScheme.Focus : ColorScheme.Normal);
                for (int p = 0; p < Frame.Width - 2; p++)
                {
                    if (item == null)
                    {
                        Driver.AddSpecial(SpecialChar.HLine);
                    }
                    else
                    {
                        Driver.AddRune(' ');
                    }
                }

                if (item == null)
                {
                    continue;
                }

                Move(2, i + 1);
                DrawHotString(item.Title,
                              i == current? ColorScheme.HotFocus : ColorScheme.HotNormal,
                              i == current ? ColorScheme.Focus : ColorScheme.Normal);

                // The help string
                var l = item.Help.Length;
                Move(Frame.Width - l - 2, 1 + i);
                Driver.AddStr(item.Help);
            }
        }