|
@@ -915,13 +915,20 @@ namespace Terminal.Gui {
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// Returns true if the given cell is selected either because it is the active cell or part of a multi cell selection (e.g. <see cref="FullRowSelect"/>)
|
|
|
|
|
|
+ /// <para>
|
|
|
|
+ /// Returns true if the given cell is selected either because it is the active cell or part of a multi cell selection (e.g. <see cref="FullRowSelect"/>).
|
|
|
|
+ /// </para>
|
|
|
|
+ /// <remarks>Returns <see langword="false"/> if <see cref="ColumnStyle.Visible"/> is <see langword="false"/>.</remarks>
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="col"></param>
|
|
/// <param name="col"></param>
|
|
/// <param name="row"></param>
|
|
/// <param name="row"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public bool IsSelected (int col, int row)
|
|
public bool IsSelected (int col, int row)
|
|
{
|
|
{
|
|
|
|
+ if(!IsColumnVisible(col)) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
// Cell is also selected if in any multi selection region
|
|
// Cell is also selected if in any multi selection region
|
|
if (MultiSelect && MultiSelectedRegions.Any (r => r.Rect.Contains (col, row)))
|
|
if (MultiSelect && MultiSelectedRegions.Any (r => r.Rect.Contains (col, row)))
|
|
return true;
|
|
return true;
|
|
@@ -934,6 +941,22 @@ namespace Terminal.Gui {
|
|
(col == SelectedColumn || FullRowSelect);
|
|
(col == SelectedColumn || FullRowSelect);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Returns true if the given <paramref name="columnIndex"/> indexes a visible
|
|
|
|
+ /// column otherwise false. Returns false for indexes that are out of bounds.
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="columnIndex"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private bool IsColumnVisible (int columnIndex)
|
|
|
|
+ {
|
|
|
|
+ // if the column index provided is out of bounds
|
|
|
|
+ if (columnIndex < 0 || columnIndex >= table.Columns.Count) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return this.Style.GetColumnStyleIfAny (Table.Columns [columnIndex])?.Visible ?? true;
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Positions the cursor in the area of the screen in which the start of the active cell is rendered. Calls base implementation if active cell is not visible due to scrolling or table is loaded etc
|
|
/// Positions the cursor in the area of the screen in which the start of the active cell is rendered. Calls base implementation if active cell is not visible due to scrolling or table is loaded etc
|
|
/// </summary>
|
|
/// </summary>
|