From 7747fbfe4991d8d8632b299f75089be84d5af81f Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Wed, 31 Mar 2010 19:31:54 +0000 Subject: [PATCH] Snippet compiler sample now supports tooltips. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5661 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../SharpSnippetCompilerControl.cs | 15 --------------- .../SharpSnippetCompiler.Core/Workbench.cs | 3 ++- .../SharpSnippetCompiler/MainForm.cs | 2 +- .../SharpSnippetCompiler/Program.cs | 7 ++++++- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/SharpSnippetCompilerControl.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/SharpSnippetCompilerControl.cs index 70396e523c..0c8a0680a6 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/SharpSnippetCompilerControl.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/SharpSnippetCompilerControl.cs @@ -32,8 +32,6 @@ namespace ICSharpCode.SharpSnippetCompiler.Core textEditor = new SharpDevelopTextAreaControl(); textEditor.Dock = DockStyle.Fill; this.Controls.Add(textEditor); - - textEditor.ActiveTextAreaControl.TextArea.IconBarMargin.MouseDown += MarginMouseDown; } public TextEditorControl TextEditor { @@ -49,18 +47,5 @@ namespace ICSharpCode.SharpSnippetCompiler.Core { 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); - } - } } } diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs index a9090d5629..5570fac10a 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs @@ -91,7 +91,8 @@ namespace ICSharpCode.SharpSnippetCompiler.Core public void ShowView(IViewContent content) { - throw new NotImplementedException(); + views.Add(content); + OnViewOpened(new ViewContentEventArgs(content)); } public void ShowPad(PadDescriptor content) diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler/MainForm.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler/MainForm.cs index b7068f25ad..e3e906f237 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler/MainForm.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler/MainForm.cs @@ -109,7 +109,7 @@ namespace ICSharpCode.SharpSnippetCompiler WorkbenchWindow window = new WorkbenchWindow(fileTabControl, tabPage); MainViewContent view = new MainViewContent(fileName, snippetControl, window); - WorkbenchSingleton.Workbench.ViewContentCollection.Add(view); + WorkbenchSingleton.Workbench.ShowView(view); UpdateActiveView(view); diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler/Program.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler/Program.cs index 4f723fe119..8316b04261 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler/Program.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler/Program.cs @@ -1,5 +1,5 @@ // SharpDevelop samples -// Copyright (c) 2008, AlphaSierraPapa +// Copyright (c) 2010, AlphaSierraPapa // All rights reserved. // // 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.SharpDevelop; +using ICSharpCode.SharpDevelop.Debugging; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpSnippetCompiler.Core; @@ -54,6 +55,10 @@ namespace ICSharpCode.SharpSnippetCompiler SharpSnippetCompilerManager.Init(); mainForm = new MainForm(); + + // Force creation of the debugger before workbench is created. + IDebugger debugger = DebuggerService.CurrentDebugger; + Workbench workbench = new Workbench(mainForm); WorkbenchSingleton.InitializeWorkbench(workbench, new WorkbenchLayout()); PadDescriptor errorList = workbench.GetPad(typeof(ErrorListPad));