Пример #1
0
        private void renderBox()
        {
            if (_element.HasColors)
            {
                this.renderColor();
            }
            ConsoleUIPrimitives uiPrimitives = new ConsoleUIPrimitives(_console);
            int columnTo = _element.Column + _element.Width - 1;
            int rowTo    = _element.Row + _element.Height - 1;

            uiPrimitives.DrawBox(_element.Column, columnTo, _element.Row, rowTo);
        }
Пример #2
0
        public void UpdateFieldText(string screenName, string fieldName, string text)
        {
            ConsoleScreenRenderer renderer = new ConsoleScreenRenderer();
            ConsoleScreen         screen   = this.GetScreen(screenName);

            if (screen != null)
            {
                ConsoleUIElement element = this.GetScreenElement(screenName, fieldName);
                int lenght = element.Text.Length;
                element.Text = ConsoleUIPrimitives.GetRepeatedChars(" ", lenght);
                renderer.RenderUIElement(element, _console);
                element.Text = text;
                renderer.RenderUIElement(element, _console);
            }
        }
Пример #3
0
        private void renderTabs()
        {
            ConsoleUIPrimitives uiPrimitives = new ConsoleUIPrimitives(_console);

            string [] optionsCentered = new String[_element.Options.Length];
            int       optionWidth     = uiPrimitives.GetListElementWidth(_element);

            for (int i = 0; i < _element.Options.Length; i++)
            {
                optionsCentered[i] = uiPrimitives.PadStringCentered(_element.Options[i], optionWidth);
                _console.SetFontColor(_element.NonSelectedColor);
                if (i == _element.Value)
                {
                    _console.SetFontColor(_element.SelectedColor);
                }
                _console.Write(optionWidth * i, _element.Row, optionsCentered[i]);
            }
        }