Browse Source

Code generator (Alt+ins) now works again. fixed texteditor drawing bug.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@20 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mike Krüger 21 years ago
parent
commit
fc08e8e8d8
  1. 1
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/DefaultDocument.cs
  2. 6
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs
  3. 23
      src/Main/Base/Project/Src/Internal/Auswerter/WindowActiveAuswerter.cs
  4. 15
      src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/CodeGenerator.cs
  5. 6
      src/Main/Base/Project/Src/TextEditor/Commands/GenerateCodeCommand.cs

1
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/DefaultDocument.cs

@ -134,7 +134,6 @@ namespace ICSharpCode.TextEditor.Document @@ -134,7 +134,6 @@ namespace ICSharpCode.TextEditor.Document
}
}
public bool ReadOnly {
get {
return readOnly;

6
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

@ -118,7 +118,7 @@ namespace ICSharpCode.TextEditor @@ -118,7 +118,7 @@ namespace ICSharpCode.TextEditor
}
}
#region Paint functions
#region Paint functions
public override void Paint(Graphics g, Rectangle rect)
{
if (rect.Width <= 0 || rect.Height <= 0) {
@ -574,7 +574,7 @@ namespace ICSharpCode.TextEditor @@ -574,7 +574,7 @@ namespace ICSharpCode.TextEditor
// }
float wordWidth = g.MeasureString(word, font, 32768, measureStringFormat).Width;
g.FillRectangle(backBrush,
new RectangleF(position.X, position.Y, (float)Math.Ceiling(wordWidth), FontHeight));
new RectangleF(position.X, position.Y, (float)Math.Ceiling(wordWidth + 1), FontHeight));
g.DrawString(word,
font,
@ -584,7 +584,7 @@ namespace ICSharpCode.TextEditor @@ -584,7 +584,7 @@ namespace ICSharpCode.TextEditor
measureStringFormat);
return wordWidth;
}
#endregion
#endregion
#region Conversion Functions
public float GetWidth(char ch)

23
src/Main/Base/Project/Src/Internal/Auswerter/WindowActiveAuswerter.cs

@ -36,25 +36,12 @@ namespace ICSharpCode.Core @@ -36,25 +36,12 @@ namespace ICSharpCode.Core
}
Type currentType = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ActiveViewContent.GetType();
if (currentType.Equals(prevType)) {
return prevValidFlag;
} else {
prevType = currentType;
if (currentType.ToString() == activewindow) {
prevValidFlag = true;
return true;
}
foreach (Type i in currentType.GetInterfaces()) {
if (i.ToString() == activewindow) {
prevValidFlag = true;
return true;
}
}
Type activeType = Type.GetType(activewindow);
if (activeType == null) {
return false;
}
prevValidFlag = false;
return false;
return activeType.IsAssignableFrom(currentType);
}
}
}

15
src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/CodeGenerator.cs

@ -30,16 +30,19 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -30,16 +30,19 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
public CodeGenerator(IClass currentClass)
{
this.currentClass = currentClass;
try {
csa = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("CSharp", this);
vba = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("VBNET", this);
} catch {
csa = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("C#", this);
csa.ConversionFlags = ConversionFlags.All;
} catch (Exception) {
Console.WriteLine("CSharpAmbience not found -- is the C# backend binding loaded???");
return;
}
this.currentClass = currentClass;
csa.ConversionFlags = ConversionFlags.All;
try {
vba = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("VBNET", this);
} catch (Exception) {
Console.WriteLine("VBNet ambience not found -- is the VB.NET backend binding loaded???");
}
}
public abstract string CategoryName {

6
src/Main/Base/Project/Src/TextEditor/Commands/GenerateCodeCommand.cs

@ -37,8 +37,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -37,8 +37,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
}
TextEditorControl textEditorControl = ((ITextEditorControlProvider)window.ViewContent).TextEditorControl;
ParseInformation parseInformation;
if (window.ViewContent.IsUntitled) {
@ -139,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -139,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
// Must be called for initialization
this.InitializeComponents();
selectionListBox.Sorted = true;
// selectionListBox.Sorted = true;
Point caretPos = textEditorControl.ActiveTextAreaControl.Caret.Position;
TextArea textArea = textEditorControl.ActiveTextAreaControl.TextArea;
TextView textView = textArea.TextView;
@ -215,7 +213,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -215,7 +213,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
selectionListBox.Items.Clear();
if (codeGenerator.Content.Count > 0) {
Hashtable objs = new Hashtable();
selectionListBox.Sorted = codeGenerator.Content.Count > 1;
// selectionListBox.Sorted = codeGenerator.Content.Count > 1;
foreach (object o in codeGenerator.Content) {
if (!objs.Contains(o.ToString())) {
selectionListBox.Items.Add(o);

Loading…
Cancel
Save