Browse Source

Remove obsolete Files

newNRvisualizers
Peter Forstmeier 13 years ago
parent
commit
cf080f1140
  1. 8
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  2. 53
      src/Main/Base/Project/Resources/old_FontSelectionPanel.xfrm
  3. 37
      src/Main/Base/Project/Resources/old_OutputWindowOptionsPanel.xfrm
  4. 251
      src/Main/Base/Project/Src/Gui/Components/old_FontSelectionPanel.cs
  5. 46
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/old_OutputWindowOptionsPanel.cs

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

@ -643,14 +643,8 @@ @@ -643,14 +643,8 @@
<Compile Include="Src\Internal\ConditionEvaluators\ActiveWindowStateEvaluator.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\OpenWindowStateEvaluator.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\DebuggerSupportsEvaluator.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\old_OutputWindowOptionsPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Pads\CompilerMessageView\FileLineReference.cs" />
<Compile Include="Src\Gui\Pads\CompilerMessageView\OutputTextLineParser.cs" />
<Compile Include="Src\Gui\Components\old_FontSelectionPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Project\Items\FileProjectItem.cs" />
<Compile Include="Src\Project\IProject.cs" />
<Compile Include="Src\Project\Items\ProjectItem.cs" />
@ -733,10 +727,8 @@ @@ -733,10 +727,8 @@
<Compile Include="Src\Project\WebReferenceUrl.cs" />
<EmbeddedResource Include="Resources\CommonAboutDialog.xfrm" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<EmbeddedResource Include="Resources\old_FontSelectionPanel.xfrm" />
<EmbeddedResource Include="Resources\NewFileWithNameDialog.xfrm" />
<EmbeddedResource Include="Resources\NewFileDialog.xfrm" />
<EmbeddedResource Include="Resources\old_OutputWindowOptionsPanel.xfrm" />
<EmbeddedResource Include="Resources\WordCountDialog.xfrm" />
<Compile Include="Src\Services\Tasks\TaskEventHandler.cs" />
<Compile Include="Src\Gui\Pads\DefinitionViewPad.cs" />

53
src/Main/Base/Project/Resources/old_FontSelectionPanel.xfrm

@ -1,53 +0,0 @@ @@ -1,53 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="XmlUserControl1" />
<DockPadding value="" />
<ClientSize value="{Width=352, Height=112}" />
<Controls>
<System.Windows.Forms.Label>
<Name value="fontPreviewLabel" />
<Text value="AaBbCcXxYyZz" />
<TextAlign value="MiddleCenter" />
<Anchor value="Top, Left, Right" />
<TabIndex value="19" />
<Size value="{Width=336, Height=40}" />
<Location value="{X=8,Y=64}" />
<BackColor value="Color [ControlLightLight]" />
<BorderStyle value="FixedSingle" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Label>
<Name value="fontSizeLabel" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.FontSizeLabel}" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="17" />
<Size value="{Width=112, Height=20}" />
<Location value="{X=232,Y=8}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.ComboBox>
<Name value="fontSizeComboBox" />
<Anchor value="Top, Left, Right" />
<TabIndex value="18" />
<Location value="{X=232,Y=32}" />
<Size value="{Width=112, Height=21}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.ComboBox>
<Name value="fontListComboBox" />
<DrawMode value="OwnerDrawFixed" />
<TabIndex value="16" />
<Location value="{X=8,Y=32}" />
<Size value="{Width=216, Height=22}" />
<DropDownStyle value="DropDownList" />
<RightToLeft value="No" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="CreatedObject9" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.TextfontLabel}" />
<TextAlign value="BottomLeft" />
<TabIndex value="15" />
<Size value="{Width=208, Height=20}" />
<Location value="{X=8,Y=8}" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

37
src/Main/Base/Project/Resources/old_OutputWindowOptionsPanel.xfrm

@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="OutputWindowOptionsPanel" />
<DockPadding value="" />
<ClientSize value="{Width=400, Height=248}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="FontGroupBox" />
<TabIndex value="2" />
<Location value="{X=8,Y=72}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=384, Height=144}" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.FontGroupBox}" />
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="formatGroupBox" />
<TabIndex value="1" />
<Location value="{X=8,Y=8}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=384, Height=56}" />
<Text value="${res:Dialog.Options.IDEOptions.OutputPanel.Format}" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="wordWrapCheckBox" />
<Location value="{X=8,Y=34}" />
<Checked value="True" />
<Size value="{Width=368, Height=16}" />
<Text value="${res:Dialog.Options.IDEOptions.OutputPanel.WordWrap}" />
<CheckState value="Checked" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
</System.Windows.Forms.CheckBox>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

251
src/Main/Base/Project/Src/Gui/Components/old_FontSelectionPanel.cs

@ -1,251 +0,0 @@ @@ -1,251 +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.Collections.Generic;
using System.Drawing;
using System.Drawing.Text;
using System.Threading;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
namespace ICSharpCode.SharpDevelop.Gui
{
/// <summary>
/// Description of FontSelectionPanel.
/// </summary>
[Obsolete("XMLForms-based FontSelectionPanel is obsolete, use FontSelector instead!")]
public class old_FontSelectionPanel : BaseSharpDevelopUserControl
{
public string CurrentFontString {
get {
Font font = CurrentFont;
if (font != null)
return font.ToString();
else
return null;
}
set {
CurrentFont = old_FontSelectionPanel.ParseFont(value);
}
}
public Font CurrentFont {
get {
if (helper == null)
return null;
return helper.GetSelectedFont();
}
set {
if (helper == null) {
helper = new FontSelectionPanelHelper((ComboBox)ControlDictionary["fontSizeComboBox"], (ComboBox)ControlDictionary["fontListComboBox"], value);
helper.StartThread();
((ComboBox)ControlDictionary["fontListComboBox"]).MeasureItem += helper.MeasureComboBoxItem;
((ComboBox)ControlDictionary["fontListComboBox"]).DrawItem += helper.ComboBoxDrawItem;
} else {
int index = 0;
for (int i = 0; i < ((ComboBox)ControlDictionary["fontListComboBox"]).Items.Count; ++i) {
FontSelectionPanelHelper.FontDescriptor descriptor = (FontSelectionPanelHelper.FontDescriptor)((ComboBox)ControlDictionary["fontListComboBox"]).Items[i];
if (descriptor.Name == value.Name) {
index = i;
}
}
((ComboBox)ControlDictionary["fontListComboBox"]).SelectedIndex = index;
}
((ComboBox)ControlDictionary["fontSizeComboBox"]).Text = value.Size.ToString();
}
}
public old_FontSelectionPanel()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.SharpDevelop.Resources.old_FontSelectionPanel.xfrm"));
for (int i = 6; i <= 24; ++i) {
((ComboBox)ControlDictionary["fontSizeComboBox"]).Items.Add(i);
}
((ComboBox)ControlDictionary["fontSizeComboBox"]).TextChanged += new EventHandler(UpdateFontPreviewLabel);
((ComboBox)ControlDictionary["fontSizeComboBox"]).Enabled = false;
((ComboBox)ControlDictionary["fontListComboBox"]).Enabled = false;
((ComboBox)ControlDictionary["fontListComboBox"]).TextChanged += new EventHandler(UpdateFontPreviewLabel);
((ComboBox)ControlDictionary["fontListComboBox"]).SelectedIndexChanged += new EventHandler(UpdateFontPreviewLabel);
}
FontSelectionPanelHelper helper;
public 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;
}
}
void UpdateFontPreviewLabel(object sender, EventArgs e)
{
helper.UpdateFontPreviewLabel(ControlDictionary["fontPreviewLabel"]);
}
}
class FontSelectionPanelHelper
{
ComboBox fontSizeComboBox, fontListComboBox;
Font defaultFont;
public FontSelectionPanelHelper(ComboBox fontSizeComboBox, ComboBox fontListComboBox, Font defaultFont)
{
this.fontSizeComboBox = fontSizeComboBox;
this.fontListComboBox = fontListComboBox;
this.defaultFont = defaultFont;
boldComboBoxFont = new Font(fontListComboBox.Font, FontStyle.Bold);
}
public void StartThread()
{
Thread thread = new Thread(DetectMonospacedThread);
thread.IsBackground = true;
thread.Start();
}
void DetectMonospacedThread()
{
Thread.Sleep(0); // first allow UI thread to do some work
DebugTimer.Start();
InstalledFontCollection installedFontCollection = new InstalledFontCollection();
Font currentFont = defaultFont;
List<FontDescriptor> fonts = new List<FontDescriptor>();
int index = 0;
foreach (FontFamily fontFamily in installedFontCollection.Families) {
if (fontFamily.IsStyleAvailable(FontStyle.Regular) && fontFamily.IsStyleAvailable(FontStyle.Bold) && fontFamily.IsStyleAvailable(FontStyle.Italic)) {
if (fontFamily.Name == currentFont.Name) {
index = fonts.Count;
}
fonts.Add(new FontDescriptor(fontFamily));
}
}
DebugTimer.Stop("Getting installed fonts");
SD.MainThread.InvokeAsync(delegate {
fontListComboBox.Items.AddRange(fonts.ToArray());
fontSizeComboBox.Enabled = true;
fontListComboBox.Enabled = true;
fontListComboBox.SelectedIndex = index;
fontSizeComboBox.Text = currentFont.Size.ToString();
}).FireAndForget();
DebugTimer.Start();
using (Bitmap newBitmap = new Bitmap(1, 1)) {
using (Graphics g = Graphics.FromImage(newBitmap)) {
foreach (FontDescriptor fd in fonts) {
fd.DetectMonospaced(g);
}
}
}
DebugTimer.Stop("Detect Monospaced");
fontListComboBox.Invalidate();
}
internal void MeasureComboBoxItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
{
ComboBox comboBox = (ComboBox)sender;
if (e.Index >= 0) {
FontDescriptor fontDescriptor = (FontDescriptor)comboBox.Items[e.Index];
SizeF size = e.Graphics.MeasureString(fontDescriptor.Name, comboBox.Font);
e.ItemWidth = (int)size.Width;
e.ItemHeight = (int)comboBox.Font.Height;
}
}
static StringFormat drawStringFormat = new StringFormat(StringFormatFlags.NoWrap);
Font boldComboBoxFont;
internal void ComboBoxDrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
ComboBox comboBox = (ComboBox)sender;
e.DrawBackground();
Rectangle drawingRect = new Rectangle(e.Bounds.X,
e.Bounds.Y,
e.Bounds.Width,
e.Bounds.Height);
Brush drawItemBrush = SystemBrushes.WindowText;
if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) {
drawItemBrush = SystemBrushes.HighlightText;
}
if (comboBox.Enabled == false) {
e.Graphics.DrawString(ResourceService.GetString("ICSharpCode.SharpDevelop.Gui.Pads.ClassScout.LoadingNode"),
comboBox.Font,
drawItemBrush,
drawingRect,
drawStringFormat);
} else if (e.Index >= 0) {
FontDescriptor fontDescriptor = (FontDescriptor)comboBox.Items[e.Index];
e.Graphics.DrawString(fontDescriptor.Name,
fontDescriptor.IsMonospaced ? boldComboBoxFont : comboBox.Font,
drawItemBrush,
drawingRect,
drawStringFormat);
}
e.DrawFocusRectangle();
}
public Font GetSelectedFont()
{
if (!fontListComboBox.Enabled)
return null;
float fontSize = 10f;
try {
fontSize = Math.Max(6, Single.Parse(fontSizeComboBox.Text));
} catch (Exception) {}
FontDescriptor fontDescriptor = (FontDescriptor)fontListComboBox.Items[fontListComboBox.SelectedIndex];
return new Font(fontDescriptor.Name,
fontSize);
}
public void UpdateFontPreviewLabel(Control fontPreviewLabel)
{
Font currentFont = GetSelectedFont();
fontPreviewLabel.Visible = currentFont != null;
if (currentFont != null) {
fontPreviewLabel.Font = currentFont;
}
}
public class FontDescriptor
{
FontFamily fontFamily;
internal string Name;
internal bool IsMonospaced;
public FontDescriptor(FontFamily fontFamily)
{
this.fontFamily = fontFamily;
this.Name = fontFamily.Name;
}
internal void DetectMonospaced(Graphics g)
{
this.IsMonospaced = DetectMonospaced(g, fontFamily);
}
static bool DetectMonospaced(Graphics g, FontFamily fontFamily)
{
using (Font f = new Font(fontFamily, 10)) {
// determine if the length of i == m because I see no other way of
// getting if a font is monospaced or not.
int w1 = TextRenderer.MeasureText("i.", f).Width;
int w2 = TextRenderer.MeasureText("mw", f).Width;
return w1 == w2;
}
}
}
}
}

46
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/old_OutputWindowOptionsPanel.cs

@ -1,46 +0,0 @@ @@ -1,46 +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.Windows.Forms;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
/// <summary>
/// The Output Window options panel.
/// </summary>
public class old_OutputWindowOptionsPanel : XmlFormsOptionPanel
{
public static readonly string OutputWindowsProperty = "SharpDevelop.UI.OutputWindowOptions";
old_FontSelectionPanel fontSelectionPanel;
public old_OutputWindowOptionsPanel()
{
}
public override void LoadPanelContents()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.SharpDevelop.Resources.old_OutputWindowOptionsPanel.xfrm"));
Properties properties = PropertyService.NestedProperties(OutputWindowsProperty);
fontSelectionPanel = new old_FontSelectionPanel();
fontSelectionPanel.Dock = DockStyle.Fill;
ControlDictionary["FontGroupBox"].Controls.Add(fontSelectionPanel);
((CheckBox)ControlDictionary["wordWrapCheckBox"]).Checked = properties.Get("WordWrap", true);
fontSelectionPanel.CurrentFontString = properties.Get("DefaultFont", SD.WinForms.DefaultMonospacedFont.ToString()).ToString();
}
public override bool StorePanelContents()
{
Properties properties = PropertyService.NestedProperties(OutputWindowsProperty);
properties.Set("WordWrap", ((CheckBox)ControlDictionary["wordWrapCheckBox"]).Checked);
string currentFontString = fontSelectionPanel.CurrentFontString;
if (currentFontString != null)
properties.Set("DefaultFont", currentFontString);
return true;
}
}
}
Loading…
Cancel
Save