public MainWindow() { InitializeComponent(); initialised = true; // stops colour preview from breaking CurrentTool = Tools.ToolType.CreateElement; CurrentFEType = FestivalElement.FestivalElementType.Bin; canvasPreview.Children.Clear(); gridSelectionTools.Visibility = Visibility.Collapsed; zoom = 1; KeyboardNavigation.SetDirectionalNavigation(this, KeyboardNavigationMode.None); savePath = ""; this.Title = "Festival Designer - New"; }
void OnToolChange(Tools.ToolType newType) { if (CurrentTool == Tools.ToolType.Select) { // only show select panel if tool is select // if select is clicked when element is selected then selection is cleared if (selectedFE != null) { selectedFE.OnDeSelection(); } selectedFE = null; gridSelectionTools.Visibility = Visibility.Collapsed; } if (newType != Tools.ToolType.CreateElement) { CurrentFEType = FestivalElement.FestivalElementType.None; canvasPreview.Children.Clear(); } }
/// <summary> /// gets the type of FestivalElement to be created /// </summary> /// <param name="type">type of FestivalElement to be loaded</param> /// <param name="nColour">colour of new FE</param> /// <param name="nScaleX">x scale of new FE</param> /// <param name="nScaleY">y scale of new FE</param> /// <returns></returns> FestivalElement GetFEType(FestivalElement.FestivalElementType type, Brush nColour, double nScaleX, double nScaleY) { switch (type) { case FestivalElement.FestivalElementType.Square: return(new Square(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.Triangle: return(new Triangle(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.Bush: return(new Bush(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.Stage: return(new Stage(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.BeerTent: return(new BeerTent(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.Bin: return(new Bin(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.CampingZone: return(new CampingZone(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.FairGround: return(new FairGround(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.FoodTent: return(new FoodTent(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.Shop: return(new Shop(nColour, nScaleX, nScaleY)); case FestivalElement.FestivalElementType.Toilet: return(new Toilet(nColour, nScaleX, nScaleY)); default: return(new Bush(nColour, nScaleX, nScaleY)); } }
private void buttonFairGround_Click(object sender, RoutedEventArgs e) { CurrentTool = Tools.ToolType.CreateElement; CurrentFEType = FestivalElement.FestivalElementType.FairGround; }
private void buttonCampZone_Click(object sender, RoutedEventArgs e) { CurrentTool = Tools.ToolType.CreateElement; CurrentFEType = FestivalElement.FestivalElementType.CampingZone; }
private void buttonBeerTent_Click(object sender, RoutedEventArgs e) { CurrentTool = Tools.ToolType.CreateElement; CurrentFEType = FestivalElement.FestivalElementType.BeerTent; }