6 changed files with 16 additions and 179 deletions
@ -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> |
||||
@ -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); |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue