Mesen-X/GUI.NET/Debugger/Controls/BaseScrollableTextboxUserControl.cs

84 lines
1.8 KiB
C#
Raw Normal View History

2015-08-05 20:40:24 -04:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
2016-12-11 14:25:29 -05:00
using Mesen.GUI.Controls;
2015-08-05 20:40:24 -04:00
namespace Mesen.GUI.Debugger.Controls
{
2016-12-11 14:25:29 -05:00
public class BaseScrollableTextboxUserControl : BaseControl
2015-08-05 20:40:24 -04:00
{
virtual protected ctrlScrollableTextbox ScrollableTextbox
2015-08-05 20:40:24 -04:00
{
get
{
return null;
}
2015-08-05 20:40:24 -04:00
}
[DefaultValue(13F)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
virtual public float FontSize
2015-08-05 20:40:24 -04:00
{
get { return this.ScrollableTextbox.FontSize; }
set { this.ScrollableTextbox.FontSize = value; }
}
public void OpenSearchBox()
{
this.ScrollableTextbox.OpenSearchBox();
}
public void FindNext()
{
this.ScrollableTextbox.FindNext();
}
public void FindPrevious()
{
this.ScrollableTextbox.FindPrevious();
}
public void GoToAddress()
{
this.ScrollableTextbox.GoToAddress();
}
2018-01-02 11:11:50 -05:00
public void ScrollToLineNumber(int lineNumber, bool scrollToTop = false)
2015-08-09 14:47:27 -04:00
{
2018-01-02 11:11:50 -05:00
this.ScrollableTextbox.ScrollToLineNumber(lineNumber, eHistoryType.Always, scrollToTop);
2015-08-09 14:47:27 -04:00
}
public void ScrollToLineIndex(int lineIndex)
{
this.ScrollableTextbox.ScrollToLineIndex(lineIndex);
}
public bool HideSelection
{
get { return this.ScrollableTextbox.HideSelection; }
set { this.ScrollableTextbox.HideSelection = value; }
}
2015-08-05 20:40:24 -04:00
public int GetCurrentLine()
{
return this.ScrollableTextbox.CurrentLine;
}
public void ScrollToTop()
{
this.ScrollableTextbox.ScrollToLineNumber(0);
}
public string GetWordUnderLocation(Point position, bool useCompareText = false)
2015-08-05 20:40:24 -04:00
{
return this.ScrollableTextbox.GetWordUnderLocation(position, useCompareText);
2015-08-05 20:40:24 -04:00
}
}
}