2016-12-11 14:25:29 -05:00
|
|
|
using System.Windows.Forms;
|
|
|
|
using System.Drawing;
|
|
|
|
using Mesen.GUI;
|
2017-09-18 21:40:21 -04:00
|
|
|
using System;
|
2018-06-09 17:54:34 -04:00
|
|
|
using System.ComponentModel;
|
2016-12-11 14:25:29 -05:00
|
|
|
|
|
|
|
namespace Mesen.GUI.Controls
|
|
|
|
{
|
|
|
|
public class BaseControl : UserControl
|
|
|
|
{
|
2016-12-18 12:43:20 -05:00
|
|
|
public static float DefaultFontSize = Program.IsMono ? 10 : 12;
|
2017-09-18 21:40:21 -04:00
|
|
|
|
2016-12-11 14:25:29 -05:00
|
|
|
public static string MonospaceFontFamily
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if(Program.IsMono) {
|
2020-02-03 15:06:54 -05:00
|
|
|
return "monospace";
|
2016-12-11 14:25:29 -05:00
|
|
|
} else {
|
|
|
|
return "Consolas";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-09 21:25:49 -04:00
|
|
|
private static bool? _isDesignMode = null;
|
2018-06-09 17:54:34 -04:00
|
|
|
public bool IsDesignMode
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
try {
|
2018-06-09 21:25:49 -04:00
|
|
|
if(!_isDesignMode.HasValue) {
|
|
|
|
_isDesignMode = System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv";
|
|
|
|
}
|
|
|
|
return _isDesignMode.Value || LicenseManager.UsageMode == LicenseUsageMode.Designtime;
|
2018-06-09 17:54:34 -04:00
|
|
|
} catch {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-18 21:40:21 -04:00
|
|
|
public static Bitmap DownArrow
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if(!Program.IsMono && Environment.OSVersion.Version >= new Version(6, 2)) {
|
|
|
|
return Properties.Resources.DownArrowWin10;
|
|
|
|
} else {
|
2019-01-27 01:11:25 -05:00
|
|
|
return ThemeHelper.IsDark ? Properties.Resources.DownArrowDarkTheme : Properties.Resources.DownArrow;
|
2017-09-18 21:40:21 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-11 14:25:29 -05:00
|
|
|
public new AutoScaleMode AutoScaleMode
|
|
|
|
{
|
|
|
|
set {
|
|
|
|
if(Program.IsMono) {
|
2017-09-16 22:02:05 -04:00
|
|
|
base.AutoScaleMode = AutoScaleMode.None;
|
2016-12-11 14:25:29 -05:00
|
|
|
} else {
|
|
|
|
base.AutoScaleMode = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-17 00:54:30 -04:00
|
|
|
|
|
|
|
public new SizeF AutoScaleDimensions
|
|
|
|
{
|
|
|
|
set
|
|
|
|
{
|
|
|
|
if(!Program.IsMono) {
|
|
|
|
base.AutoScaleDimensions = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-12-11 14:25:29 -05:00
|
|
|
}
|
|
|
|
}
|