6 changed files with 96 additions and 171 deletions
@ -1,58 +0,0 @@ |
|||||||
<Components version="1.0"> |
|
||||||
<System.Windows.Forms.UserControl> |
|
||||||
<Name value="MyUserControl" /> |
|
||||||
<DockPadding value="" /> |
|
||||||
<ClientSize value="{Width=344, Height=296}" /> |
|
||||||
<Controls> |
|
||||||
<System.Windows.Forms.Panel> |
|
||||||
<Name value="panel1" /> |
|
||||||
<Location value="{X=8,Y=72}" /> |
|
||||||
<Size value="{Width=328, Height=216}" /> |
|
||||||
<DockPadding value="" /> |
|
||||||
<Anchor value="Top, Bottom, Left, Right" /> |
|
||||||
<TabIndex value="4" /> |
|
||||||
<Controls> |
|
||||||
<System.Windows.Forms.TextBox> |
|
||||||
<Name value="headerTextBox" /> |
|
||||||
<TabIndex value="3" /> |
|
||||||
<Dock value="Fill" /> |
|
||||||
<Location value="{X=0,Y=0}" /> |
|
||||||
<AcceptsReturn value="True" /> |
|
||||||
<Size value="{Width=328, Height=216}" /> |
|
||||||
<Multiline value="True" /> |
|
||||||
<AcceptsTab value="True" /> |
|
||||||
<AutoSize value="False" /> |
|
||||||
<Text value="" /> |
|
||||||
<RightToLeft value="No" /> |
|
||||||
</System.Windows.Forms.TextBox> |
|
||||||
</Controls> |
|
||||||
</System.Windows.Forms.Panel> |
|
||||||
<System.Windows.Forms.Label> |
|
||||||
<Name value="label2" /> |
|
||||||
<Text value="${res:Dialog.Options.IDEOptions.EditStandardHeaderPanel.LanguageLabel}" /> |
|
||||||
<TextAlign value="MiddleRight" /> |
|
||||||
<TabIndex value="0" /> |
|
||||||
<Size value="{Width=136, Height=23}" /> |
|
||||||
<Location value="{X=4,Y=8}" /> |
|
||||||
</System.Windows.Forms.Label> |
|
||||||
<System.Windows.Forms.Label> |
|
||||||
<Name value="label" /> |
|
||||||
<Text value="${res:Dialog.Options.IDEOptions.EditStandardHeaderPanel.HeaderLabel}" /> |
|
||||||
<TextAlign value="BottomLeft" /> |
|
||||||
<Anchor value="Top, Left, Right" /> |
|
||||||
<TabIndex value="2" /> |
|
||||||
<Size value="{Width=328, Height=16}" /> |
|
||||||
<Location value="{X=8,Y=48}" /> |
|
||||||
</System.Windows.Forms.Label> |
|
||||||
<System.Windows.Forms.ComboBox> |
|
||||||
<Name value="headerChooser" /> |
|
||||||
<Anchor value="Top, Left, Right" /> |
|
||||||
<TabIndex value="1" /> |
|
||||||
<Location value="{X=144,Y=8}" /> |
|
||||||
<Size value="{Width=192, Height=21}" /> |
|
||||||
<DropDownStyle value="DropDownList" /> |
|
||||||
<RightToLeft value="No" /> |
|
||||||
</System.Windows.Forms.ComboBox> |
|
||||||
</Controls> |
|
||||||
</System.Windows.Forms.UserControl> |
|
||||||
</Components> |
|
@ -1,50 +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.Windows.Forms; |
|
||||||
using ICSharpCode.Core.WinForms; |
|
||||||
using ICSharpCode.SharpDevelop.Internal.Templates; |
|
||||||
|
|
||||||
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
||||||
{ |
|
||||||
public class EditStandardHeaderPanel : XmlFormsOptionPanel |
|
||||||
{ |
|
||||||
public override void LoadPanelContents() |
|
||||||
{ |
|
||||||
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.EditStandardHeaderPanel.xfrm")); |
|
||||||
|
|
||||||
ControlDictionary["headerTextBox"].Font = WinFormsResourceService.DefaultMonospacedFont; |
|
||||||
foreach (StandardHeader header in StandardHeader.StandardHeaders) { |
|
||||||
((ComboBox)ControlDictionary["headerChooser"]).Items.Add(header); |
|
||||||
} |
|
||||||
((ComboBox)ControlDictionary["headerChooser"]).SelectedIndexChanged += new EventHandler(SelectedIndexChanged); |
|
||||||
((ComboBox)ControlDictionary["headerChooser"]).SelectedIndex = 0; |
|
||||||
((TextBox)ControlDictionary["headerTextBox"]).TextChanged += new EventHandler(TextChangedEvent); |
|
||||||
} |
|
||||||
|
|
||||||
void TextChangedEvent(object sender , EventArgs e) |
|
||||||
{ |
|
||||||
((StandardHeader)((ComboBox)ControlDictionary["headerChooser"]).SelectedItem).Header = ControlDictionary["headerTextBox"].Text; |
|
||||||
} |
|
||||||
void SelectedIndexChanged(object sender , EventArgs e) |
|
||||||
{ |
|
||||||
((TextBox)ControlDictionary["headerTextBox"]).TextChanged -= new EventHandler(TextChangedEvent); |
|
||||||
int idx =((ComboBox)ControlDictionary["headerChooser"]).SelectedIndex; |
|
||||||
if (idx >= 0) { |
|
||||||
ControlDictionary["headerTextBox"].Text = ((StandardHeader)((ComboBox)ControlDictionary["headerChooser"]).SelectedItem).Header; |
|
||||||
ControlDictionary["headerTextBox"].Enabled = true; |
|
||||||
} else { |
|
||||||
ControlDictionary["headerTextBox"].Text = ""; |
|
||||||
ControlDictionary["headerTextBox"].Enabled = false; |
|
||||||
} |
|
||||||
((TextBox)ControlDictionary["headerTextBox"]).TextChanged += new EventHandler(TextChangedEvent); |
|
||||||
} |
|
||||||
|
|
||||||
public override bool StorePanelContents() |
|
||||||
{ |
|
||||||
StandardHeader.StoreHeaders(); |
|
||||||
return true; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,24 @@ |
|||||||
|
<gui:OptionPanel x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.EditStandardHeaderPanel" |
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||||
|
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui" |
||||||
|
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets" |
||||||
|
xmlns:core="http://icsharpcode.net/sharpdevelop/core"> |
||||||
|
<StackPanel> |
||||||
|
|
||||||
|
<widgets:StackPanelWithSpacing SpaceBetweenItems="5" Margin="50,8,0,0" Orientation="Horizontal"> |
||||||
|
|
||||||
|
<Label Content="{core:Localize Dialog.Options.IDEOptions.EditStandardHeaderPanel.LanguageLabel}"></Label> |
||||||
|
<ComboBox x:Name="headerChooser" Width="150" |
||||||
|
SelectionChanged="HeaderChooser_SelectionChanged"></ComboBox> |
||||||
|
</widgets:StackPanelWithSpacing > |
||||||
|
|
||||||
|
<Label Margin="0,8,0,0" |
||||||
|
Content="{core:Localize Dialog.Options.IDEOptions.EditStandardHeaderPanel.HeaderLabel}"></Label> |
||||||
|
|
||||||
|
<TextBox x:Name="headerTextBox" |
||||||
|
TextChanged="HeaderTextBox_TextChanged" |
||||||
|
Margin="0,2,0,0" Height="200"></TextBox> |
||||||
|
|
||||||
|
</StackPanel> |
||||||
|
</gui:OptionPanel> |
@ -0,0 +1,67 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 30.03.2012 |
||||||
|
* Time: 20:41 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Text; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows.Data; |
||||||
|
using System.Windows.Documents; |
||||||
|
using System.Windows.Input; |
||||||
|
using System.Windows.Media; |
||||||
|
|
||||||
|
using ICSharpCode.Core.WinForms; |
||||||
|
using ICSharpCode.SharpDevelop.Internal.Templates; |
||||||
|
|
||||||
|
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for EditStandardHeaderPanelXaml.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class EditStandardHeaderPanel : OptionPanel |
||||||
|
{ |
||||||
|
public EditStandardHeaderPanel() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override void LoadOptions() |
||||||
|
{ |
||||||
|
headerTextBox.FontFamily = new FontFamily("Consolas, Courier New"); |
||||||
|
|
||||||
|
foreach (StandardHeader header in StandardHeader.StandardHeaders) { |
||||||
|
headerChooser.Items.Add(header); |
||||||
|
} |
||||||
|
headerChooser.SelectionChanged += HeaderChooser_SelectionChanged; |
||||||
|
headerChooser.SelectedIndex = 0; |
||||||
|
headerTextBox.TextChanged += HeaderTextBox_TextChanged; |
||||||
|
} |
||||||
|
|
||||||
|
void HeaderChooser_SelectionChanged(object sender, SelectionChangedEventArgs e) |
||||||
|
{ |
||||||
|
headerTextBox.TextChanged -= HeaderTextBox_TextChanged; |
||||||
|
int idx =headerChooser.SelectedIndex; |
||||||
|
if (idx >= 0) { |
||||||
|
headerTextBox.Text = ((StandardHeader)((ComboBox)headerChooser).SelectedItem).Header; |
||||||
|
headerTextBox.IsEnabled = true; |
||||||
|
} else { |
||||||
|
headerTextBox.Text = ""; |
||||||
|
headerTextBox.IsEnabled = false; |
||||||
|
} |
||||||
|
headerTextBox.TextChanged += HeaderTextBox_TextChanged; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
void HeaderTextBox_TextChanged(object sender, TextChangedEventArgs e) |
||||||
|
{ |
||||||
|
((StandardHeader)((ComboBox)headerChooser).SelectedItem).Header = headerTextBox.Text; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,56 +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 ICSharpCode.Core; |
|
||||||
using ICSharpCode.SharpDevelop.Project; |
|
||||||
|
|
||||||
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
||||||
{ |
|
||||||
public class old_ReferencePaths : AbstractXmlFormsProjectOptionPanel |
|
||||||
{ |
|
||||||
public override void LoadPanelContents() |
|
||||||
{ |
|
||||||
InitializeHelper(); |
|
||||||
|
|
||||||
StringListEditor editor = new StringListEditor(); |
|
||||||
editor.BrowseForDirectory = true; |
|
||||||
editor.ListCaption = StringParser.Parse("&${res:Dialog.ProjectOptions.ReferencePaths}:"); |
|
||||||
editor.TitleText = StringParser.Parse("&${res:Global.Folder}:"); |
|
||||||
editor.AddButtonText = StringParser.Parse("${res:Dialog.ProjectOptions.ReferencePaths.AddPath}"); |
|
||||||
editor.ListChanged += delegate { IsDirty = true; }; |
|
||||||
SemicolonSeparatedStringListBinding b = new SemicolonSeparatedStringListBinding(editor); |
|
||||||
helper.AddBinding("ReferencePath", b); |
|
||||||
this.Controls.Add(editor); |
|
||||||
b.CreateLocationButton(editor); |
|
||||||
|
|
||||||
helper.AddConfigurationSelector(this); |
|
||||||
} |
|
||||||
|
|
||||||
sealed class SemicolonSeparatedStringListBinding : ConfigurationGuiBinding |
|
||||||
{ |
|
||||||
StringListEditor editor; |
|
||||||
|
|
||||||
public SemicolonSeparatedStringListBinding(StringListEditor editor) |
|
||||||
{ |
|
||||||
this.editor = editor; |
|
||||||
} |
|
||||||
|
|
||||||
public override void Load() |
|
||||||
{ |
|
||||||
string[] values = Get("").Split(';'); |
|
||||||
if (values.Length == 1 && values[0].Length == 0) { |
|
||||||
editor.LoadList(new string[0]); |
|
||||||
} else { |
|
||||||
editor.LoadList(values); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public override bool Save() |
|
||||||
{ |
|
||||||
Set(string.Join(";", editor.GetList())); |
|
||||||
return true; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue