VirtualPad Analog button - if not in sticky mode, update every frame with the current value, and a slight tweak to read-only view

This commit is contained in:
adelikat 2014-07-04 15:40:21 +00:00
parent c3b57a6ddf
commit e5b5daeaa0
1 changed files with 14 additions and 0 deletions

View File

@ -64,6 +64,7 @@ namespace BizHawk.Client.EmuHawk
if (_readonly != value)
{
AnalogTrackBar.Enabled =
DisplayNameLabel.Enabled =
ValueLabel.Enabled =
!value;
@ -166,5 +167,18 @@ namespace BizHawk.Client.EmuHawk
Global.StickyXORAdapter.SetFloat(Name, AnalogTrackBar.Value);
}
}
protected override void OnPaint(PaintEventArgs e)
{
if (!_isSet)
{
_programmaticallyChangingValue = true;
AnalogTrackBar.Value = (int)Global.StickyXORAdapter.GetFloat(Name);
ValueLabel.Text = AnalogTrackBar.Value.ToString();
_programmaticallyChangingValue = false;
}
base.OnPaint(e);
}
}
}