Browse Source

Snippet compiler sample now supports tooltips.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5661 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Matt Ward 16 years ago
parent
commit
7747fbfe49
  1. 15
      samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/SharpSnippetCompilerControl.cs
  2. 3
      samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs
  3. 2
      samples/SharpSnippetCompiler/SharpSnippetCompiler/MainForm.cs
  4. 7
      samples/SharpSnippetCompiler/SharpSnippetCompiler/Program.cs

15
samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/SharpSnippetCompilerControl.cs

@ -32,8 +32,6 @@ namespace ICSharpCode.SharpSnippetCompiler.Core
textEditor = new SharpDevelopTextAreaControl(); textEditor = new SharpDevelopTextAreaControl();
textEditor.Dock = DockStyle.Fill; textEditor.Dock = DockStyle.Fill;
this.Controls.Add(textEditor); this.Controls.Add(textEditor);
textEditor.ActiveTextAreaControl.TextArea.IconBarMargin.MouseDown += MarginMouseDown;
} }
public TextEditorControl TextEditor { public TextEditorControl TextEditor {
@ -49,18 +47,5 @@ namespace ICSharpCode.SharpSnippetCompiler.Core
{ {
textEditor.SaveFile(textEditor.FileName); textEditor.SaveFile(textEditor.FileName);
} }
static void MarginMouseDown(AbstractMargin iconBar, Point mousepos, MouseButtons mouseButtons)
{
if (mouseButtons != MouseButtons.Left) return;
Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition;
TextLocation logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top);
if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) {
DebuggerService.ToggleBreakpointAt(iconBar.TextArea.Document, iconBar.TextArea.MotherTextEditorControl.FileName, logicPos.Y);
iconBar.TextArea.Refresh(iconBar);
}
}
} }
} }

3
samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs

@ -91,7 +91,8 @@ namespace ICSharpCode.SharpSnippetCompiler.Core
public void ShowView(IViewContent content) public void ShowView(IViewContent content)
{ {
throw new NotImplementedException(); views.Add(content);
OnViewOpened(new ViewContentEventArgs(content));
} }
public void ShowPad(PadDescriptor content) public void ShowPad(PadDescriptor content)

2
samples/SharpSnippetCompiler/SharpSnippetCompiler/MainForm.cs

@ -109,7 +109,7 @@ namespace ICSharpCode.SharpSnippetCompiler
WorkbenchWindow window = new WorkbenchWindow(fileTabControl, tabPage); WorkbenchWindow window = new WorkbenchWindow(fileTabControl, tabPage);
MainViewContent view = new MainViewContent(fileName, snippetControl, window); MainViewContent view = new MainViewContent(fileName, snippetControl, window);
WorkbenchSingleton.Workbench.ViewContentCollection.Add(view); WorkbenchSingleton.Workbench.ShowView(view);
UpdateActiveView(view); UpdateActiveView(view);

7
samples/SharpSnippetCompiler/SharpSnippetCompiler/Program.cs

@ -1,5 +1,5 @@
// SharpDevelop samples // SharpDevelop samples
// Copyright (c) 2008, AlphaSierraPapa // Copyright (c) 2010, AlphaSierraPapa
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
@ -32,6 +32,7 @@ using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpSnippetCompiler.Core; using ICSharpCode.SharpSnippetCompiler.Core;
@ -54,6 +55,10 @@ namespace ICSharpCode.SharpSnippetCompiler
SharpSnippetCompilerManager.Init(); SharpSnippetCompilerManager.Init();
mainForm = new MainForm(); mainForm = new MainForm();
// Force creation of the debugger before workbench is created.
IDebugger debugger = DebuggerService.CurrentDebugger;
Workbench workbench = new Workbench(mainForm); Workbench workbench = new Workbench(mainForm);
WorkbenchSingleton.InitializeWorkbench(workbench, new WorkbenchLayout()); WorkbenchSingleton.InitializeWorkbench(workbench, new WorkbenchLayout());
PadDescriptor errorList = workbench.GetPad(typeof(ErrorListPad)); PadDescriptor errorList = workbench.GetPad(typeof(ErrorListPad));

Loading…
Cancel
Save