From 9b27a59ccf327f58967fd9cd30bf4e6f6185242e Mon Sep 17 00:00:00 2001 From: Sour Date: Sat, 3 Mar 2018 16:26:24 -0500 Subject: [PATCH] Linux: Fixed compilation errors & UI bug --- GUI.NET/Debugger/Controls/ctrlCodeScrollbar.cs | 10 ++++++---- GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.cs | 4 ++-- GUI.NET/Debugger/Controls/ctrlScrollableTextbox.cs | 2 +- Linux/SdlRenderer.cpp | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/GUI.NET/Debugger/Controls/ctrlCodeScrollbar.cs b/GUI.NET/Debugger/Controls/ctrlCodeScrollbar.cs index 3998a6be..10c94cea 100644 --- a/GUI.NET/Debugger/Controls/ctrlCodeScrollbar.cs +++ b/GUI.NET/Debugger/Controls/ctrlCodeScrollbar.cs @@ -28,6 +28,7 @@ namespace Mesen.GUI.Debugger.Controls public ctrlCodeScrollbar() { this.DoubleBuffered = true; + this.ResizeRedraw = true; this._tmrScroll = new Timer(); this._tmrScroll.Tick += tmrScroll_Tick; } @@ -121,16 +122,17 @@ namespace Mesen.GUI.Debugger.Controls int arrowWidth = 10; int arrowHeight = 5; + int bottom = barTop + barHeight + _buttonSize; e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; e.Graphics.FillRectangle(Brushes.Gainsboro, e.ClipRectangle.Left + 1, e.ClipRectangle.Top, this.Width - 1, _buttonSize); - e.Graphics.FillRectangle(Brushes.Gainsboro, e.ClipRectangle.Left + 1, e.ClipRectangle.Bottom - _buttonSize, this.Width - 1, _buttonSize); + e.Graphics.FillRectangle(Brushes.Gainsboro, e.ClipRectangle.Left + 1, bottom - _buttonSize, this.Width - 1, _buttonSize); e.Graphics.DrawLine(Pens.DimGray, e.ClipRectangle.Left + 1, e.ClipRectangle.Top + _buttonSize, e.ClipRectangle.Left + width, e.ClipRectangle.Top + _buttonSize); - e.Graphics.DrawLine(Pens.DimGray, e.ClipRectangle.Left + 1, e.ClipRectangle.Bottom - _buttonSize, e.ClipRectangle.Left + width, e.ClipRectangle.Bottom - _buttonSize); - e.Graphics.DrawLine(Pens.DimGray, e.ClipRectangle.Left + 1, e.ClipRectangle.Bottom, e.ClipRectangle.Left + width, e.ClipRectangle.Bottom); + e.Graphics.DrawLine(Pens.DimGray, e.ClipRectangle.Left + 1, bottom - _buttonSize, e.ClipRectangle.Left + width, bottom - _buttonSize); + e.Graphics.DrawLine(Pens.DimGray, e.ClipRectangle.Left + 1, bottom, e.ClipRectangle.Left + width, bottom); e.Graphics.TranslateTransform(5, (_buttonSize - arrowHeight) / 2); e.Graphics.FillPolygon(Brushes.DimGray, new Point[] { new Point(left, e.ClipRectangle.Top + arrowHeight), new Point(left + arrowWidth, e.ClipRectangle.Top + arrowHeight), new Point(left + arrowWidth / 2, e.ClipRectangle.Top) }, FillMode.Winding); e.Graphics.TranslateTransform(0, -(_buttonSize - arrowHeight)); - e.Graphics.FillPolygon(Brushes.DimGray, new Point[] { new Point(left, e.ClipRectangle.Bottom - arrowHeight), new Point(left + arrowWidth, e.ClipRectangle.Bottom - arrowHeight), new Point(left + arrowWidth / 2, e.ClipRectangle.Bottom) }, FillMode.Winding); + e.Graphics.FillPolygon(Brushes.DimGray, new Point[] { new Point(left, bottom - arrowHeight), new Point(left + arrowWidth, bottom - arrowHeight), new Point(left + arrowWidth / 2, bottom) }, FillMode.Winding); } private bool _mouseDown = false; diff --git a/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.cs b/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.cs index 9a4f807f..1251f148 100644 --- a/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.cs +++ b/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.cs @@ -30,8 +30,8 @@ namespace Mesen.GUI.Debugger.Controls } } - public Font BaseFont { get => ctrlScrollableTextbox.BaseFont; set => ctrlScrollableTextbox.BaseFont = value; } - public int TextZoom { get => ctrlScrollableTextbox.TextZoom; set => ctrlScrollableTextbox.TextZoom = value; } + public Font BaseFont { get { return ctrlScrollableTextbox.BaseFont; } set { ctrlScrollableTextbox.BaseFont = value; } } + public int TextZoom { get { return ctrlScrollableTextbox.TextZoom; } set { ctrlScrollableTextbox.TextZoom = value; } } public void RefreshData() { diff --git a/GUI.NET/Debugger/Controls/ctrlScrollableTextbox.cs b/GUI.NET/Debugger/Controls/ctrlScrollableTextbox.cs index 2756685e..d534c7de 100644 --- a/GUI.NET/Debugger/Controls/ctrlScrollableTextbox.cs +++ b/GUI.NET/Debugger/Controls/ctrlScrollableTextbox.cs @@ -383,7 +383,7 @@ namespace Mesen.GUI.Debugger set { this.ctrlTextbox.ShowContentNotes = value; } } - public bool ShowCompactPrgAddresses { get => this.ctrlTextbox.ShowCompactPrgAddresses; set => this.ctrlTextbox.ShowCompactPrgAddresses = value; } + public bool ShowCompactPrgAddresses { get { return this.ctrlTextbox.ShowCompactPrgAddresses; } set { this.ctrlTextbox.ShowCompactPrgAddresses = value; } } public bool ShowLineNumberNotes { diff --git a/Linux/SdlRenderer.cpp b/Linux/SdlRenderer.cpp index 281e8c1a..09e494b8 100755 --- a/Linux/SdlRenderer.cpp +++ b/Linux/SdlRenderer.cpp @@ -195,8 +195,8 @@ void SdlRenderer::Render() void SdlRenderer::DrawPauseScreen(bool disableOverlay) { if(disableOverlay) { - DrawString("I", 15, 15, 106, 90, 205); - DrawString("I", 23, 15, 106, 90, 205); + DrawString(L"I", 15, 15, 106, 90, 205); + DrawString(L"I", 23, 15, 106, 90, 205); } else { uint32_t textureData = 0x222222AA; SDL_Surface* surf = SDL_CreateRGBSurfaceFrom((void*)&textureData, 1, 1, 32, 4, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);