From edeab8038766c398eb028194fa0d6ae7a3d3fe61 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Thu, 3 May 2012 21:50:31 +0100 Subject: [PATCH] Convert Python tools options panel to WPF. --- .../Project/PythonBinding.csproj | 16 +++- .../Project/Src/PythonOptionsPanel.cs | 51 ------------ .../Project/Src/PythonOptionsPanel.xaml | 44 ++++++++++ .../Project/Src/PythonOptionsPanel.xaml.cs | 71 ++++++++++++++++ .../Test/Gui/PythonOptionsPanelTestFixture.cs | 82 ------------------- .../Test/PythonBinding.Tests.csproj | 5 +- 6 files changed, 134 insertions(+), 135 deletions(-) delete mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.cs create mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.xaml create mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.xaml.cs delete mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/PythonOptionsPanelTestFixture.cs diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj index 7ef52b02c6..c53570582d 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj @@ -128,6 +128,10 @@ + + PythonOptionsPanel.xaml + Code + @@ -178,7 +182,6 @@ - @@ -278,11 +281,19 @@ ICSharpCode.Core False + + {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9} + ICSharpCode.Core.Presentation + {924EE450-603D-49C1-A8E5-4AFAA31CE6F3} ICSharpCode.SharpDevelop.Dom False + + {8035765F-D51F-4A0C-A746-2FD100E19419} + ICSharpCode.SharpDevelop.Widgets + {1F261725-6318-4434-A1B1-6C70CE4CD324} UnitTesting @@ -299,4 +310,7 @@ False + + + \ No newline at end of file diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.cs deleted file mode 100644 index b4c2eed78a..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - -using System; -using System.Drawing; -using System.Windows.Forms; -using ICSharpCode.SharpDevelop.Gui; -using ICSharpCode.SharpDevelop.Gui.OptionPanels; -using ICSharpCode.SharpDevelop.Project; - -namespace ICSharpCode.PythonBinding -{ - /// - /// Panel that displays the python options. - /// - public class PythonOptionsPanel : XmlFormsOptionPanel - { - PythonAddInOptions options; - TextBox pythonFileNameTextBox; - TextBox pythonLibraryPathTextBox; - - public PythonOptionsPanel() : this(new PythonAddInOptions()) - { - } - - public PythonOptionsPanel(PythonAddInOptions options) - { - this.options = options; - } - - public override void LoadPanelContents() - { - SetupFromXmlStream(GetType().Assembly.GetManifestResourceStream("ICSharpCode.PythonBinding.Resources.PythonOptionsPanel.xfrm")); - - pythonFileNameTextBox = (TextBox)ControlDictionary["pythonFileNameTextBox"]; - pythonFileNameTextBox.Text = options.PythonFileName; - - pythonLibraryPathTextBox = (TextBox)ControlDictionary["pythonLibraryPathTextBox"]; - pythonLibraryPathTextBox.Text = options.PythonLibraryPath; - - ConnectBrowseButton("browseButton", "pythonFileNameTextBox", "${res:SharpDevelop.FileFilter.ExecutableFiles}|*.exe", TextBoxEditMode.EditRawProperty); - } - - public override bool StorePanelContents() - { - options.PythonFileName = pythonFileNameTextBox.Text; - options.PythonLibraryPath = pythonLibraryPathTextBox.Text; - return true; - } - } -} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.xaml b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.xaml new file mode 100644 index 0000000000..7f23974725 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonOptionsPanel.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + +