From a706aefd3dbf0552205dc0c850e2eba06bbf6e34 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 28 Mar 2019 18:06:45 +0200 Subject: Added "NewProjectDialog" dialog , styles and icons --- .../Tango.Scripting.IDE/Dialogs/AddNewControl.xaml | 130 +++++++++++++++++++++ .../Dialogs/AddNewControl.xaml.cs | 29 +++++ .../Dialogs/NewProjectDialog.xaml | 33 +++++- .../Dialogs/NewProjectDialog.xaml.cs | 30 ++++- .../Dialogs/NewProjectDialogVM.cs | 80 ++++++++++++- 5 files changed, 293 insertions(+), 9 deletions(-) create mode 100644 Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml create mode 100644 Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml.cs (limited to 'Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs') diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml new file mode 100644 index 000000000..e5857e5a5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name: + + Location + + + + + Solution name: + + + + + + + diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml.cs new file mode 100644 index 000000000..cdbea2199 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddNewControl.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.Dialogs +{ + /// + /// Interaction logic for AddNewControl.xaml + /// + public partial class AddNewControl : UserControl + { + public AddNewControl() + { + InitializeComponent(); + } + + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml index 7942a7165..9fa8422c9 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml @@ -1,12 +1,35 @@ - - - + Title="Add New Project" + WindowStyle="ToolWindow" + ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" + FontSize="12" + Height="630" Width="950" > + + + + + + + + + + + + + + + + + + + + - + diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml.cs index 376190e3a..f3e05e35f 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialog.xaml.cs @@ -1,4 +1,5 @@ -using System; + +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -18,11 +19,34 @@ namespace Tango.Scripting.IDE.Dialogs /// /// Interaction logic for NewProjectDialog.xaml /// - public partial class NewProjectDialog : UserControl + public partial class NewProjectDialog : Window { - public NewProjectDialog() + static string _sAddNewProjectTitle = "Add New Project"; + static string _sNewProjectTitle = "New Project"; + protected bool _bNewProject; + + + public NewProjectDialog(bool bNewProject) { + _bNewProject = bNewProject; + InitializeComponent(); + Title = bNewProject ? _sAddNewProjectTitle : _sNewProjectTitle; + + } + private void CancelDialog(object sender, RoutedEventArgs e) + { + // Dialog box canceled + DialogResult = false; + } + + private void OKDialog(object sender, RoutedEventArgs e) + { + // Don't accept the dialog box if there is invalid data + // if (!IsValid(this)) return; + + // Dialog box accepted + DialogResult = true; } } } diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialogVM.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialogVM.cs index 3c25e70f3..f7e31b75a 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialogVM.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectDialogVM.cs @@ -1,14 +1,92 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.Scripting.IDE.ProjectTypes; using Tango.SharedUI; namespace Tango.Scripting.IDE.Dialogs { - public class NewProjectDialogVM : ViewModel + public class NewProjectDialogVM : DialogViewVM { + public ObservableCollection ProjectTypes { get; set; } + public List Locations { get; set; } + private IProjectType _selectedProjectType = null; + public IProjectType SelectedProjectType + { + get { return _selectedProjectType; } + set { _selectedProjectType = value; + RaisePropertyChangedAuto(); + RaisePropertyChanged("LargeImage"); + RaisePropertyChanged("SelectedDescription"); + } + } + private BitmapSource _defaultLargeImage = ProjectType.GetImage("Images/test.png"); + public BitmapSource LargeImage + { + get + { + if (SelectedProjectType != null) + return SelectedProjectType.LargeImage; + else return _defaultLargeImage; + } + } + public string SelectedDescription + { + get + { + if (SelectedProjectType != null) + return SelectedProjectType.Description; + return ""; + } + } + private String _projectName = "App1"; + public String ProjectName + { + get { return _projectName; } + set { _projectName = value; RaisePropertyChangedAuto(); } + } + private String _projectLocation; + public String ProjectLocation + { + get { return _projectLocation; } + set { _projectLocation = value; RaisePropertyChangedAuto(); } + } + + private String _solutionName = "App1"; + public String SolutionName + { + get { return _solutionName; } + set { _solutionName = value; RaisePropertyChangedAuto(); } + } + public NewProjectDialogVM() : base() + { + ProjectTypes = new ObservableCollection(); + RegisterProjectType(new StubProjectType()); + RegisterProjectType(new UnitTestProjectType()); + + _selectedProjectType = ProjectTypes.FirstOrDefault(); + + string workingDirectory = Environment.CurrentDirectory; + _projectLocation = Directory.GetParent(workingDirectory).Parent.Parent.FullName; + + Locations = new List(); + Locations.Add(_projectLocation); + + } + public void RegisterProjectType(IProjectType projectType) + { + ProjectTypes.Add(projectType); + } + + public void UnRegisterProjectItemHandler(IProjectType projectType) + { + ProjectTypes.Remove(projectType); + } } } -- cgit v1.3.1