Change the snes performance core recording nag so that it doesn't allow the choice to continue, as of this commit we do not support the use of the performance profile for movie recording
This commit is contained in:
parent
ee93e988bc
commit
bee1dfcb02
|
@ -55,7 +55,6 @@ namespace BizHawk.Client.Common
|
||||||
public string FFMpegPath = "%exe%/dll/ffmpeg.exe";
|
public string FFMpegPath = "%exe%/dll/ffmpeg.exe";
|
||||||
|
|
||||||
// General Client Settings
|
// General Client Settings
|
||||||
public bool DontAskPerformanceCoreRecordingNag = false;
|
|
||||||
public int Input_Hotkey_OverrideOptions = 0;
|
public int Input_Hotkey_OverrideOptions = 0;
|
||||||
public bool StackOSDMessages = true;
|
public bool StackOSDMessages = true;
|
||||||
public int TargetZoomFactor = 2;
|
public int TargetZoomFactor = 2;
|
||||||
|
|
|
@ -7,53 +7,53 @@ using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
// http://www.codeproject.com/Articles/154680/A-customizable-NET-WinForms-Message-Box
|
// http://www.codeproject.com/Articles/154680/A-customizable-NET-WinForms-Message-Box
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A customizable Dialog box with 3 buttons, custom icon, and checkbox.
|
/// A customizable Dialog box with 3 buttons, custom icon, and checkbox.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
partial class MsgBox : Form
|
partial class MsgBox : Form
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new instance of the dialog box with a message and title.
|
/// Create a new instance of the dialog box with a message and title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">Message text.</param>
|
/// <param name="message">Message text.</param>
|
||||||
/// <param name="title">Dialog Box title.</param>
|
/// <param name="title">Dialog Box title.</param>
|
||||||
public MsgBox(string message, string title)
|
public MsgBox(string message, string title)
|
||||||
: this(message, title, MessageBoxIcon.None)
|
: this(message, title, MessageBoxIcon.None)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
/// Create a new instance of the dialog box with a message and title and a standard windows messagebox icon.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="message">Message text.</param>
|
|
||||||
/// <param name="title">Dialog Box title.</param>
|
|
||||||
/// <param name="icon">Standard system messagebox icon.</param>
|
|
||||||
public MsgBox(string message, string title, MessageBoxIcon icon)
|
|
||||||
: this(message, title, getMessageBoxIcon(icon))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Create a new instance of the dialog box with a message and title and a standard windows messagebox icon.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">Message text.</param>
|
||||||
|
/// <param name="title">Dialog Box title.</param>
|
||||||
|
/// <param name="icon">Standard system messagebox icon.</param>
|
||||||
|
public MsgBox(string message, string title, MessageBoxIcon icon)
|
||||||
|
: this(message, title, getMessageBoxIcon(icon))
|
||||||
|
{
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
/// Create a new instance of the dialog box with a message and title and a custom windows icon.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="message">Message text.</param>
|
|
||||||
/// <param name="title">Dialog Box title.</param>
|
|
||||||
/// <param name="icon">Custom icon.</param>
|
|
||||||
public MsgBox(string message, string title, Icon icon)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
this.messageLbl.Text = message;
|
/// <summary>
|
||||||
this.Text = title;
|
/// Create a new instance of the dialog box with a message and title and a custom windows icon.
|
||||||
this.m_sysIcon = icon;
|
/// </summary>
|
||||||
|
/// <param name="message">Message text.</param>
|
||||||
|
/// <param name="title">Dialog Box title.</param>
|
||||||
|
/// <param name="icon">Custom icon.</param>
|
||||||
|
public MsgBox(string message, string title, Icon icon)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
if (this.m_sysIcon == null)
|
this.messageLbl.Text = message;
|
||||||
this.messageLbl.Location = new Point(FORM_X_MARGIN, FORM_Y_MARGIN);
|
this.Text = title;
|
||||||
}
|
this.m_sysIcon = icon;
|
||||||
|
|
||||||
|
if (this.m_sysIcon == null)
|
||||||
|
this.messageLbl.Location = new Point(FORM_X_MARGIN, FORM_Y_MARGIN);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetMessageToAutoSize()
|
public void SetMessageToAutoSize()
|
||||||
{
|
{
|
||||||
|
@ -61,291 +61,291 @@ namespace BizHawk.Client.EmuHawk
|
||||||
this.messageLbl.MaximumSize = new Size(this.MaximumSize.Width - this.m_sysIcon.Width - 25, this.MaximumSize.Height);
|
this.messageLbl.MaximumSize = new Size(this.MaximumSize.Width - this.m_sysIcon.Width - 25, this.MaximumSize.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get system icon for MessageBoxIcon.
|
/// Get system icon for MessageBoxIcon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="icon">The MessageBoxIcon value.</param>
|
/// <param name="icon">The MessageBoxIcon value.</param>
|
||||||
/// <returns>SystemIcon type Icon.</returns>
|
/// <returns>SystemIcon type Icon.</returns>
|
||||||
static Icon getMessageBoxIcon(MessageBoxIcon icon)
|
static Icon getMessageBoxIcon(MessageBoxIcon icon)
|
||||||
{
|
{
|
||||||
switch (icon)
|
switch (icon)
|
||||||
{
|
{
|
||||||
case MessageBoxIcon.Asterisk:
|
case MessageBoxIcon.Asterisk:
|
||||||
return SystemIcons.Asterisk;
|
return SystemIcons.Asterisk;
|
||||||
case MessageBoxIcon.Error:
|
case MessageBoxIcon.Error:
|
||||||
return SystemIcons.Error;
|
return SystemIcons.Error;
|
||||||
case MessageBoxIcon.Exclamation:
|
case MessageBoxIcon.Exclamation:
|
||||||
return SystemIcons.Exclamation;
|
return SystemIcons.Exclamation;
|
||||||
case MessageBoxIcon.Question:
|
case MessageBoxIcon.Question:
|
||||||
return SystemIcons.Question;
|
return SystemIcons.Question;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Setup API
|
#region Setup API
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Min set width.
|
/// Min set width.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int m_minWidth;
|
int m_minWidth;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Min set height.
|
/// Min set height.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int m_minHeight;
|
int m_minHeight;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the min size of the dialog box. If the text or button row needs more size then the dialog box will size to fit the text.
|
/// Sets the min size of the dialog box. If the text or button row needs more size then the dialog box will size to fit the text.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="width">Min width value.</param>
|
/// <param name="width">Min width value.</param>
|
||||||
/// <param name="height">Min height value.</param>
|
/// <param name="height">Min height value.</param>
|
||||||
public void SetMinSize(int width, int height)
|
public void SetMinSize(int width, int height)
|
||||||
{
|
{
|
||||||
m_minWidth = width;
|
m_minWidth = width;
|
||||||
m_minHeight = height;
|
m_minHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create up to 3 buttons with no DialogResult values.
|
/// Create up to 3 buttons with no DialogResult values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
||||||
public void SetButtons(params string[] names)
|
public void SetButtons(params string[] names)
|
||||||
{
|
{
|
||||||
DialogResult[] drs = new DialogResult[names.Length];
|
DialogResult[] drs = new DialogResult[names.Length];
|
||||||
for (int i = 0; i < names.Length; i++)
|
for (int i = 0; i < names.Length; i++)
|
||||||
drs[i] = DialogResult.None;
|
drs[i] = DialogResult.None;
|
||||||
this.SetButtons(names, drs);
|
this.SetButtons(names, drs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create up to 3 buttons with given DialogResult values.
|
/// Create up to 3 buttons with given DialogResult values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
||||||
/// <param name="results">Array of DialogResult values. Must be same length as names.</param>
|
/// <param name="results">Array of DialogResult values. Must be same length as names.</param>
|
||||||
public void SetButtons(string[] names, DialogResult[] results)
|
public void SetButtons(string[] names, DialogResult[] results)
|
||||||
{
|
{
|
||||||
this.SetButtons(names, results, 1);
|
this.SetButtons(names, results, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create up to 3 buttons with given DialogResult values.
|
/// Create up to 3 buttons with given DialogResult values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
/// <param name="names">Array of button names. Must of length 1-3.</param>
|
||||||
/// <param name="results">Array of DialogResult values. Must be same length as names.</param>
|
/// <param name="results">Array of DialogResult values. Must be same length as names.</param>
|
||||||
/// <param name="def">Default Button number. Must be 1-3.</param>
|
/// <param name="def">Default Button number. Must be 1-3.</param>
|
||||||
public void SetButtons(string[] names, DialogResult[] results, int def)
|
public void SetButtons(string[] names, DialogResult[] results, int def)
|
||||||
{
|
{
|
||||||
if (names == null)
|
if (names == null)
|
||||||
throw new ArgumentNullException("btnText", "Button Text is null");
|
throw new ArgumentNullException("btnText", "Button Text is null");
|
||||||
|
|
||||||
int count = names.Length;
|
int count = names.Length;
|
||||||
|
|
||||||
if (count < 1 || count > 3)
|
if (count < 1 || count > 3)
|
||||||
throw new ArgumentException("Invalid number of buttons. Must be between 1 and 3.");
|
throw new ArgumentException("Invalid number of buttons. Must be between 1 and 3.");
|
||||||
|
|
||||||
//---- Set Button 1
|
//---- Set Button 1
|
||||||
m_minButtonRowWidth += setButtonParams(btn1, names[0], def == 1 ? 1 : 2, results[0]);
|
m_minButtonRowWidth += setButtonParams(btn1, names[0], def == 1 ? 1 : 2, results[0]);
|
||||||
|
|
||||||
//---- Set Button 2
|
//---- Set Button 2
|
||||||
if (count > 1)
|
if (count > 1)
|
||||||
{
|
{
|
||||||
m_minButtonRowWidth += setButtonParams(btn2, names[1], def == 2 ? 1 : 3, results[1]) + BUTTON_SPACE;
|
m_minButtonRowWidth += setButtonParams(btn2, names[1], def == 2 ? 1 : 3, results[1]) + BUTTON_SPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---- Set Button 3
|
//---- Set Button 3
|
||||||
if (count > 2)
|
if (count > 2)
|
||||||
{
|
{
|
||||||
m_minButtonRowWidth += setButtonParams(btn3, names[2], def == 3 ? 1 : 4, results[2]) + BUTTON_SPACE;
|
m_minButtonRowWidth += setButtonParams(btn3, names[2], def == 3 ? 1 : 4, results[2]) + BUTTON_SPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The min required width of the button and checkbox row. Sum of button widths + checkbox width + margins.
|
/// The min required width of the button and checkbox row. Sum of button widths + checkbox width + margins.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int m_minButtonRowWidth;
|
int m_minButtonRowWidth;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets button text and returns the width.
|
/// Sets button text and returns the width.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="btn">Button object.</param>
|
/// <param name="btn">Button object.</param>
|
||||||
/// <param name="text">Text of the button.</param>
|
/// <param name="text">Text of the button.</param>
|
||||||
/// <param name="tab">TabIndex of the button.</param>
|
/// <param name="tab">TabIndex of the button.</param>
|
||||||
/// <param name="dr">DialogResult of the button.</param>
|
/// <param name="dr">DialogResult of the button.</param>
|
||||||
/// <returns>Width of the button.</returns>
|
/// <returns>Width of the button.</returns>
|
||||||
static int setButtonParams(Button btn, string text, int tab, DialogResult dr)
|
static int setButtonParams(Button btn, string text, int tab, DialogResult dr)
|
||||||
{
|
{
|
||||||
btn.Text = text;
|
btn.Text = text;
|
||||||
btn.Visible = true;
|
btn.Visible = true;
|
||||||
btn.DialogResult = dr;
|
btn.DialogResult = dr;
|
||||||
btn.TabIndex = tab;
|
btn.TabIndex = tab;
|
||||||
return btn.Size.Width;
|
return btn.Size.Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables the checkbox. By default the checkbox is unchecked.
|
/// Enables the checkbox. By default the checkbox is unchecked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="text">Text of the checkbox.</param>
|
/// <param name="text">Text of the checkbox.</param>
|
||||||
public void SetCheckbox(string text)
|
public void SetCheckbox(string text)
|
||||||
{
|
{
|
||||||
this.SetCheckbox(text, false);
|
this.SetCheckbox(text, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enables the checkbox and the default checked state.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="text">Text of the checkbox.</param>
|
|
||||||
/// <param name="chcked">Default checked state of the box.</param>
|
|
||||||
public void SetCheckbox(string text, bool chcked)
|
|
||||||
{
|
|
||||||
this.chkBx.Visible = true;
|
|
||||||
this.chkBx.Text = text;
|
|
||||||
this.chkBx.Checked = chcked;
|
|
||||||
this.m_minButtonRowWidth += this.chkBx.Size.Width + CHECKBOX_SPACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
/// <summary>
|
||||||
|
/// Enables the checkbox and the default checked state.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text">Text of the checkbox.</param>
|
||||||
|
/// <param name="chcked">Default checked state of the box.</param>
|
||||||
|
public void SetCheckbox(string text, bool chcked)
|
||||||
|
{
|
||||||
|
this.chkBx.Visible = true;
|
||||||
|
this.chkBx.Text = text;
|
||||||
|
this.chkBx.Checked = chcked;
|
||||||
|
this.m_minButtonRowWidth += this.chkBx.Size.Width + CHECKBOX_SPACE;
|
||||||
|
}
|
||||||
|
|
||||||
#region Sizes and Locations
|
#endregion
|
||||||
private void DialogBox_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (!btn1.Visible)
|
|
||||||
this.SetButtons(new string[] { "OK" }, new DialogResult[] { DialogResult.OK });
|
|
||||||
|
|
||||||
m_minButtonRowWidth += 2 * FORM_X_MARGIN; //add margin to the ends
|
#region Sizes and Locations
|
||||||
|
private void DialogBox_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!btn1.Visible)
|
||||||
|
this.SetButtons(new string[] { "OK" }, new DialogResult[] { DialogResult.OK });
|
||||||
|
|
||||||
this.setDialogSize();
|
m_minButtonRowWidth += 2 * FORM_X_MARGIN; //add margin to the ends
|
||||||
|
|
||||||
//this.setButtonRowLocations();
|
this.setDialogSize();
|
||||||
|
|
||||||
}
|
//this.setButtonRowLocations();
|
||||||
|
|
||||||
const int FORM_Y_MARGIN = 10;
|
}
|
||||||
const int FORM_X_MARGIN = 16;
|
|
||||||
const int BUTTON_SPACE = 5;
|
|
||||||
const int CHECKBOX_SPACE = 15;
|
|
||||||
const int TEXT_Y_MARGIN = 30;
|
|
||||||
|
|
||||||
/// <summary>
|
const int FORM_Y_MARGIN = 10;
|
||||||
/// Auto fits the dialog box to fit the text and the buttons.
|
const int FORM_X_MARGIN = 16;
|
||||||
/// </summary>
|
const int BUTTON_SPACE = 5;
|
||||||
void setDialogSize()
|
const int CHECKBOX_SPACE = 15;
|
||||||
{
|
const int TEXT_Y_MARGIN = 30;
|
||||||
int requiredWidth = this.messageLbl.Location.X + this.messageLbl.Size.Width + FORM_X_MARGIN;
|
|
||||||
requiredWidth = requiredWidth > m_minButtonRowWidth ? requiredWidth : m_minButtonRowWidth;
|
|
||||||
|
|
||||||
int requiredHeight = this.messageLbl.Location.Y + this.messageLbl.Size.Height - this.btn2.Location.Y + this.ClientSize.Height + TEXT_Y_MARGIN;
|
/// <summary>
|
||||||
|
/// Auto fits the dialog box to fit the text and the buttons.
|
||||||
|
/// </summary>
|
||||||
|
void setDialogSize()
|
||||||
|
{
|
||||||
|
int requiredWidth = this.messageLbl.Location.X + this.messageLbl.Size.Width + FORM_X_MARGIN;
|
||||||
|
requiredWidth = requiredWidth > m_minButtonRowWidth ? requiredWidth : m_minButtonRowWidth;
|
||||||
|
|
||||||
int minSetWidth = this.ClientSize.Width > this.m_minWidth ? this.ClientSize.Width : this.m_minWidth;
|
int requiredHeight = this.messageLbl.Location.Y + this.messageLbl.Size.Height - this.btn2.Location.Y + this.ClientSize.Height + TEXT_Y_MARGIN;
|
||||||
int minSetHeight = this.ClientSize.Height > this.m_minHeight ? this.ClientSize.Height : this.m_minHeight;
|
|
||||||
|
|
||||||
Size s = new Size();
|
int minSetWidth = this.ClientSize.Width > this.m_minWidth ? this.ClientSize.Width : this.m_minWidth;
|
||||||
s.Width = requiredWidth > minSetWidth ? requiredWidth : minSetWidth;
|
int minSetHeight = this.ClientSize.Height > this.m_minHeight ? this.ClientSize.Height : this.m_minHeight;
|
||||||
s.Height = requiredHeight > minSetHeight ? requiredHeight : minSetHeight;
|
|
||||||
this.ClientSize = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
Size s = new Size();
|
||||||
/// Sets the buttons and checkboxe location.
|
s.Width = requiredWidth > minSetWidth ? requiredWidth : minSetWidth;
|
||||||
/// </summary>
|
s.Height = requiredHeight > minSetHeight ? requiredHeight : minSetHeight;
|
||||||
void setButtonRowLocations()
|
this.ClientSize = s;
|
||||||
{
|
}
|
||||||
int formWidth = this.ClientRectangle.Width;
|
|
||||||
|
|
||||||
int x = formWidth - FORM_X_MARGIN;
|
/// <summary>
|
||||||
int y = btn1.Location.Y;
|
/// Sets the buttons and checkboxe location.
|
||||||
|
/// </summary>
|
||||||
|
void setButtonRowLocations()
|
||||||
|
{
|
||||||
|
int formWidth = this.ClientRectangle.Width;
|
||||||
|
|
||||||
if (btn3.Visible)
|
int x = formWidth - FORM_X_MARGIN;
|
||||||
{
|
int y = btn1.Location.Y;
|
||||||
x -= btn3.Size.Width;
|
|
||||||
btn3.Location = new Point(x, y);
|
|
||||||
x -= BUTTON_SPACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (btn2.Visible)
|
if (btn3.Visible)
|
||||||
{
|
{
|
||||||
x -= btn2.Size.Width;
|
x -= btn3.Size.Width;
|
||||||
btn2.Location = new Point(x, y);
|
btn3.Location = new Point(x, y);
|
||||||
x -= BUTTON_SPACE;
|
x -= BUTTON_SPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
x -= btn1.Size.Width;
|
if (btn2.Visible)
|
||||||
btn1.Location = new Point(x, y);
|
{
|
||||||
|
x -= btn2.Size.Width;
|
||||||
|
btn2.Location = new Point(x, y);
|
||||||
|
x -= BUTTON_SPACE;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.chkBx.Visible)
|
x -= btn1.Size.Width;
|
||||||
this.chkBx.Location = new Point(FORM_X_MARGIN, this.chkBx.Location.Y);
|
btn1.Location = new Point(x, y);
|
||||||
|
|
||||||
}
|
if (this.chkBx.Visible)
|
||||||
|
this.chkBx.Location = new Point(FORM_X_MARGIN, this.chkBx.Location.Y);
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Icon Pain
|
}
|
||||||
/// <summary>
|
|
||||||
/// The icon to paint.
|
|
||||||
/// </summary>
|
|
||||||
Icon m_sysIcon;
|
|
||||||
|
|
||||||
/// <summary>
|
#endregion
|
||||||
/// Paint the System Icon in the top left corner.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected override void OnPaint(PaintEventArgs e)
|
|
||||||
{
|
|
||||||
if (m_sysIcon != null)
|
|
||||||
{
|
|
||||||
Graphics g = e.Graphics;
|
|
||||||
g.DrawIconUnstretched(m_sysIcon, new Rectangle(FORM_X_MARGIN, FORM_Y_MARGIN, m_sysIcon.Width, m_sysIcon.Height));
|
|
||||||
}
|
|
||||||
|
|
||||||
base.OnPaint(e);
|
#region Icon Pain
|
||||||
}
|
/// <summary>
|
||||||
#endregion
|
/// The icon to paint.
|
||||||
|
/// </summary>
|
||||||
|
Icon m_sysIcon;
|
||||||
|
|
||||||
#region Result API
|
/// <summary>
|
||||||
|
/// Paint the System Icon in the top left corner.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
if (m_sysIcon != null)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.DrawIconUnstretched(m_sysIcon, new Rectangle(FORM_X_MARGIN, FORM_Y_MARGIN, m_sysIcon.Width, m_sysIcon.Height));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
base.OnPaint(e);
|
||||||
/// If visible checkbox was checked.
|
}
|
||||||
/// </summary>
|
#endregion
|
||||||
public bool CheckboxChecked
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.chkBx.Checked;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DialogBoxResult m_result;
|
#region Result API
|
||||||
/// <summary>
|
|
||||||
/// Gets the button that was pressed.
|
|
||||||
/// </summary>
|
|
||||||
public DialogBoxResult DialogBoxResult
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btn_Click(object sender, EventArgs e)
|
/// <summary>
|
||||||
{
|
/// If visible checkbox was checked.
|
||||||
if (sender == btn1)
|
/// </summary>
|
||||||
this.m_result = DialogBoxResult.Button1;
|
public bool CheckboxChecked
|
||||||
else if (sender == btn2)
|
{
|
||||||
this.m_result = DialogBoxResult.Button2;
|
get
|
||||||
else if (sender == btn3)
|
{
|
||||||
this.m_result = DialogBoxResult.Button3;
|
return this.chkBx.Checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (((Button)sender).DialogResult == DialogResult.None)
|
DialogBoxResult m_result;
|
||||||
this.Close();
|
/// <summary>
|
||||||
}
|
/// Gets the button that was pressed.
|
||||||
|
/// </summary>
|
||||||
|
public DialogBoxResult DialogBoxResult
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
private void btn_Click(object sender, EventArgs e)
|
||||||
}
|
{
|
||||||
|
if (sender == btn1)
|
||||||
|
this.m_result = DialogBoxResult.Button1;
|
||||||
|
else if (sender == btn2)
|
||||||
|
this.m_result = DialogBoxResult.Button2;
|
||||||
|
else if (sender == btn3)
|
||||||
|
this.m_result = DialogBoxResult.Button3;
|
||||||
|
|
||||||
enum DialogBoxResult
|
if (((Button)sender).DialogResult == DialogResult.None)
|
||||||
{
|
this.Close();
|
||||||
Button1,
|
}
|
||||||
Button2,
|
|
||||||
Button3
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum DialogBoxResult
|
||||||
|
{
|
||||||
|
Button1,
|
||||||
|
Button2,
|
||||||
|
Button3
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,135 +1,135 @@
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
{
|
{
|
||||||
partial class MsgBox
|
partial class MsgBox
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private System.ComponentModel.IContainer components = null;
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clean up any resources being used.
|
/// Clean up any resources being used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
}
|
}
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
/// the contents of this method with the code editor.
|
/// the contents of this method with the code editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MsgBox));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MsgBox));
|
||||||
this.chkBx = new System.Windows.Forms.CheckBox();
|
this.chkBx = new System.Windows.Forms.CheckBox();
|
||||||
this.btn1 = new System.Windows.Forms.Button();
|
this.btn1 = new System.Windows.Forms.Button();
|
||||||
this.btn2 = new System.Windows.Forms.Button();
|
this.btn2 = new System.Windows.Forms.Button();
|
||||||
this.messageLbl = new System.Windows.Forms.Label();
|
this.messageLbl = new System.Windows.Forms.Label();
|
||||||
this.btn3 = new System.Windows.Forms.Button();
|
this.btn3 = new System.Windows.Forms.Button();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// chkBx
|
// chkBx
|
||||||
//
|
//
|
||||||
this.chkBx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.chkBx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.chkBx.AutoSize = true;
|
this.chkBx.AutoSize = true;
|
||||||
this.chkBx.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.chkBx.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.chkBx.Location = new System.Drawing.Point(12, 114);
|
this.chkBx.Location = new System.Drawing.Point(12, 114);
|
||||||
this.chkBx.Name = "chkBx";
|
this.chkBx.Name = "chkBx";
|
||||||
this.chkBx.Size = new System.Drawing.Size(152, 20);
|
this.chkBx.Size = new System.Drawing.Size(152, 20);
|
||||||
this.chkBx.TabIndex = 22;
|
this.chkBx.TabIndex = 22;
|
||||||
this.chkBx.Text = "Don\'t show this again";
|
this.chkBx.Text = "Don\'t show this again";
|
||||||
this.chkBx.UseVisualStyleBackColor = true;
|
this.chkBx.UseVisualStyleBackColor = true;
|
||||||
this.chkBx.Visible = false;
|
this.chkBx.Visible = false;
|
||||||
//
|
//
|
||||||
// btn1
|
// btn1
|
||||||
//
|
//
|
||||||
this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.btn1.AutoSize = true;
|
this.btn1.AutoSize = true;
|
||||||
this.btn1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
this.btn1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
this.btn1.Location = new System.Drawing.Point(236, 114);
|
this.btn1.Location = new System.Drawing.Point(236, 114);
|
||||||
this.btn1.Name = "btn1";
|
this.btn1.Name = "btn1";
|
||||||
this.btn1.Size = new System.Drawing.Size(75, 23);
|
this.btn1.Size = new System.Drawing.Size(75, 23);
|
||||||
this.btn1.TabIndex = 5;
|
this.btn1.TabIndex = 5;
|
||||||
this.btn1.Text = "Button1";
|
this.btn1.Text = "Button1";
|
||||||
this.btn1.UseVisualStyleBackColor = true;
|
this.btn1.UseVisualStyleBackColor = true;
|
||||||
this.btn1.Visible = false;
|
this.btn1.Visible = false;
|
||||||
this.btn1.Click += new System.EventHandler(this.btn_Click);
|
this.btn1.Click += new System.EventHandler(this.btn_Click);
|
||||||
//
|
//
|
||||||
// btn2
|
// btn2
|
||||||
//
|
//
|
||||||
this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.btn2.AutoSize = true;
|
this.btn2.AutoSize = true;
|
||||||
this.btn2.Location = new System.Drawing.Point(317, 114);
|
this.btn2.Location = new System.Drawing.Point(317, 114);
|
||||||
this.btn2.Name = "btn2";
|
this.btn2.Name = "btn2";
|
||||||
this.btn2.Size = new System.Drawing.Size(75, 23);
|
this.btn2.Size = new System.Drawing.Size(75, 23);
|
||||||
this.btn2.TabIndex = 6;
|
this.btn2.TabIndex = 6;
|
||||||
this.btn2.Text = "Button2";
|
this.btn2.Text = "Button2";
|
||||||
this.btn2.UseVisualStyleBackColor = true;
|
this.btn2.UseVisualStyleBackColor = true;
|
||||||
this.btn2.Visible = false;
|
this.btn2.Visible = false;
|
||||||
this.btn2.Click += new System.EventHandler(this.btn_Click);
|
this.btn2.Click += new System.EventHandler(this.btn_Click);
|
||||||
//
|
//
|
||||||
// messageLbl
|
// messageLbl
|
||||||
//
|
//
|
||||||
this.messageLbl.AutoSize = true;
|
this.messageLbl.AutoSize = true;
|
||||||
this.messageLbl.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.messageLbl.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.messageLbl.Location = new System.Drawing.Point(58, 10);
|
this.messageLbl.Location = new System.Drawing.Point(58, 10);
|
||||||
this.messageLbl.Name = "messageLbl";
|
this.messageLbl.Name = "messageLbl";
|
||||||
this.messageLbl.Size = new System.Drawing.Size(73, 16);
|
this.messageLbl.Size = new System.Drawing.Size(73, 16);
|
||||||
this.messageLbl.TabIndex = 19;
|
this.messageLbl.TabIndex = 19;
|
||||||
this.messageLbl.Text = "[Message]";
|
this.messageLbl.Text = "[Message]";
|
||||||
//
|
//
|
||||||
// btn3
|
// btn3
|
||||||
//
|
//
|
||||||
this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.btn3.AutoSize = true;
|
this.btn3.AutoSize = true;
|
||||||
this.btn3.Location = new System.Drawing.Point(398, 114);
|
this.btn3.Location = new System.Drawing.Point(398, 114);
|
||||||
this.btn3.Name = "btn3";
|
this.btn3.Name = "btn3";
|
||||||
this.btn3.Size = new System.Drawing.Size(75, 23);
|
this.btn3.Size = new System.Drawing.Size(75, 23);
|
||||||
this.btn3.TabIndex = 7;
|
this.btn3.TabIndex = 7;
|
||||||
this.btn3.Text = "Button3";
|
this.btn3.Text = "Button3";
|
||||||
this.btn3.UseVisualStyleBackColor = true;
|
this.btn3.UseVisualStyleBackColor = true;
|
||||||
this.btn3.Visible = false;
|
this.btn3.Visible = false;
|
||||||
this.btn3.Click += new System.EventHandler(this.btn_Click);
|
this.btn3.Click += new System.EventHandler(this.btn_Click);
|
||||||
//
|
//
|
||||||
// DialogBox
|
// DialogBox
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.CancelButton = this.btn1;
|
this.CancelButton = this.btn1;
|
||||||
this.ClientSize = new System.Drawing.Size(485, 149);
|
this.ClientSize = new System.Drawing.Size(485, 149);
|
||||||
this.ControlBox = false;
|
this.ControlBox = false;
|
||||||
this.Controls.Add(this.btn3);
|
this.Controls.Add(this.btn3);
|
||||||
this.Controls.Add(this.chkBx);
|
this.Controls.Add(this.chkBx);
|
||||||
this.Controls.Add(this.btn1);
|
this.Controls.Add(this.btn1);
|
||||||
this.Controls.Add(this.btn2);
|
this.Controls.Add(this.btn2);
|
||||||
this.Controls.Add(this.messageLbl);
|
this.Controls.Add(this.messageLbl);
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.MaximizeBox = false;
|
this.MaximizeBox = false;
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
this.Name = "DialogBox";
|
this.Name = "DialogBox";
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
this.Text = "[Title]";
|
this.Text = "[Title]";
|
||||||
this.Load += new System.EventHandler(this.DialogBox_Load);
|
this.Load += new System.EventHandler(this.DialogBox_Load);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.CheckBox chkBx;
|
private System.Windows.Forms.CheckBox chkBx;
|
||||||
private System.Windows.Forms.Button btn1;
|
private System.Windows.Forms.Button btn1;
|
||||||
private System.Windows.Forms.Button btn2;
|
private System.Windows.Forms.Button btn2;
|
||||||
private System.Windows.Forms.Label messageLbl;
|
private System.Windows.Forms.Label messageLbl;
|
||||||
private System.Windows.Forms.Button btn3;
|
private System.Windows.Forms.Button btn3;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,8 +3,8 @@ using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||||
using BizHawk.Emulation.Cores.Calculators;
|
using BizHawk.Emulation.Cores.Calculators;
|
||||||
using BizHawk.Emulation.Cores.ColecoVision;
|
using BizHawk.Emulation.Cores.ColecoVision;
|
||||||
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
||||||
|
@ -13,8 +13,10 @@ using BizHawk.Emulation.Cores.Nintendo.SNES;
|
||||||
using BizHawk.Emulation.Cores.PCEngine;
|
using BizHawk.Emulation.Cores.PCEngine;
|
||||||
using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
||||||
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
|
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
|
||||||
|
|
||||||
|
using BizHawk.Client.Common;
|
||||||
using BizHawk.Client.EmuHawk.config.NES;
|
using BizHawk.Client.EmuHawk.config.NES;
|
||||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
using BizHawk.Client.EmuHawk.CustomControls;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
|
@ -404,21 +406,20 @@ namespace BizHawk.Client.EmuHawk
|
||||||
else if (Global.Emulator is LibsnesCore)
|
else if (Global.Emulator is LibsnesCore)
|
||||||
{
|
{
|
||||||
var ss = (LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings();
|
var ss = (LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings();
|
||||||
if (ss.Profile == "Performance" && !Global.Config.DontAskPerformanceCoreRecordingNag)
|
if (ss.Profile == "Performance")
|
||||||
{
|
{
|
||||||
var box = new MsgBox(
|
var box = new MsgBox(
|
||||||
"While the performance core is faster, it is recommended that you use the Compatibility profile when recording movies for better accuracy and stability\n\nSwitch to Compatibility?",
|
"While the performance core is faster, it is not stable enough for movie recording\n\nSwitch to Compatibility?",
|
||||||
"Stability Warning",
|
"Stability Warning",
|
||||||
MessageBoxIcon.Warning);
|
MessageBoxIcon.Warning);
|
||||||
|
|
||||||
box.SetButtons(
|
box.SetButtons(
|
||||||
new[] { "Switch", "Continue", "Cancel" },
|
new[] { "Switch", "Cancel" },
|
||||||
new[] { DialogResult.Yes, DialogResult.No, DialogResult.Cancel });
|
new[] { DialogResult.Yes, DialogResult.Cancel });
|
||||||
box.SetCheckbox("Don't ask me again");
|
|
||||||
box.MaximumSize = new Size(450, 350);
|
box.MaximumSize = new Size(450, 350);
|
||||||
box.SetMessageToAutoSize();
|
box.SetMessageToAutoSize();
|
||||||
var result = box.ShowDialog();
|
var result = box.ShowDialog();
|
||||||
Global.Config.DontAskPerformanceCoreRecordingNag = box.CheckboxChecked;
|
|
||||||
|
|
||||||
if (result == DialogResult.Yes)
|
if (result == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue