Exemple #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));
        }
Exemple #2
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));
        }
Exemple #3
0
        public override void Draw(ITextRenderer renderer)
        {
            Width = Parent.SurfaceWidth;

            if (!_drop.Visible)
                _selected = null;

            renderer.Clear(GuiSettings.Menu);

            var x = 0;
            foreach (var i in Items)
            {
                var highlight = _selected != null && _selected == i;
                i.Draw(renderer.Region(x, 0, (uint)i.Caption.Length + 2, 1), highlight, false);
                x += i.Caption.Length + 2;
            }
        }
Exemple #4
0
        public override void Draw(ITextRenderer renderer)
        {
            var node = _children.Last;
            while (node != null)
            {
                var widget = node.Value;
                var next = node.Previous;

                if (widget.Visible)
                {
                    var region = renderer.Region(widget.Left, widget.Top, widget.Width, widget.Height);
                    node.Value.Draw(region);
                }

                node = next;
            }
        }
Exemple #5
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));
        }
Exemple #6
0
        public override void Draw(ITextRenderer renderer)
        {
            _offset = (int)(Math.Round(_scrollbar.Value) * _rowSize);

            renderer.Clear(new Character(0, 0, 7), true);

            if (_buffer != null)
            {
                var offset = _offset;

                for (var i = 0; i < Height; i++)
                {
                    renderer.DrawText(0, i, offset.ToString("X8"), new Character(0, 8, 7));
                    var x1 = 10;
                    var x2 = x1 + (_rowSize * 3) + 1;
                    for (var j = 0; j < _rowSize; j++, offset++, x1 += 3, x2++)
                    {
                        if (offset < 0 || offset > _buffer.Length)
                            continue;

                        var b = _buffer[offset];
                        renderer.DrawText(x1, i, b.ToString("X2"), new Character(0, 0, 7));
                        renderer.Set(x2, i, new Character(b, 0, 7));
                    }
                }
            }

            _frames++;
            if (_frames >= 30)
            {
                _caretVisible = !_caretVisible;
                _frames = 0;
            }

            if (Focussed && _caretVisible)
            {
                var offset = _selectedOffset - (_offset * 2);
                var y = (offset / 2) / _rowSize;
                var xN = offset % (_rowSize * 2);
                var x = 10 + xN + (xN / 2);
                renderer.Set(x, y, new Character(-1, 7, 0));
            }

            _scrollbar.Draw(renderer.Region(_scrollbar.Left, _scrollbar.Top, _scrollbar.Width, _scrollbar.Height));
        }
Exemple #7
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++;
            }
        }