Replace `LuaPictureBox` prop init with constructor
This commit is contained in:
parent
e5e055b7a4
commit
b51bb85c82
|
@ -305,7 +305,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return 0;
|
||||
}
|
||||
|
||||
var pictureBox = new LuaPictureBox { TableHelper = _th };
|
||||
LuaPictureBox pictureBox = new(_th);
|
||||
form.Controls.Add(pictureBox);
|
||||
const string FUNC_NAME = "forms.pictureBox";
|
||||
ProcessPositionArguments(x: x, y: y, pictureBox, functionName: FUNC_NAME);
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
luaPictureBox = new LuaPictureBox
|
||||
luaPictureBox = new(_th)
|
||||
{
|
||||
Image = Properties.Resources.LuaPictureBox,
|
||||
Location = new Point(0, 0),
|
||||
|
@ -65,7 +65,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
Size = new Size(100, 50),
|
||||
SizeMode = PictureBoxSizeMode.AutoSize,
|
||||
TabIndex = 0,
|
||||
TableHelper = _th,
|
||||
TabStop = false
|
||||
};
|
||||
Controls.Add(luaPictureBox);
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private readonly Dictionary<Color, SolidBrush> _solidBrushes = new Dictionary<Color, SolidBrush>();
|
||||
private readonly Dictionary<Color, Pen> _pens = new Dictionary<Color, Pen>();
|
||||
|
||||
internal NLuaTableHelper TableHelper { get; set; }
|
||||
private readonly NLuaTableHelper TableHelper;
|
||||
|
||||
private SolidBrush GetBrush([LuaColorParam] object color)
|
||||
=> _solidBrushes.GetValueOrPutNew1(TableHelper.ParseColor(color));
|
||||
|
@ -29,9 +29,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
private Color? _defaultBackground;
|
||||
private Color? _defaultTextBackground = Color.FromArgb(128, 0, 0, 0);
|
||||
|
||||
public LuaPictureBox()
|
||||
public LuaPictureBox(NLuaTableHelper tableHelper)
|
||||
{
|
||||
Image = new Bitmap(Width, Height);
|
||||
TableHelper = tableHelper;
|
||||
}
|
||||
|
||||
public void LuaResize(int width, int height)
|
||||
|
|
Loading…
Reference in New Issue