Exemplo n.º 1
0
        public override void Draw(ITextRenderer renderer)
        {
            renderer.DrawBox(0, 0, Width, Height, TextExtensions.DoubleBox, GuiSettings.Window);
            renderer.DrawText(2, 0, "[\xFE]", GuiSettings.Window);

            if (!string.IsNullOrEmpty(Caption))
                renderer.DrawText(6, 0, string.Format(" {0} ", Caption), GuiSettings.WindowCaption);

            _children.Draw(renderer.Region(1, 1, Width - 2, Height - 2));
        }
Exemplo n.º 2
0
        public override void Draw(ITextRenderer renderer)
        {
            var captionX = (int)(Width - 1) / 2 - Caption.Length / 2;

            if (!_holding)
            {
                renderer.DrawBox(0, 0, Width - 1, 1, GuiSettings.SolidBox, GuiSettings.Button);
                renderer.Set((int)Width - 1, 0, GuiSettings.ButtonShadowR);

                for (var i = 0; i < Width; i++)
                {
                    renderer.Set(1 + i, 1, GuiSettings.ButtonShadowB);
                }

                renderer.DrawText(captionX, 0, Caption, GuiSettings.Button);
            }
            else
            {
                renderer.DrawBox(1, 0, Width, 1, GuiSettings.SolidBox, GuiSettings.Button);
                renderer.DrawText(captionX + 1, 0, Caption, GuiSettings.Button);
            }
        }
Exemplo n.º 3
0
        public override void Draw(ITextRenderer renderer)
        {
            renderer.Clear(new Character(0, 0, 7), true);

            for (var i = 0; i < _lines.Count; i++)
            {
                var line = _lines[i];
                renderer.DrawBox(0, i, Width - 1, 1, GuiSettings.SolidBox, new Character(0, 0, line.Background));

                if (line.SourceLine != null)
                    renderer.DrawText((int)Width - 2 - line.SourceLine.Length, i, line.SourceLine, new Character(0, 25));

                renderer.DrawText(0, i, line.Address.ToString("X8"), new Character(0, 8));
                renderer.DrawText(9, i, line.Instruction, new Character(0, line.Foreground));
            }

            _scrollbar.Draw(renderer.Region(_scrollbar.Left, _scrollbar.Top, _scrollbar.Width, _scrollbar.Height));
        }
Exemplo n.º 4
0
        public override void Draw(ITextRenderer renderer)
        {
            renderer.DrawBox(0, 0, Width, Height, TextExtensions.SingleBox, GuiSettings.ListBox);

            _scrollbar.Maximum = Math.Max(Items.Count - (Height - 2), 0);
            var startIndex = (int)_scrollbar.Value;

            for (var i = 0; i < Height - 2; i++)
            {
                var index = startIndex + i;
                if (index >= Items.Count)
                    break;

                var reg = renderer.Region(1, i + 1, Width - 2, 1);
                var col = (SelectEnabled && Selected == index) ? GuiSettings.ListBoxItemSelected : GuiSettings.ListBoxItem;

                reg.Clear(col, true);
                reg.DrawText(0, 0, Items[index].Text, col);
            }

            _scrollbar.Draw(renderer.Region(_scrollbar.Left, _scrollbar.Top, _scrollbar.Width, _scrollbar.Height));
        }
Exemplo n.º 5
0
        public override void Draw(ITextRenderer renderer)
        {
            if (_drop == null || !_drop.Visible)
                _selected = null;

            if (!Focussed && _selected == null)
                Visible = false;

            renderer.DrawBox(0, 0, Width, Height, TextExtensions.SingleBox, GuiSettings.MenuOutline);

            var y = 1;
            foreach (var i in _items)
            {
                var highlight = _selected != null && _selected == i;
                i.Draw(renderer.Region(1, y, Width - 2, 1), highlight, true);
                y++;
            }
        }
Exemplo n.º 6
0
 private void Draw(ITextRenderer renderer, float x, float y, uint w, uint h, Character color)
 {
     renderer.DrawBox((int)x - _camera, (int)y, w, h, GuiSettings.SolidBox, color);
 }