Browse Source

CppBinding moved to ICSharpCode namespace

Preprocessor and linker tabs in project options.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4420 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Tomasz Tretkowski 17 years ago
parent
commit
c6e0ffa15c
  1. 18
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.addin
  2. 19
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj
  3. 4
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppLanguageBinding.cs
  4. 4
      src/AddIns/BackendBindings/CppBinding/CppBinding/Parser/CppCompilationUnitBuilder.cs
  5. 2
      src/AddIns/BackendBindings/CppBinding/CppBinding/Parser/CppParser.cs
  6. 34
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ApplicationOptions.cs
  7. 2
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/CppProject.cs
  8. 99
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ItemDefinitionGroupBinding.cs
  9. 54
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.cs
  10. 42
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ObservedBinding.cs
  11. 61
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/OpenStringListEditorEvent.cs
  12. 48
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/PreprocessorOptions.cs
  13. 2
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ProjectConfigurationProjectItem.cs
  14. 2
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/SpecifyCliRuntimeLibraryCommand.cs
  15. 90
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialog.Designer.cs
  16. 52
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialog.cs
  17. 135
      src/AddIns/BackendBindings/CppBinding/CppBinding/Resources/LinkerOptions.xfrm
  18. 100
      src/AddIns/BackendBindings/CppBinding/CppBinding/Resources/PreprocessorOptions.xfrm
  19. 3
      src/Main/Base/Project/Src/Gui/Components/StringListEditor.cs

18
src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.addin

@ -9,13 +9,19 @@
</Runtime> </Runtime>
<Manifest> <Manifest>
<Identity name="CppBinding" /> <Identity name="ICSharpCode.CppBinding" />
</Manifest> </Manifest>
<Path path = "/SharpDevelop/BackendBindings/ProjectOptions/C++"> <Path path = "/SharpDevelop/BackendBindings/ProjectOptions/C++">
<OptionPanel id = "Application" <OptionPanel id = "Application"
label = "${res:Dialog.ProjectOptions.ApplicationSettings}" label = "${res:Dialog.ProjectOptions.ApplicationSettings}"
class = "CppBinding.Project.ApplicationOptions"/> class = "ICSharpCode.CppBinding.Project.ApplicationOptions" />
<OptionPanel id = "Preprocessor"
label = "${res:ICSharpCode.CppBinding.ProjectOptions.Preprocessor}"
class = "ICSharpCode.CppBinding.Project.PreprocessorOptions" />
<OptionPanel id = "Linker"
label = "${res:ICSharpCode.CppBinding.ProjectOptions.Linker}"
class = "ICSharpCode.CppBinding.Project.LinkerOptions" />
<!--<OptionPanel id = "ReferencePaths" <!--<OptionPanel id = "ReferencePaths"
label = "${res:Dialog.ProjectOptions.ReferencePaths}" label = "${res:Dialog.ProjectOptions.ReferencePaths}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ReferencePaths"/> class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ReferencePaths"/>
@ -37,7 +43,7 @@
<Path name = "/SharpDevelop/BackendBindings/TemplateCommands"> <Path name = "/SharpDevelop/BackendBindings/TemplateCommands">
<Class id="SpecifyCppCliRuntimeLibrary" <Class id="SpecifyCppCliRuntimeLibrary"
class="CppBinding.Project.SpecifyCliRuntimeLibraryCommand"/> class="ICSharpCode.CppBinding.Project.SpecifyCliRuntimeLibraryCommand"/>
</Path> </Path>
<Path name="/SharpDevelop/Workbench/Combine/FileFilter"> <Path name="/SharpDevelop/Workbench/Combine/FileFilter">
@ -61,14 +67,14 @@
guid="{0E96FCFA-9DAC-4534-AC18-01A90C368873}" guid="{0E96FCFA-9DAC-4534-AC18-01A90C368873}"
supportedextensions=".cpp;*.c;*.hpp;*.c" supportedextensions=".cpp;*.c;*.hpp;*.c"
projectfileextension=".vcxproj" projectfileextension=".vcxproj"
class="CppBinding.CppLanguageBinding" /> class="ICSharpCode.CppBinding.CppLanguageBinding" />
</Path> </Path>
<Path name="/Workspace/Parser"> <Path name="/Workspace/Parser">
<Parser id="C++" <Parser id="C++"
supportedextensions="*.cpp;*.c;*.hpp;*.h" supportedextensions="*.cpp;*.c;*.hpp;*.h"
projectfileextension="vcxproj" projectfileextension="vcxproj"
class="CppBinding.CppParser" /> class="ICSharpCode.CppBinding.CppParser" />
</Path> </Path>
</AddIn> </AddIn>

19
src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj

@ -4,7 +4,6 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>CppBinding</RootNamespace>
<AssemblyName>CppBinding</AssemblyName> <AssemblyName>CppBinding</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SourceAnalysisOverrideSettingsFile>C:\Users\trecio\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile> <SourceAnalysisOverrideSettingsFile>C:\Users\trecio\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>
@ -27,6 +26,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunCodeAnalysis>False</RunCodeAnalysis> <RunCodeAnalysis>False</RunCodeAnalysis>
<RootNamespace>ICSharpCode.CppBinding</RootNamespace>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\..\..\..\AddIns\AddIns\BackendBindings\CppBinding\</OutputPath> <OutputPath>..\..\..\..\..\AddIns\AddIns\BackendBindings\CppBinding\</OutputPath>
@ -66,10 +66,24 @@
<Compile Include="Project\ApplicationOptions.cs"> <Compile Include="Project\ApplicationOptions.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Project\LinkerOptions.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Project\ItemDefinitionGroupBinding.cs" />
<Compile Include="Project\ObservedBinding.cs" /> <Compile Include="Project\ObservedBinding.cs" />
<Compile Include="Project\OpenStringListEditorEvent.cs" />
<Compile Include="Project\PreprocessorOptions.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Project\ProjectConfigurationProjectItem.cs" /> <Compile Include="Project\ProjectConfigurationProjectItem.cs" />
<Compile Include="Project\SpecifyCliRuntimeLibraryCommand.cs" /> <Compile Include="Project\SpecifyCliRuntimeLibraryCommand.cs" />
<Compile Include="Project\CppProject.cs" /> <Compile Include="Project\CppProject.cs" />
<Compile Include="Project\StringListEditorDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Project\StringListEditorDialog.Designer.cs">
<DependentUpon>StringListEditorDialog.cs</DependentUpon>
</Compile>
<None Include="CppBinding.addin"> <None Include="CppBinding.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
@ -77,6 +91,8 @@
<Compile Include="Configuration\AssemblyInfo.cs" /> <Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="CppLanguageBinding.cs" /> <Compile Include="CppLanguageBinding.cs" />
<Compile Include="Parser\CppParser.cs" /> <Compile Include="Parser\CppParser.cs" />
<EmbeddedResource Include="Resources\PreprocessorOptions.xfrm" />
<EmbeddedResource Include="Resources\LinkerOptions.xfrm" />
<None Include="Templates\ConsoleProject.xpt"> <None Include="Templates\ConsoleProject.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
@ -115,4 +131,5 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup />
</Project> </Project>

4
src/AddIns/BackendBindings/CppBinding/CppBinding/CppLanguageBinding.cs

@ -1,4 +1,3 @@
using CppBinding.Project;
/* /*
* Created by SharpDevelop. * Created by SharpDevelop.
* User: trecio * User: trecio
@ -7,10 +6,11 @@ using CppBinding.Project;
* *
* To change this template use Tools | Options | Coding | Edit Standard Headers. * To change this template use Tools | Options | Coding | Edit Standard Headers.
*/ */
using ICSharpCode.CppBinding.Project;
using ICSharpCode.SharpDevelop.Internal.Templates; using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
namespace CppBinding namespace ICSharpCode.CppBinding
{ {
/// <summary> /// <summary>
/// Description of CppLanguageBinding. /// Description of CppLanguageBinding.

4
src/AddIns/BackendBindings/CppBinding/CppBinding/Parser/CppCompilationUnitBuilder.cs

@ -1,10 +1,10 @@
#if false #if false
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using CppBinding.Interop; using ICSharpCode.CppBinding.Interop;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
namespace CppBinding.Parser namespace ICSharpCode.CppBinding.Parser
{ {
/// <summary> /// <summary>
/// Builds the compilation unit based on events reported by c++ parser. /// Builds the compilation unit based on events reported by c++ parser.

2
src/AddIns/BackendBindings/CppBinding/CppBinding/Parser/CppParser.cs

@ -11,7 +11,7 @@ using System.IO;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
namespace CppBinding.Parser namespace ICSharpCode.CppBinding.Parser
{ {
/// <summary> /// <summary>
/// Description of Parser. /// Description of Parser.

34
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ApplicationOptions.cs

@ -11,7 +11,7 @@ using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.Core; using ICSharpCode.Core;
using System.Windows.Forms; using System.Windows.Forms;
namespace CppBinding.Project namespace ICSharpCode.CppBinding.Project
{ {
/// <summary> /// <summary>
/// Application settings panel for c++ project. /// Application settings panel for c++ project.
@ -56,17 +56,17 @@ namespace CppBinding.Project
{ {
switch (outputType) switch (outputType)
{ {
case OutputType.Exe: case OutputType.Exe:
return "Application"; return "Application";
case OutputType.Library: case OutputType.Library:
return "DynamicLibrary"; return "DynamicLibrary";
case OutputType.Module: case OutputType.Module:
//TODO: get an apropriate way to handle netmodule creation //TODO: get an apropriate way to handle netmodule creation
//see: http://msdn.microsoft.com/en-us/library/k669k83h(VS.80).aspx //see: http://msdn.microsoft.com/en-us/library/k669k83h(VS.80).aspx
LoggingService.Info(".netmodule output not supported, will produce a class library"); LoggingService.Info(".netmodule output not supported, will produce a class library");
return "DynamicLibrary"; return "DynamicLibrary";
case OutputType.WinExe: case OutputType.WinExe:
return "Application"; return "Application";
} }
throw new ArgumentException("Unknown OutputType value " + outputType); throw new ArgumentException("Unknown OutputType value " + outputType);
} }
@ -74,20 +74,20 @@ namespace CppBinding.Project
static string OutputTypeToSubsystem(OutputType outputType) static string OutputTypeToSubsystem(OutputType outputType)
{ {
if (OutputType.WinExe == outputType) if (OutputType.WinExe == outputType)
return "Windows"; return "Windows";
return "Console"; return "Console";
} }
static OutputType ConfigurationTypeToOutputType(string configurationType, string subsystem) static OutputType ConfigurationTypeToOutputType(string configurationType, string subsystem)
{ {
if ("Application" == configurationType && "Windows" != subsystem) if ("Application" == configurationType && "Windows" != subsystem)
return OutputType.Exe; return OutputType.Exe;
else if ("Application" == configurationType && "Windows" == subsystem) else if ("Application" == configurationType && "Windows" == subsystem)
return OutputType.WinExe; return OutputType.WinExe;
else if ("DynamicLibrary" == configurationType) else if ("DynamicLibrary" == configurationType)
return OutputType.Library; return OutputType.Library;
LoggingService.Info("ConfigurationType " +configurationType + " are not supported, will use Library output type"); LoggingService.Info("ConfigurationType " +configurationType + " are not supported, will use Library output type");
return OutputType.Library; return OutputType.Library;
} }
#endregion #endregion
} }

2
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/CppProject.cs

@ -4,7 +4,7 @@ using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Internal.Templates; using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
namespace CppBinding.Project namespace ICSharpCode.CppBinding.Project
{ {
public class CppProject : CompilableProject public class CppProject : CompilableProject
{ {

99
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ItemDefinitionGroupBinding.cs

@ -0,0 +1,99 @@
/*
* Utworzone przez SharpDevelop.
* Użytkownik: trecio
* Data: 2009-07-09
* Godzina: 11:15
*
* Do zmiany tego szablonu użyj Narzędzia | Opcje | Kodowanie | Edycja Nagłówków Standardowych.
*/
using System;
using ICSharpCode.SharpDevelop.Project;
using System.Windows.Forms;
namespace ICSharpCode.CppBinding.Project
{
/// <summary>
/// Configuration gui binding that connects a given control and a specified metadata value in Item Definition Group element.
///</summary>
public class ItemDefinitionGroupBinding<ControlType> : ConfigurationGuiBinding
where ControlType : Control
{
public delegate string GetValueDelegate(ControlType c);
public delegate void SetValueDelegate(ControlType c, string val);
public ItemDefinitionGroupBinding(ControlType c, string elementName, string metadataName) :
this(c, elementName, metadataName, null, null)
{
}
/// <summary>
/// Creates the binding.
/// </summary>
/// <param name="c">control which is being bind</param>
/// <param name="elementName">element name in the item definition group</param>
/// <param name="metadataName">name of the element metadata which value is bind to control</param>
/// <param name="getValue">function used to get string value of configuration attribute from control</param>
/// <param name="setValue">function used to set controls' state from string</param>
public ItemDefinitionGroupBinding(ControlType c, string elementName, string metadataName,
GetValueDelegate getValue, SetValueDelegate setValue) {
if (getValue == null)
getValue = DefaultGetValue;
if (setValue == null)
setValue = DefaultSetValue;
this.control = c;
this.elementName = elementName;
this.metadataName = metadataName;
this.getControlValue = getValue;
this.setControlValue = setValue;
c.TextChanged += SetHelperDirty;
}
public override void Load()
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(Project,
Helper.Configuration, Helper.Platform);
setControlValue(control, group.GetElementMetadata(elementName, metadataName));
}
public override bool Save()
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(Project,
Helper.Configuration, Helper.Platform);
string controlValue = getControlValue(control);
group.SetElementMetadata(elementName, metadataName, controlValue);
return true;
}
protected void SetHelperDirty(object o, EventArgs e)
{
Helper.IsDirty = true;
}
ControlType control;
string elementName;
string metadataName;
GetValueDelegate getControlValue;
SetValueDelegate setControlValue;
private string DefaultGetValue(ControlType c) { return c.Text; }
private void DefaultSetValue(ControlType c, string val) { c.Text = val; }
}
public class CheckBoxItemDefinitionGroupBinding : ItemDefinitionGroupBinding<CheckBox> {
public CheckBoxItemDefinitionGroupBinding(CheckBox c, string elementName, string metadataName) :
base(c, elementName, metadataName,
delegate (CheckBox checkBox) {
return checkBox.Checked ? "true" : "false";
},
delegate (CheckBox checkBox, string val) {
bool check;
if (bool.TryParse(val, out check))
checkBox.Checked = check;
})
{
c.TextChanged -= SetHelperDirty;
c.CheckedChanged += SetHelperDirty;
}
}
}

54
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.cs

@ -0,0 +1,54 @@
/*
* Utworzone przez SharpDevelop.
* Użytkownik: trecio
* Data: 2009-07-08
* Godzina: 12:07
*
* Do zmiany tego szablonu użyj Narzędzia | Opcje | Kodowanie | Edycja Nagłówków Standardowych.
*/
using ICSharpCode.Core;
using System;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.CppBinding.Project
{
using ListEditor = ICSharpCode.CppBinding.Project.OpenStringListEditorEvent<TextBox>;
/// <summary>
/// Directory settings for c++ application.
/// </summary>
public class LinkerOptions : AbstractXmlFormsProjectOptionPanel
{
public override void LoadPanelContents()
{
SetupFromXmlStream(GetType().Assembly.GetManifestResourceStream(
"ICSharpCode.CppBinding.Resources.LinkerOptions.xfrm"));
InitializeHelper();
helper.BindString("libraryPathTextBox", "LibraryPath", TextBoxEditMode.EditRawProperty);
Get<Button>("libraryPath").Click += ListEditor.DirectoriesEditor(this, "libraryPath").Event;
TextBox additionalLibsTextBox = Get<TextBox>("additionalLibs");
helper.AddBinding(null, new ItemDefinitionGroupBinding<TextBox>(additionalLibsTextBox, "Link", "AdditionalDependencies"));
Get<Button>("additionalLibs").Click += ListEditor.SymbolsEditor(this, "additionalLibs").Event;
TextBox addModuleTextBox = Get<TextBox>("addModule");
helper.AddBinding(null, new ItemDefinitionGroupBinding<TextBox>(addModuleTextBox, "Link", "AddModuleNamesToAssembly"));
Get<Button>("addModule").Click += ListEditor.SymbolsEditor(this, "addModule").Event;
CheckBox debugInfoCheckBox = Get<CheckBox>("debugInfo");
helper.AddBinding(null, new CheckBoxItemDefinitionGroupBinding(debugInfoCheckBox, "Link", "GenerateDebugInformation"));
TextBox resourceFileTextBox = Get<TextBox>("resourceFile");
helper.AddBinding(null, new ItemDefinitionGroupBinding<TextBox>(resourceFileTextBox, "Link", "EmbedManagedResourceFile"));
Get<Button>("resourceFile").Click += ListEditor.SymbolsEditor(this, "resourceFile").Event;
TextBox additionalOptionsTextBox = Get<TextBox>("additionalOptions");
helper.AddBinding(null, new ItemDefinitionGroupBinding<TextBox>(additionalOptionsTextBox, "Link", "AdditionalOptions"));
}
}
}

42
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ObservedBinding.cs

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICSharpCode.SharpDevelop.Project;
using System.Windows.Forms;
namespace ICSharpCode.CppBinding.Project
{
public class ObservedBinding<Output, ControlType> : ConfigurationGuiBinding
where ControlType : Control
{
public delegate Output ObserverDelegate(ControlType c);
public delegate void LoaderDelegate(ControlType c);
public ObservedBinding(ControlType control, ObserverDelegate saveDelegate) : this(control, saveDelegate, null)
{
}
public ObservedBinding(ControlType control, ObserverDelegate saveDelegate, LoaderDelegate loadDelegate) {
this.control = control;
this.onLoad = loadDelegate;
this.onSave = saveDelegate;
}
public override void Load() {
if (onLoad != null)
onLoad(control);
}
public override bool Save()
{
if (onSave != null)
base.Set<Output>(onSave(control));
return true;
}
private ControlType control;
private LoaderDelegate onLoad;
private ObserverDelegate onSave;
}
}

61
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/OpenStringListEditorEvent.cs

@ -0,0 +1,61 @@
/*
* Utworzone przez SharpDevelop.
* Użytkownik: trecio
* Data: 2009-07-09
* Godzina: 10:46
*
* Do zmiany tego szablonu użyj Narzędzia | Opcje | Kodowanie | Edycja Nagłówków Standardowych.
*/
using ICSharpCode.Core;
using System;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
namespace ICSharpCode.CppBinding.Project
{
sealed class OpenStringListEditorEvent<ControlType> where ControlType : Control {
public OpenStringListEditorEvent(XmlUserControl parent, string controlId) {
this.sourceControl = parent.Get<ControlType>(controlId);
this.listCaption = parent.Get<Label>(controlId).Text;
this.ShowBrowseButton = false;
}
public bool ShowBrowseButton { get; set; }
public string TitleText { get; set; }
public void Event(object source, EventArgs evt) {
using (StringListEditorDialog editor = new StringListEditorDialog()) {
string[] strings = sourceControl.Text.Split(';');
editor.BrowseForDirectory = ShowBrowseButton;
editor.ListCaption = listCaption;
if (TitleText != null)
editor.TitleText = TitleText;
editor.LoadList(strings);
if (editor.ShowDialog() == DialogResult.OK) {
strings = editor.GetList();
sourceControl.Text = string.Join(";", strings);
}
}
}
public static OpenStringListEditorEvent<ControlType> DirectoriesEditor(XmlUserControl parent, string controlId)
{
OpenStringListEditorEvent<ControlType> editor = new OpenStringListEditorEvent<ControlType>(parent, controlId);
editor.ShowBrowseButton = true;
editor.TitleText = StringParser.Parse("${res:Dialog.ExportProjectToHtml.FolderLabel}");
return editor;
}
public static OpenStringListEditorEvent<ControlType> SymbolsEditor(XmlUserControl parent, string controlId)
{
OpenStringListEditorEvent<ControlType> editor = new OpenStringListEditorEvent<ControlType>(parent, controlId);
editor.ShowBrowseButton = false;
editor.TitleText = StringParser.Parse("${res:ICSharpCode.CppBinding.ProjectOptions.SymbolLabel}:");
return editor;
}
string listCaption;
ControlType sourceControl;
}
}

48
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/PreprocessorOptions.cs

@ -0,0 +1,48 @@
/*
* Utworzone przez SharpDevelop.
* Użytkownik: trecio
* Data: 2009-07-08
* Godzina: 12:07
*
* Do zmiany tego szablonu użyj Narzędzia | Opcje | Kodowanie | Edycja Nagłówków Standardowych.
*/
using ICSharpCode.Core;
using System;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.CppBinding.Project
{
using ListEditor = ICSharpCode.CppBinding.Project.OpenStringListEditorEvent<TextBox>;
/// <summary>
/// Directory settings for c++ application.
/// </summary>
public class PreprocessorOptions : AbstractXmlFormsProjectOptionPanel
{
public override void LoadPanelContents()
{
SetupFromXmlStream(GetType().Assembly.GetManifestResourceStream(
"ICSharpCode.CppBinding.Resources.PreprocessorOptions.xfrm"));
InitializeHelper();
TextBox defineTextBox = Get<TextBox>("define");
helper.AddBinding(null, new ItemDefinitionGroupBinding<TextBox>(defineTextBox, "ClCompile", "PreprocessorDefinitions"));
Get<Button>("define").Click += ListEditor.SymbolsEditor(this, "define").Event;
helper.BindString("includePathTextBox", "IncludePath", TextBoxEditMode.EditRawProperty);
Get<Button>("includePath").Click += ListEditor.DirectoriesEditor(this, "includePath").Event;
TextBox undefineTextBox = Get<TextBox>("undefine");
helper.AddBinding(null, new ItemDefinitionGroupBinding<TextBox>(undefineTextBox, "ClCompile", "UndefinePreprocessorDefinitions"));
Get<Button>("undefine").Click += ListEditor.SymbolsEditor(this, "undefine").Event;
CheckBox undefineAllCheckBox = Get<CheckBox>("undefineAll");
helper.AddBinding(null, new CheckBoxItemDefinitionGroupBinding(undefineAllCheckBox, "ClCompile", "UndefineAllPreprocessorDefinitions"));
}
}
}

2
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ProjectConfigurationProjectItem.cs

@ -7,7 +7,7 @@
*/ */
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
namespace CppBinding.Project namespace ICSharpCode.CppBinding.Project
{ {
/// <summary> /// <summary>
/// ProjectConfiguration item that occur in the vcxproj files (c++ projects) /// ProjectConfiguration item that occur in the vcxproj files (c++ projects)

2
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/SpecifyCliRuntimeLibraryCommand.cs

@ -2,7 +2,7 @@
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
namespace CppBinding.Project namespace ICSharpCode.CppBinding.Project
{ {
public class SpecifyCliRuntimeLibraryCommand : AbstractCommand public class SpecifyCliRuntimeLibraryCommand : AbstractCommand
{ {

90
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialog.Designer.cs generated

@ -0,0 +1,90 @@
/*
* Utworzone przez SharpDevelop.
* Użytkownik: trecio
* Data: 2009-07-08
* Godzina: 20:34
*
* Do zmiany tego szablonu użyj Narzędzia | Opcje | Kodowanie | Edycja Nagłówków Standardowych.
*/
namespace ICSharpCode.CppBinding.Project
{
partial class StringListEditorDialog
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
stringListEditor = new ICSharpCode.SharpDevelop.Gui.StringListEditor();
this.SuspendLayout();
//
// btnOk
//
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOk.Location = new System.Drawing.Point(124, 231);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 0;
this.btnOk.Text = "OK";
this.btnOk.UseVisualStyleBackColor = true;
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(205, 231);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// stringListEditor
//
this.stringListEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
this.stringListEditor.Location = new System.Drawing.Point(8, 8);
this.stringListEditor.Name = "stringListEditor";
this.stringListEditor.Size = new System.Drawing.Size(284, 215);
//
// StringListDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.stringListEditor);
this.Name = "StringListDialog";
this.ShowInTaskbar = false;
this.ResumeLayout(false);
}
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel;
private ICSharpCode.SharpDevelop.Gui.StringListEditor stringListEditor;
}
}

52
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialog.cs

@ -0,0 +1,52 @@
/*
* Utworzone przez SharpDevelop.
* Użytkownik: trecio
* Data: 2009-07-08
* Godzina: 20:34
*
* Do zmiany tego szablonu użyj Narzędzia | Opcje | Kodowanie | Edycja Nagłówków Standardowych.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace ICSharpCode.CppBinding.Project
{
/// <summary>
/// Description of StringsListDialog.
/// </summary>
public partial class StringListEditorDialog : Form
{
public StringListEditorDialog()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
}
public bool BrowseForDirectory {
get {return stringListEditor.BrowseForDirectory;}
set {stringListEditor.BrowseForDirectory = value;}
}
public string ListCaption {
get {return stringListEditor.ListCaption; }
set {stringListEditor.ListCaption = value;}
}
public string TitleText {
get {return stringListEditor.TitleText;}
set {stringListEditor.TitleText = value;}
}
public string[] GetList() {
return stringListEditor.GetList();
}
public void LoadList(IEnumerable<string> list) {
stringListEditor.LoadList(list);
}
}
}

135
src/AddIns/BackendBindings/CppBinding/CppBinding/Resources/LinkerOptions.xfrm

@ -0,0 +1,135 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="XmlUserControl1" />
<ClientSize value="{Width=509, Height=425}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Location value="8, 8" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Linker}" />
<Size value="486, 403" />
<Anchor value="Top, Bottom, Left, Right" />
<TabIndex value="0" />
<Controls>
<System.Windows.Forms.Label>
<Name value="additionalOptionsLabel" />
<Location value="10, 300" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.AdditionalOptions}" />
<Size value="315, 13" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="additionalOptionsTextBox" />
<TabIndex value="10" />
<Location value="10, 316" />
<Anchor value="Top, Left, Right" />
<Size value="466, 44" />
<Multiline value="True" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.TextBox>
<Name value="resourceFileTextBox" />
<TabIndex value="8" />
<Location value="10, 277" />
<Anchor value="Top, Left, Right" />
<Size value="426, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="resourceFileLabel" />
<Location value="10, 251" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Linker.ManagedResourceFile}" />
<Size value="466, 23" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="resourceFileButton" />
<Location value="440, 278" />
<Text value="..." />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="9" />
</System.Windows.Forms.Button>
<System.Windows.Forms.CheckBox>
<Name value="debugInfoCheckBox" />
<AutoSize value="True" />
<Location value="10, 35" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Linker.GenerateDebugInfo}" />
<TabIndex value="1" />
<Size value="378, 17" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.TextBox>
<Name value="addModuleTextBox" />
<TabIndex value="6" />
<Location value="10, 220" />
<Anchor value="Top, Left, Right" />
<Size value="426, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="addModuleLabel" />
<Location value="10, 194" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Linker.AddModule}" />
<Size value="466, 23" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="addModuleButton" />
<Location value="440, 221" />
<Text value="..." />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="7" />
</System.Windows.Forms.Button>
<System.Windows.Forms.TextBox>
<Name value="additionalLibsTextBox" />
<TabIndex value="4" />
<Location value="10, 159" />
<Anchor value="Top, Left, Right" />
<Size value="426, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="additionalLibsLabel" />
<Location value="10, 133" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Linker.AdditionalLibs}" />
<Size value="466, 23" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="additionalLibsButton" />
<Location value="440, 161" />
<Text value="..." />
<Size value="40, 23" />
<Anchor value="Top, Right" />
<TabIndex value="5" />
</System.Windows.Forms.Button>
<System.Windows.Forms.TextBox>
<Name value="libraryPathTextBox" />
<TabIndex value="2" />
<Location value="10, 81" />
<Anchor value="Top, Left, Right" />
<Size value="426, 44" />
<Multiline value="True" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="libraryPathLabel" />
<Location value="10, 55" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Linker.Library}" />
<Size value="466, 23" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="libraryPathButton" />
<Location value="440, 82" />
<Text value="..." />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="3" />
</System.Windows.Forms.Button>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

100
src/AddIns/BackendBindings/CppBinding/CppBinding/Resources/PreprocessorOptions.xfrm

@ -0,0 +1,100 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="XmlUserControl1" />
<ClientSize value="{Width=509, Height=425}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Location value="8, 8" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Preprocessor}" />
<Size value="486, 338" />
<Anchor value="Top, Bottom, Left, Right" />
<TabIndex value="0" />
<Controls>
<System.Windows.Forms.CheckBox>
<AutoSize value="true" />
<Name value="undefineAllCheckBox" />
<Location value="8, 207" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Preprocessor.UndefineAll}" />
<TabIndex value="10" />
<Size value="426, 23" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.TextBox>
<Name value="undefineTextBox" />
<TabIndex value="8" />
<Location value="8, 181" />
<Anchor value="Top, Left, Right" />
<Size value="426, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="undefineLabel" />
<Location value="8, 155" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Preprocessor.Undefinitions}" />
<Size value="466, 23" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="7" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="undefineButton" />
<Location value="438, 182" />
<Text value="..." />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="9" />
</System.Windows.Forms.Button>
<System.Windows.Forms.TextBox>
<Name value="defineTextBox" />
<TabIndex value="5" />
<Location value="8, 124" />
<Anchor value="Top, Left, Right" />
<Size value="426, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="defineLabel" />
<Location value="8, 98" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Preprocessor.Definitions}" />
<Size value="466, 23" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="4" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="defineButton" />
<Location value="438, 126" />
<Text value="..." />
<Size value="40, 23" />
<Anchor value="Top, Right" />
<TabIndex value="6" />
</System.Windows.Forms.Button>
<System.Windows.Forms.TextBox>
<Name value="includePathTextBox" />
<TabIndex value="2" />
<Location value="8, 49" />
<Anchor value="Top, Left, Right" />
<Size value="426, 44" />
<Multiline value="True" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="includePathLabel" />
<Location value="8, 23" />
<Text value="${res:ICSharpCode.CppBinding.ProjectOptions.Preprocessor.Includes}" />
<Size value="466, 23" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="1" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="includePathButton" />
<Location value="438, 50" />
<Text value="..." />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="3" />
</System.Windows.Forms.Button>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

3
src/Main/Base/Project/Src/Gui/Components/StringListEditor.cs

@ -31,6 +31,7 @@ namespace ICSharpCode.SharpDevelop.Gui
// init enabled states: // init enabled states:
ListBoxSelectedIndexChanged(null, null); ListBoxSelectedIndexChanged(null, null);
EditTextBoxTextChanged(null, null); EditTextBoxTextChanged(null, null);
addButton.Text = StringParser.Parse(addButton.Text);
updateButton.Text = StringParser.Parse(updateButton.Text); updateButton.Text = StringParser.Parse(updateButton.Text);
removeButton.Text = StringParser.Parse(removeButton.Text); removeButton.Text = StringParser.Parse(removeButton.Text);
moveUpButton.Image = WinFormsResourceService.GetBitmap("Icons.16x16.ArrowUp"); moveUpButton.Image = WinFormsResourceService.GetBitmap("Icons.16x16.ArrowUp");
@ -132,7 +133,7 @@ namespace ICSharpCode.SharpDevelop.Gui
addButton.Name = "addButton"; addButton.Name = "addButton";
addButton.Size = new System.Drawing.Size(75, 23); addButton.Size = new System.Drawing.Size(75, 23);
addButton.TabIndex = 3; addButton.TabIndex = 3;
addButton.Text = "Add Item"; addButton.Text = "${res:Global.AddButtonText}";
addButton.Click += new System.EventHandler(this.AddButtonClick); addButton.Click += new System.EventHandler(this.AddButtonClick);
editTextBox = new System.Windows.Forms.TextBox(); editTextBox = new System.Windows.Forms.TextBox();
// //

Loading…
Cancel
Save