Input Roll - small progress on item selection
This commit is contained in:
parent
9e234b3bf5
commit
2f9c33386e
|
@ -13,6 +13,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
private readonly GDIRenderer Gdi;
|
||||
private readonly RollColumns Columns = new RollColumns();
|
||||
private readonly List<Cell> SelectedItems = new List<Cell>();
|
||||
|
||||
private int _horizontalOrientedColumnWidth = 0;
|
||||
private Size _charSize;
|
||||
|
@ -185,6 +186,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
return Columns[index];
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
||||
public IEnumerable<int> SelectedIndices
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelectedItems
|
||||
.Where(cell => cell.RowIndex.HasValue)
|
||||
.Select(cell => cell.RowIndex.Value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Paint
|
||||
|
@ -506,6 +519,20 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
ColumnClickEvent(ColumnAtX(e.X));
|
||||
}
|
||||
else if (IsHoveringOnDataCell)
|
||||
{
|
||||
if (ModifierKeys.HasFlag(Keys.Control) || ModifierKeys.HasFlag(Keys.Shift))
|
||||
{
|
||||
MessageBox.Show("Multiselect options have not yet been implemented");
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedItems.Add(CurrentCell);
|
||||
}
|
||||
|
||||
// TODO: selected index changed event
|
||||
Refresh();
|
||||
}
|
||||
|
||||
base.OnMouseClick(e);
|
||||
}
|
||||
|
@ -524,6 +551,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private bool IsHoveringOnDataCell
|
||||
{
|
||||
get
|
||||
{
|
||||
return CurrentCell != null &&
|
||||
CurrentCell.Column != null &&
|
||||
CurrentCell.RowIndex.HasValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculatePointedCell(int x, int y)
|
||||
{
|
||||
bool wasHoveringColumnCell = IsHoveringOnColumnCell;
|
||||
|
|
Loading…
Reference in New Issue