InputRoll - some more properties that will be needed
This commit is contained in:
parent
72f58bc69d
commit
d258733570
|
@ -162,6 +162,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[DefaultValue(true)]
|
[DefaultValue(true)]
|
||||||
public bool MultiSelect { get; set; }
|
public bool MultiSelect { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets whether or not the control is in input painting mode
|
||||||
|
/// </summary>
|
||||||
|
[Category("Behavior")]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool InputPaintingMode { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Event Handlers
|
#region Event Handlers
|
||||||
|
@ -196,6 +203,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[Category("Behavior")]
|
[Category("Behavior")]
|
||||||
public event SelectedIndexChangedHandler SelectedIndexChanged;
|
public event SelectedIndexChangedHandler SelectedIndexChanged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs whenever the mouse wheel is scrolled while the right mouse button is held
|
||||||
|
/// </summary>
|
||||||
|
[Category("Behavior")]
|
||||||
|
public event RightMouseScrollEventHandler RightMouseScrolled;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve the text for a cell
|
/// Retrieve the text for a cell
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -212,6 +225,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public delegate void SelectedIndexChangedHandler(object sender, EventArgs e);
|
public delegate void SelectedIndexChangedHandler(object sender, EventArgs e);
|
||||||
|
|
||||||
|
public delegate void RightMouseScrollEventHandler(object sender, MouseEventArgs e);
|
||||||
|
|
||||||
public class CellEventArgs
|
public class CellEventArgs
|
||||||
{
|
{
|
||||||
public CellEventArgs(Cell oldCell, Cell newCell)
|
public CellEventArgs(Cell oldCell, Cell newCell)
|
||||||
|
@ -232,10 +247,22 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
||||||
public Cell CurrentCell { get; set; }
|
public Cell CurrentCell { get; set; }
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public Cell LastCell { get; set; }
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public bool IsPaintDown { get; set; }
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
||||||
public bool UseCustomBackground { get; set; }
|
public bool UseCustomBackground { get; set; }
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public bool RightButtonHeld { get; set; }
|
||||||
|
|
||||||
public string UserSettingsSerialized()
|
public string UserSettingsSerialized()
|
||||||
{
|
{
|
||||||
return string.Empty; // TODO
|
return string.Empty; // TODO
|
||||||
|
@ -681,6 +708,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
protected override void OnMouseLeave(EventArgs e)
|
protected override void OnMouseLeave(EventArgs e)
|
||||||
{
|
{
|
||||||
CurrentCell = null;
|
CurrentCell = null;
|
||||||
|
IsPaintDown = false;
|
||||||
Refresh();
|
Refresh();
|
||||||
base.OnMouseLeave(e);
|
base.OnMouseLeave(e);
|
||||||
}
|
}
|
||||||
|
@ -724,6 +752,41 @@ namespace BizHawk.Client.EmuHawk
|
||||||
base.OnMouseClick(e);
|
base.OnMouseClick(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseDown(MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Button == MouseButtons.Left && InputPaintingMode)
|
||||||
|
{
|
||||||
|
IsPaintDown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Button == MouseButtons.Right)
|
||||||
|
{
|
||||||
|
RightButtonHeld = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnMouseDown(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseUp(MouseEventArgs e)
|
||||||
|
{
|
||||||
|
IsPaintDown = false;
|
||||||
|
RightButtonHeld = false;
|
||||||
|
|
||||||
|
base.OnMouseUp(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseWheel(MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (RightButtonHeld)
|
||||||
|
{
|
||||||
|
DoRightMouseScroll(this, e);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.OnMouseWheel(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Change Events
|
#region Change Events
|
||||||
|
@ -739,6 +802,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
#region Helpers
|
#region Helpers
|
||||||
|
|
||||||
|
private void DoRightMouseScroll(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (RightMouseScrolled != null)
|
||||||
|
{
|
||||||
|
RightMouseScrolled(sender, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void VerticalBar_ValueChanged(object sender, EventArgs e)
|
private void VerticalBar_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Refresh();
|
Refresh();
|
||||||
|
@ -904,6 +975,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (!newCell.Equals(CurrentCell))
|
if (!newCell.Equals(CurrentCell))
|
||||||
{
|
{
|
||||||
CellChanged(CurrentCell, newCell);
|
CellChanged(CurrentCell, newCell);
|
||||||
|
LastCell = CurrentCell;
|
||||||
CurrentCell = newCell;
|
CurrentCell = newCell;
|
||||||
|
|
||||||
if (IsHoveringOnColumnCell ||
|
if (IsHoveringOnColumnCell ||
|
||||||
|
|
Loading…
Reference in New Issue