diff --git a/data/resources/StringResources.cz.resources b/data/resources/StringResources.cz.resources index b045105e52..8f1b5f505b 100644 Binary files a/data/resources/StringResources.cz.resources and b/data/resources/StringResources.cz.resources differ diff --git a/data/resources/StringResources.de.resources b/data/resources/StringResources.de.resources index ffba791988..3203f98ca1 100644 Binary files a/data/resources/StringResources.de.resources and b/data/resources/StringResources.de.resources differ diff --git a/data/resources/StringResources.es-mx.resources b/data/resources/StringResources.es-mx.resources index 5eaa4470f3..91e876c877 100644 Binary files a/data/resources/StringResources.es-mx.resources and b/data/resources/StringResources.es-mx.resources differ diff --git a/data/resources/StringResources.hu.resources b/data/resources/StringResources.hu.resources index f88fa8b078..c3243ba54d 100644 Binary files a/data/resources/StringResources.hu.resources and b/data/resources/StringResources.hu.resources differ diff --git a/data/resources/StringResources.it.resources b/data/resources/StringResources.it.resources index 0ab31dc523..ba7c1741e0 100644 Binary files a/data/resources/StringResources.it.resources and b/data/resources/StringResources.it.resources differ diff --git a/data/resources/StringResources.nl.resources b/data/resources/StringResources.nl.resources index d1f3d66101..2565ef00a5 100644 Binary files a/data/resources/StringResources.nl.resources and b/data/resources/StringResources.nl.resources differ diff --git a/data/resources/StringResources.ro.resources b/data/resources/StringResources.ro.resources index ae3e3c859d..40af1ce744 100644 Binary files a/data/resources/StringResources.ro.resources and b/data/resources/StringResources.ro.resources differ diff --git a/data/resources/StringResources.se.resources b/data/resources/StringResources.se.resources index c2e6da8d80..e26924b82f 100644 Binary files a/data/resources/StringResources.se.resources and b/data/resources/StringResources.se.resources differ diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin index 48262f2c2a..84afbcfbc0 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin @@ -303,6 +303,9 @@ insertafter = "ToolsOptions" label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.PanelName}"> + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj index 060f86ca9a..e40a91a61a 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj @@ -99,6 +99,8 @@ + + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGeneralOptions.xfrm b/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGeneralOptions.xfrm new file mode 100644 index 0000000000..5740047fc9 --- /dev/null +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGeneralOptions.xfrm @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm b/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm index 86ce5a1b19..2165bb0f60 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm @@ -1,83 +1,84 @@ - - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + - + - - + - + - - - + + - + + + - - - - - + + - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs index 27e1e8786b..ff6f7f34ea 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs @@ -140,7 +140,7 @@ namespace ICSharpCode.FormsDesigner serviceContainer.AddService(typeof(AmbientProperties), ambientProperties); serviceContainer.AddService(typeof(ITypeResolutionService), new TypeResolutionService(viewContent.FileName)); serviceContainer.AddService(typeof(System.ComponentModel.Design.IDesignerEventService), new DesignerEventService()); - serviceContainer.AddService(typeof(System.ComponentModel.Design.DesignerOptionService), new ICSharpCode.FormsDesigner.Services.DesignerOptionService()); + serviceContainer.AddService(typeof(DesignerOptionService), new SharpDevelopDesignerOptionService()); serviceContainer.AddService(typeof(ITypeDiscoveryService), new TypeDiscoveryService()); serviceContainer.AddService(typeof(MemberRelationshipService), new DefaultMemberRelationshipService()); diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs new file mode 100644 index 0000000000..78f68608a9 --- /dev/null +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs @@ -0,0 +1,46 @@ +// +// +// +// +// $Revision$ +// + +using System; +using System.IO; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Project; +using ICSharpCode.SharpDevelop.Gui; + +namespace ICSharpCode.FormsDesigner.Gui.OptionPanels +{ + public class GeneralOptionsPanel : AbstractOptionPanel + { + public override void LoadPanelContents() + { + SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.FormsDesigner.Resources.WindowsFormsGeneralOptions.xfrm")); + + ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", false); + ((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true); + ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true); + ((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true); + ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", true); + } + + public override bool StorePanelContents() + { + PropertyService.Set("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked); + PropertyService.Set("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", ((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked); + PropertyService.Set("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked); + PropertyService.Set("FormsDesigner.DesignerOptions.EnableInSituEditing", ((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked); + PropertyService.Set("FormsDesigner.DesignerOptions.UseSmartTags", ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked); + + return true; + } + } +} + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs index 33257689d7..1ef15202ee 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs @@ -16,7 +16,6 @@ using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Gui; - namespace ICSharpCode.FormsDesigner.Gui.OptionPanels { public class GridOptionsPanel : AbstractOptionPanel @@ -25,11 +24,17 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels { SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.FormsDesigner.Resources.WindowsFormsGridOptions.xfrm")); - ControlDictionary["widthTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8).ToString(); - ControlDictionary["heightTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8).ToString(); - ((CheckBox)ControlDictionary["showGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true); - ((CheckBox)ControlDictionary["snapToGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true); - ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", false); + bool snapToGridOn = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGridMode", false); + + ((RadioButton)ControlDictionary["snapToGridRadioButton"]).Checked = snapToGridOn; + ((RadioButton)ControlDictionary["snapLinesRadioButton"]).Checked = !snapToGridOn; + ControlDictionary["widthTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8).ToString(); + ControlDictionary["heightTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8).ToString(); + ((CheckBox)ControlDictionary["showGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true); + ((CheckBox)ControlDictionary["snapToGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true); + + ((RadioButton)ControlDictionary["snapToGridRadioButton"]).CheckedChanged += SnapToGridChanged; + EnableGridOptions(snapToGridOn); } public override bool StorePanelContents() @@ -38,7 +43,7 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels try { width = Int32.Parse(ControlDictionary["widthTextBox"].Text); } catch { - MessageService.ShowError("Forms Designer grid with is invalid"); + MessageService.ShowError("Forms Designer grid width is invalid"); return false; } @@ -46,17 +51,31 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels try { height = Int32.Parse(ControlDictionary["heightTextBox"].Text); } catch { - MessageService.ShowError("Forms Designer height with is invalid"); + MessageService.ShowError("Forms Designer grid height is invalid"); return false; } + PropertyService.Set("FormsDesigner.DesignerOptions.SnapToGridMode", ((RadioButton)ControlDictionary["snapToGridRadioButton"]).Checked); PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeWidth", width); PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeHeight", height); + PropertyService.Set("FormsDesigner.DesignerOptions.UseSnapLines", ((RadioButton)ControlDictionary["snapLinesRadioButton"]).Checked); PropertyService.Set("FormsDesigner.DesignerOptions.ShowGrid", ((CheckBox)ControlDictionary["showGridCheckBox"]).Checked); PropertyService.Set("FormsDesigner.DesignerOptions.SnapToGrid", ((CheckBox)ControlDictionary["snapToGridCheckBox"]).Checked); - PropertyService.Set("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked); - + return true; } + + void EnableGridOptions(bool snapToGridOn) + { + ControlDictionary["widthTextBox"].Enabled = snapToGridOn; + ControlDictionary["heightTextBox"].Enabled = snapToGridOn; + ((CheckBox)ControlDictionary["showGridCheckBox"]).Enabled = snapToGridOn; + ((CheckBox)ControlDictionary["snapToGridCheckBox"]).Enabled = snapToGridOn; + } + + void SnapToGridChanged(object source, EventArgs e) + { + EnableGridOptions(((RadioButton)ControlDictionary["snapToGridRadioButton"]).Checked); + } } } diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs index 91b1511955..2a38dd8c08 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs @@ -16,61 +16,116 @@ namespace ICSharpCode.FormsDesigner.Services { public class SharpDevelopDesignerOptions : DesignerOptions { + bool enableInSituEditing; + bool objectBoundSmartTagAutoShow; + bool useOptimizedCodeGeneration; + + Size gridSize = Size.Empty; + bool showGrid; + bool snapToGrid; + bool useSnapLines; + bool useSmartTags; + public SharpDevelopDesignerOptions() { - UseSmartTags = true; - UseSnapLines = true; + int w = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8); + int h = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8); + this.gridSize = new Size(w, h); + + this.showGrid = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true); + this.snapToGrid = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true); + + this.useSmartTags = PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", false); + this.useSnapLines = PropertyService.Get("FormsDesigner.DesignerOptions.UseSnapLines", true); + + this.enableInSituEditing = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true); + this.objectBoundSmartTagAutoShow = PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true); + this.useOptimizedCodeGeneration = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true); + } + + // Obtains and shows the size of the standard design-mode grid square. + public override Size GridSize { + get { + return gridSize; + } + } + + // Obtains and shows whether the design mode surface grid is enabled. + public override bool ShowGrid { + get { + return showGrid; + } + } + + // Obtains and shows whether components should be aligned with the surface grid. + public override bool SnapToGrid { + get { + return snapToGrid; + } } -// public override Size GridSize { -// get { -// return new Size(PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8), -// PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8)); -// } -// set { -// LoggingService.Debug("GridSize set"); -// PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeWidth", value.Width); -// PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeHeight", value.Height); -// } -// } -// -// public override bool ShowGrid { -// get { -// LoggingService.Debug("ShowGrid get"); -// return PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true); -// } -// set { -// LoggingService.Debug("ShowGrid set"); -// PropertyService.Set("FormsDesigner.DesignerOptions.ShowGrid", value); -// } -// } -// -// public override bool SnapToGrid { -// get { -// LoggingService.Debug("SnapToGrid get"); -// return PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true); -// } -// set { -// LoggingService.Debug("SnapToGrid set"); -// } -// } + // Gets or sets a value that enables or disables smart tags in the designer. + public override bool UseSmartTags { + get { + return useSmartTags; + } + } + + // Gets or sets a value that enables or disables snaplines in the designer. + public override bool UseSnapLines { + get { + return useSnapLines; + } + } + + // Gets or sets a value that enables or disables in-place editing for ToolStrip controls. + public override bool EnableInSituEditing { + get { + return enableInSituEditing; + } + } + + // Obtains and shows whether smart tags are automatically opened. + public override bool ObjectBoundSmartTagAutoShow { + get { + return objectBoundSmartTagAutoShow; + } + } + + // The component cache is a performance enhancement that is incompatible with certain designers. + // You can disable it with this property + public override bool UseOptimizedCodeGeneration { + get { + return useOptimizedCodeGeneration; + } + } } - - public class DesignerOptionService : WindowsFormsDesignerOptionService + + public class SharpDevelopDesignerOptionService : WindowsFormsDesignerOptionService { - DesignerOptions options; - - public DesignerOptionService() + public SharpDevelopDesignerOptionService() { + ApplySharpDevelopSettings(); } - - public override DesignerOptions CompatibilityOptions { - get { - if (options == null) { - options = new SharpDevelopDesignerOptions(); - } - return options; - } + + void ApplySharpDevelopSettings() + { + SharpDevelopDesignerOptions options = new SharpDevelopDesignerOptions(); + + this.Options.Properties.Find("GridSize", true).SetValue(this, options.GridSize); + this.Options.Properties.Find("EnableInSituEditing", true).SetValue(this, options.EnableInSituEditing); + this.Options.Properties.Find("ObjectBoundSmartTagAutoShow", true).SetValue(this, options.ObjectBoundSmartTagAutoShow); + this.Options.Properties.Find("UseOptimizedCodeGeneration", true).SetValue(this, options.UseOptimizedCodeGeneration); + this.Options.Properties.Find("UseSmartTags", true).SetValue(this, options.UseSmartTags); + this.Options.Properties.Find("UseSnapLines", true).SetValue(this, options.UseSnapLines); + + if (options.UseSnapLines) { + this.Options.Properties.Find("ShowGrid", true).SetValue(this, false); + this.Options.Properties.Find("SnapToGrid", true).SetValue(this, false); + } else { + this.Options.Properties.Find("ShowGrid", true).SetValue(this, options.ShowGrid); + this.Options.Properties.Find("SnapToGrid", true).SetValue(this, options.SnapToGrid); + } } } } diff --git a/src/Main/StartUp/Project/Resources/StringResources.resources b/src/Main/StartUp/Project/Resources/StringResources.resources index e620d5f82a..811fb65960 100644 Binary files a/src/Main/StartUp/Project/Resources/StringResources.resources and b/src/Main/StartUp/Project/Resources/StringResources.resources differ