Browse Source

OutputWindowOptionsPanelXaml

newNRvisualizers
Peter Forstmeier 13 years ago
parent
commit
871b1cc150
  1. 5
      src/Main/Base/Project/ICSharpCode.SharpDevelop.addin
  2. 5
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  3. 18
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/OutputWindowOptionsPanelXaml.xaml
  4. 76
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/OutputWindowOptionsPanelXaml.xaml.cs

5
src/Main/Base/Project/ICSharpCode.SharpDevelop.addin

@ -1258,6 +1258,11 @@
<OptionPanel id = "OutputWindowOptions" <OptionPanel id = "OutputWindowOptions"
label = "${res:Dialog.Options.IDEOptions.OutputPanel.Title}" label = "${res:Dialog.Options.IDEOptions.OutputPanel.Title}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.OutputWindowOptionsPanel"/> class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.OutputWindowOptionsPanel"/>
<OptionPanel id = "OutputWindowOptions1"
label = "${res:Dialog.Options.IDEOptions.OutputPanel.Title}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.OutputWindowOptionsPanelXaml"/>
<OptionPanel id = "ProjectAndSolutionOptions" <OptionPanel id = "ProjectAndSolutionOptions"
label = "${res:Dialog.Options.IDEOptions.ProjectAndSolutionOptions.PanelName}" label = "${res:Dialog.Options.IDEOptions.ProjectAndSolutionOptions.PanelName}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ProjectAndSolutionOptions"/> class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ProjectAndSolutionOptions"/>

5
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -225,6 +225,10 @@
<DependentUpon>AbstractAttachToProcessForm.cs</DependentUpon> <DependentUpon>AbstractAttachToProcessForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\ExtractInterfaceDialog.cs" /> <Compile Include="Src\Gui\Dialogs\ExtractInterfaceDialog.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\OutputWindowOptionsPanelXaml.xaml.cs">
<DependentUpon>OutputWindowOptionsPanelXaml.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Services\FileChangeWatcher.cs" /> <Compile Include="Src\Services\FileChangeWatcher.cs" />
<Compile Include="Util\AtomicBoolean.cs" /> <Compile Include="Util\AtomicBoolean.cs" />
<Compile Include="Util\CustomThreadPoolTaskScheduler.cs" /> <Compile Include="Util\CustomThreadPoolTaskScheduler.cs" />
@ -843,6 +847,7 @@
<Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\EditStandardHeaderPanel.xaml" /> <Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\EditStandardHeaderPanel.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\SelectStylePanel.xaml" /> <Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\SelectStylePanel.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\TaskListOptionsl.xaml" /> <Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\TaskListOptionsl.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\OutputWindowOptionsPanelXaml.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ApplicationSettings.xaml" /> <Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ApplicationSettings.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildAdvanced.xaml" /> <Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildAdvanced.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildEvents.xaml" /> <Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildEvents.xaml" />

18
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/OutputWindowOptionsPanelXaml.xaml

@ -0,0 +1,18 @@
<gui:OptionPanel x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.OutputWindowOptionsPanelXaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui">
<StackPanel Orientation="Vertical">
<GroupBox Margin="5,5,5,0" Header="{core:Localize Dialog.Options.IDEOptions.OutputPanel.Format}">
<CheckBox Margin="0,10,0,0"
IsChecked="{Binding WordWrap}"
Content="{core:Localize Dialog.Options.IDEOptions.OutputPanel.WordWrap}"></CheckBox>
</GroupBox>
<GroupBox Margin="5,5,5,0" Header="{core:Localize Dialog.Options.IDEOptions.TextEditor.General.FontGroupBox}">
<gui:FontSelector x:Name="fontSelectionPanel"></gui:FontSelector>
</GroupBox>
</StackPanel>
</gui:OptionPanel>

76
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/OutputWindowOptionsPanelXaml.xaml.cs

@ -0,0 +1,76 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 27.12.2012
* Time: 19:36
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
/// <summary>
/// Interaction logic for OutputWindowOptionsPanelXaml.xaml
/// </summary>
public partial class OutputWindowOptionsPanelXaml : OptionPanel
{
private static readonly string OutputWindowsProperty = "SharpDevelop.UI.OutputWindowOptions";
public OutputWindowOptionsPanelXaml()
{
InitializeComponent();
this.DataContext = this;
}
public override void LoadOptions()
{
base.LoadOptions();
var properties = PropertyService.NestedProperties(OutputWindowsProperty);
WordWrap = properties.Get("WordWrap", true);
var fontStr = properties.Get("DefaultFont", SD.WinForms.DefaultMonospacedFont.ToString()).ToString();
var font = ParseFont(fontStr);
fontSelectionPanel.SelectedFontFamily = new System.Windows.Media.FontFamily(font.Name);
fontSelectionPanel.SelectedFontSize = (int)font.Size;
font.Dispose();
}
private static Font ParseFont(string font)
{
try {
string[] descr = font.Split(new char[]{',', '='});
return new Font(descr[1], Single.Parse(descr[3]));
} catch (Exception ex) {
LoggingService.Warn(ex);
return SD.WinForms.DefaultMonospacedFont;
}
}
public override bool SaveOptions()
{
var properties = PropertyService.NestedProperties(OutputWindowsProperty);
properties.Set("WordWrap", WordWrap);
var font = new Font(new System.Drawing.FontFamily(fontSelectionPanel.SelectedFontName),
(float)fontSelectionPanel.SelectedFontSize);
Console.WriteLine(font.ToString());
font.Dispose();
return base.SaveOptions();
}
bool wordWrap;
public bool WordWrap {
get { return wordWrap; }
set { wordWrap = value;
base.RaisePropertyChanged(() => WordWrap);}
}
}
}
Loading…
Cancel
Save