Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hutchinson <m.j.hutchinson@gmail.com>2011-11-03 20:32:54 +0400
committerMichael Hutchinson <m.j.hutchinson@gmail.com>2011-11-03 20:32:54 +0400
commit74debf11a28db65ccc608d2f3b4b5882d2c15ba0 (patch)
tree909e642efce938b7328f422798accc08588a4305 /main/src/addins/NUnit
parent59ce16ca4d324db989aae0862a2cc4b35442f1b7 (diff)
[NUnit] Port to context menu API
Diffstat (limited to 'main/src/addins/NUnit')
-rw-r--r--main/src/addins/NUnit/Gui/TestPad.cs7
-rw-r--r--main/src/addins/NUnit/Gui/TestResultsPad.cs16
-rw-r--r--main/src/addins/NUnit/Makefile.am1
-rw-r--r--main/src/addins/NUnit/MonoDevelop.NUnit.csproj5
4 files changed, 16 insertions, 13 deletions
diff --git a/main/src/addins/NUnit/Gui/TestPad.cs b/main/src/addins/NUnit/Gui/TestPad.cs
index 0d4698e571..63c1a7ece9 100644
--- a/main/src/addins/NUnit/Gui/TestPad.cs
+++ b/main/src/addins/NUnit/Gui/TestPad.cs
@@ -146,7 +146,7 @@ namespace MonoDevelop.NUnit
VBox boxPaned1 = new VBox ();
chart = new TestChart ();
- chart.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (OnChartPopupMenu);
+ chart.ButtonPressEvent += OnChartButtonPress;
chart.SelectionChanged += new EventHandler (OnChartDateChanged);
chart.HeightRequest = 50;
@@ -712,10 +712,11 @@ namespace MonoDevelop.NUnit
chart.GoLast ();
}
- void OnChartPopupMenu (object o, Gtk.ButtonReleaseEventArgs args)
+ void OnChartButtonPress (object o, Gtk.ButtonPressEventArgs args)
{
- if (args.Event.Button == 3) {
+ if (Mono.TextEditor.GtkWorkarounds.ButtonEventTriggersContextMenu (args.Event)) {
IdeApp.CommandService.ShowContextMenu ("/MonoDevelop/NUnit/ContextMenu/TestChart");
+ args.RetVal = true;
}
}
diff --git a/main/src/addins/NUnit/Gui/TestResultsPad.cs b/main/src/addins/NUnit/Gui/TestResultsPad.cs
index 78c57dfb86..a23e06074a 100644
--- a/main/src/addins/NUnit/Gui/TestResultsPad.cs
+++ b/main/src/addins/NUnit/Gui/TestResultsPad.cs
@@ -59,7 +59,7 @@ namespace MonoDevelop.NUnit
Label resultLabel = new Label ();
ProgressBar progressBar = new ProgressBar ();
- TreeView failuresTreeView;
+ MonoDevelop.Ide.Gui.Components.PadTreeView failuresTreeView;
TreeStore failuresStore;
TextView outputView;
TextTag bold;
@@ -109,7 +109,7 @@ namespace MonoDevelop.NUnit
panel.FocusChain = new Gtk.Widget [] { book };
// Failures tree
- failuresTreeView = new TreeView ();
+ failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
failuresTreeView.HeadersVisible = false;
failuresStore = new TreeStore (typeof(Pixbuf), typeof (string), typeof(object), typeof(string));
var pr = new CellRendererPixbuf ();
@@ -138,9 +138,12 @@ namespace MonoDevelop.NUnit
book.Pack2 (sw, true, true);
outputViewScrolled = sw;
- failuresTreeView.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (OnPopupMenu);
failuresTreeView.RowActivated += OnRowActivated;
failuresTreeView.Selection.Changed += OnRowSelected;
+ failuresTreeView.DoPopupMenu = delegate (EventButton evt) {
+ IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt,
+ "/MonoDevelop/NUnit/ContextMenu/TestResultsPad");
+ };
Control.ShowAll ();
@@ -408,13 +411,6 @@ namespace MonoDevelop.NUnit
return;
NUnitService.Instance.RunTest (rootTest, null);
}
-
- void OnPopupMenu (object o, Gtk.ButtonReleaseEventArgs args)
- {
- if (args.Event.Button == 3) {
- IdeApp.CommandService.ShowContextMenu ("/MonoDevelop/NUnit/ContextMenu/TestResultsPad");
- }
- }
void OnRowActivated (object s, EventArgs a)
{
diff --git a/main/src/addins/NUnit/Makefile.am b/main/src/addins/NUnit/Makefile.am
index a68a08ea78..1a76b8ee59 100644
--- a/main/src/addins/NUnit/Makefile.am
+++ b/main/src/addins/NUnit/Makefile.am
@@ -5,6 +5,7 @@ ASSEMBLY = $(ADDIN_BUILD)/MonoDevelop.NUnit.dll
DEPS = \
$(top_builddir)/build/AddIns/NUnit/NUnitRunner.dll \
+ $(top_builddir)/build/bin/Mono.TextEditor.dll \
$(top_builddir)/build/bin/MonoDevelop.Core.dll \
$(top_builddir)/build/bin/MonoDevelop.Ide.dll
diff --git a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
index 7ee2212f39..93baf7a100 100644
--- a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
+++ b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
@@ -87,6 +87,11 @@
<Name>NUnitRunner</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
+ <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
+ <Name>Mono.TextEditor</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="templates\NUnitAssemblyGroup.xpt.xml">