Add tour step indicators, use LinkLabels

This commit is contained in:
John Lewin 2018-12-30 12:09:55 -08:00
parent a89567dea5
commit 5445736fd0
3 changed files with 140 additions and 9 deletions

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System.Collections.Generic;
using System.Linq;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
namespace MatterHackers.MatterControl.Tour
@ -38,6 +39,7 @@ namespace MatterHackers.MatterControl.Tour
private List<TourLocation> tourLocations;
private SystemWindow systemWindow;
private ThemeConfig theme;
private int _activeIndex = -1;
public ProductTour(SystemWindow topWindow, List<TourLocation> tourLocations, ThemeConfig theme)
{
@ -47,6 +49,8 @@ namespace MatterHackers.MatterControl.Tour
this.theme = theme;
}
public IReadOnlyList<TourLocation> Locations => tourLocations;
public static async void StartTour()
{
var topWindow = ApplicationController.Instance.MainView.TopmostParent() as SystemWindow;
@ -84,7 +88,21 @@ namespace MatterHackers.MatterControl.Tour
public int Count { get; }
public int ActiveIndex { get; private set; } = -1;
public int ActiveIndex
{
get =>_activeIndex;
set
{
if (_activeIndex != value)
{
_activeIndex = value;
this.ActiveItem = tourLocations[_activeIndex];
var tourOverlay = new TourOverlay(systemWindow, this, theme);
systemWindow.AddChild(tourOverlay);
}
}
}
public TourLocation ActiveItem { get; private set; }
@ -96,10 +114,6 @@ namespace MatterHackers.MatterControl.Tour
}
this.ActiveIndex = locationIndex;
this.ActiveItem = tourLocations[locationIndex];
var tourOverlay = new TourOverlay(systemWindow, this, theme);
systemWindow.AddChild(tourOverlay);
}
}
}