Browse Source

Remove WindowsFormsGridOptions.xfrm

pull/18/head
PeterForstmeier 14 years ago
parent
commit
4562c5118d
  1. 7
      src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin
  2. 10
      src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj
  3. 84
      src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm
  4. 72
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs
  5. 18
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptionsPanel.xaml
  6. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptionsPanel.xaml.cs

7
src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin

@ -307,13 +307,10 @@ @@ -307,13 +307,10 @@
<OptionPanel id = "GeneralOptions"
label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GeneralOptionsPanel.PanelName}"
class = "ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel"/>
<!--
<OptionPanel id = "GridOptions"
label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PanelName}"
class = "ICSharpCode.FormsDesigner.Gui.OptionPanels.GridOptionsPanel"/>-->
<OptionPanel id = "GridOptions"
label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PanelName}"
class = "ICSharpCode.FormsDesigner.Gui.OptionPanels.GridOptionsPanelXAML"/>
class = "ICSharpCode.FormsDesigner.Gui.OptionPanels.GridOptionsPanel"/>
<OptionPanel id = "LocalizationModelOptions"
label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.LocalizationModelOptionsPanel.PanelName}"

10
src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj

@ -71,7 +71,6 @@ @@ -71,7 +71,6 @@
<EmbeddedResource Include="Resources\AddSidebarComponentsDialog.xfrm" />
<EmbeddedResource Include="Resources\ConfigureSidebarDialog.xfrm" />
<EmbeddedResource Include="Resources\RenameSidebarCategoryDialog.xfrm" />
<EmbeddedResource Include="Resources\WindowsFormsGridOptions.xfrm" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\Commands\FormsCommands.cs" />
<Compile Include="Src\Commands\SideBarCommands.cs" />
@ -85,8 +84,8 @@ @@ -85,8 +84,8 @@
<Compile Include="Src\Gui\ImageResourceEditorDialog.Designer.cs">
<DependentUpon>ImageResourceEditorDialog.cs</DependentUpon>
</Compile>
<Compile Include="Src\Gui\OptionPanels\GridOptionsPanelXAML.xaml.cs">
<DependentUpon>GridOptionsPanelXAML.xaml</DependentUpon>
<Compile Include="Src\Gui\OptionPanels\GridOptionsPanel.xaml.cs">
<DependentUpon>GridOptionsPanel.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\OptionPanels\LocalizationModelOptionsPanel.xaml.cs">
@ -104,9 +103,6 @@ @@ -104,9 +103,6 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\CustomComponentsSideTab.cs" />
<Compile Include="Src\Gui\OptionPanels\GridOptions.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\RenameCategoryDialog.cs">
<SubType>Form</SubType>
</Compile>
@ -194,7 +190,7 @@ @@ -194,7 +190,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Src\Gui\OptionPanels\GridOptionsPanelXAML.xaml" />
<Page Include="Src\Gui\OptionPanels\GridOptionsPanel.xaml" />
<Page Include="Src\Gui\OptionPanels\LocalizationModelOptionsPanel.xaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />

84
src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm

@ -1,84 +0,0 @@ @@ -1,84 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="CreatedUserControl" />
<ClientSize value="{Width=375, Height=357}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="groupBox2" />
<Location value="{X=8,Y=111}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.GridPropertiesGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=367, Height=144}" />
<TabIndex value="1" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="snapToGridCheckBox" />
<Location value="{X=8,Y=111}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapToGridComboBox}" />
<TabIndex value="5" />
<Size value="{Width=343, Height=24}" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="showGridCheckBox" />
<Location value="{X=8,Y=84}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.ShowGridComboBox}" />
<TabIndex value="4" />
<Size value="{Width=343, Height=24}" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.TextBox>
<Name value="heightTextBox" />
<TabIndex value="3" />
<Size value="{Width=53, Height=21}" />
<Location value="{X=133,Y=51}" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="gridHeightLabel" />
<Location value="{X=8,Y=51}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.HeightLabel}" />
<TextAlign value="MiddleRight" />
<Size value="{Width=121, Height=23}" />
<TabIndex value="2" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="widthTextBox" />
<TabIndex value="1" />
<Size value="{Width=53, Height=21}" />
<Location value="{X=133,Y=20}" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="gridWidthLabel" />
<Location value="{X=6,Y=20}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.WidthLabel}" />
<TextAlign value="MiddleRight" />
<Size value="{Width=121, Height=23}" />
<TabIndex value="0" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Location value="{X=8,Y=8}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapModeGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=367, Height=87}" />
<TabIndex value="0" />
<Controls>
<System.Windows.Forms.RadioButton>
<Name value="snapToGridRadioButton" />
<Location value="{X=8,Y=20}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapToGridRadioButton}" />
<Size value="{Width=353, Height=24}" />
<TabIndex value="0" />
</System.Windows.Forms.RadioButton>
<System.Windows.Forms.RadioButton>
<Name value="snapLinesRadioButton" />
<Location value="{X=8,Y=50}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapLinesRadioButton}" />
<Size value="{Width=353, Height=24}" />
<TabIndex value="1" />
</System.Windows.Forms.RadioButton>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

72
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs

@ -1,72 +0,0 @@ @@ -1,72 +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 ICSharpCode.SharpDevelop.Gui.OptionPanels;
using System;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
{
public class GridOptionsPanel : XmlFormsOptionPanel
{
public override void LoadPanelContents()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.FormsDesigner.Resources.WindowsFormsGridOptions.xfrm"));
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()
{
int width = 0;
try {
width = Int32.Parse(ControlDictionary["widthTextBox"].Text);
} catch {
MessageService.ShowError("Forms Designer grid width is invalid");
return false;
}
int height = 0;
try {
height = Int32.Parse(ControlDictionary["heightTextBox"].Text);
} catch {
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);
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);
}
}
}

18
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptionsPanelXAML.xaml → src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptionsPanel.xaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<gui:OptionPanel x:Class="ICSharpCode.FormsDesigner.Gui.OptionPanels.GridOptionsPanelXAML"
<gui:OptionPanel x:Class="ICSharpCode.FormsDesigner.Gui.OptionPanels.GridOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sd="http://icsharpcode.net/sharpdevelop/core"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
@ -8,15 +8,15 @@ @@ -8,15 +8,15 @@
<StackPanel>
<GroupBox Margin="0,10,0,0"
Header="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapModeGroupBox}">
Header="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapModeGroupBox}">
<widgets:StackPanelWithSpacing SpaceBetweenItems="15">
<RadioButton x:Name="snapToGridRadioButton"
Checked="SnapToGridRadioButton_Checked"
Content="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapToGridRadioButton}"></RadioButton>
Content="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapToGridRadioButton}"></RadioButton>
<RadioButton x:Name="snapLinesRadioButton"
Checked="SnapLinesRadioButton_Checked"
Content="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapLinesRadioButton}"></RadioButton>
Content="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapLinesRadioButton}"></RadioButton>
</widgets:StackPanelWithSpacing>
</GroupBox>
@ -33,12 +33,12 @@ @@ -33,12 +33,12 @@
</Grid.ColumnDefinitions>
<TextBlock Text="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.WidthLabel}"></TextBlock>
<TextBox x:Name="widthTextBox" Margin="0,0,0,30" IsEnabled="False" Grid.Column="1" ></TextBox>
<TextBox x:Name="widthTextBox" Margin="0,0,60,0" Width="40" IsEnabled="False" Grid.Column="1" ></TextBox>
<TextBlock Grid.Row="1"
<TextBlock Grid.Row="1" Margin="0,5,0,0"
Text="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.HeightLabel}"></TextBlock>
<TextBox x:Name="heightTextBox" Margin="0,0,0,30"
<TextBox x:Name="heightTextBox" Margin="0,5,60,0" Width="40"
IsEnabled="False" Grid.Row="1" Grid.Column="1" ></TextBox>
</Grid>
@ -48,5 +48,5 @@ @@ -48,5 +48,5 @@
Content="{sd:Localize ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapToGridRadioButton}"></CheckBox>
</widgets:StackPanelWithSpacing>
</GroupBox>
</StackPanel>
</StackPanel>
</gui:OptionPanel>

4
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptionsPanelXAML.xaml.cs → src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptionsPanel.xaml.cs

@ -25,9 +25,9 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels @@ -25,9 +25,9 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
/// <summary>
/// Interaction logic for GridOptrionsXAML.xaml
/// </summary>
public partial class GridOptionsPanelXAML : OptionPanel
public partial class GridOptionsPanel : OptionPanel
{
public GridOptionsPanelXAML()
public GridOptionsPanel()
{
InitializeComponent();
bool snapToGridOn = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGridMode", false);
Loading…
Cancel
Save