Index: Core/Common/src/Core.Common.Controls.TreeView/Core.Common.Controls.TreeView.csproj =================================================================== diff -u -r232c52a296ea93557d8ee2e85a857b1010d3fad4 -rd5c5751c7eee70e25699a1a03a7d78aa56dbe2ea --- Core/Common/src/Core.Common.Controls.TreeView/Core.Common.Controls.TreeView.csproj (.../Core.Common.Controls.TreeView.csproj) (revision 232c52a296ea93557d8ee2e85a857b1010d3fad4) +++ Core/Common/src/Core.Common.Controls.TreeView/Core.Common.Controls.TreeView.csproj (.../Core.Common.Controls.TreeView.csproj) (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -54,9 +54,6 @@ Resources.resx - - Component - UserControl @@ -93,9 +90,6 @@ Resources.Designer.cs Designer - - TreeView.cs - TreeViewControl.cs Index: Core/Common/src/Core.Common.Controls.TreeView/TreeNodeDataDeletedEventArgs.cs =================================================================== diff -u -rfbb37872d09f1ded75ce2209e8e48a6b64d8a78f -rd5c5751c7eee70e25699a1a03a7d78aa56dbe2ea --- Core/Common/src/Core.Common.Controls.TreeView/TreeNodeDataDeletedEventArgs.cs (.../TreeNodeDataDeletedEventArgs.cs) (revision fbb37872d09f1ded75ce2209e8e48a6b64d8a78f) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeNodeDataDeletedEventArgs.cs (.../TreeNodeDataDeletedEventArgs.cs) (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -24,7 +24,7 @@ namespace Core.Common.Controls.TreeView { /// - /// Event arguments to be used in the event that node data has been deleted from a . + /// Event arguments to be used in the event that node data has been deleted from a . /// public class TreeNodeDataDeletedEventArgs : EventArgs { @@ -38,7 +38,7 @@ } /// - /// Gets the data instance deleted from the . + /// Gets the data instance deleted from the . /// public object DeletedDataInstance { get; private set; } } Fisheye: Tag d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Controls.TreeView/TreeView.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Controls.TreeView/TreeView.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs =================================================================== diff -u -rd52ae535aea52b4e43aa6837305502e6cd911a92 -rd5c5751c7eee70e25699a1a03a7d78aa56dbe2ea --- Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision d52ae535aea52b4e43aa6837305502e6cd911a92) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -6,6 +6,7 @@ using System.Windows.Forms; using System.Windows.Forms.VisualStyles; using Core.Common.Base; +using Core.Common.Controls.Forms; using Core.Common.Controls.TreeView.Properties; using log4net; using BaseResources = Core.Common.Base.Properties.Resources; @@ -150,7 +151,7 @@ } /// - /// This method searches all nodes in the for a node with a matching tag. + /// This method searches all nodes in the tree view for a node with a matching tag. /// /// The node data to search the corresponding for. /// The corresponding the provided node data or null if not found. @@ -764,7 +765,7 @@ private static void ScrollIntoView(Point point, TreeNode nodeOver, object sender) { - var treeView = sender as TreeView; + var treeView = sender as System.Windows.Forms.TreeView; if (treeView == null) { return; Index: Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -rd5c5751c7eee70e25699a1a03a7d78aa56dbe2ea --- Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -91,6 +91,9 @@ ExceptionDialog.cs + + Component + UserControl @@ -141,6 +144,9 @@ ExceptionDialog.cs Designer + + DoubleBufferedTreeView.cs + ResXFileCodeGenerator Resources.Designer.cs Index: Core/Common/src/Core.Common.Controls/Forms/DoubleBufferedTreeView.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Controls/Forms/DoubleBufferedTreeView.cs (revision 0) +++ Core/Common/src/Core.Common.Controls/Forms/DoubleBufferedTreeView.cs (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -0,0 +1,132 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace Core.Common.Controls.Forms +{ + /// + /// Double buffered version of. + /// + /// + /// Also see http://dev.nomad-net.info/articles/double-buffered-tree-and-list-views). + /// + public class DoubleBufferedTreeView : TreeView + { + private const int tvFirst = 0x1100; + private const int tvmSetbkcolor = tvFirst + 29; + private const int tvmSetextendedstyle = tvFirst + 44; + private const int tvsExDoublebuffer = 0x0004; + + /// + /// Creates a new instance of . + /// + public DoubleBufferedTreeView() + { + // Enable default double buffering processing + SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); + + // Disable default CommCtrl painting on non-Vista systems + if (!NativeInterop.IsWinVista) + { + SetStyle(ControlStyles.UserPaint, true); + } + } + + private void UpdateExtendedStyles() + { + var style = 0; + + if (DoubleBuffered) + { + style |= tvsExDoublebuffer; + } + + if (style != 0) + { + NativeInterop.SendMessage(Handle, tvmSetextendedstyle, (IntPtr) tvsExDoublebuffer, (IntPtr) style); + } + } + + protected override void OnHandleCreated(EventArgs e) + { + base.OnHandleCreated(e); + + UpdateExtendedStyles(); + + if (!NativeInterop.IsWinXp) + { + NativeInterop.SendMessage(Handle, tvmSetbkcolor, IntPtr.Zero, (IntPtr) ColorTranslator.ToWin32(BackColor)); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + if (GetStyle(ControlStyles.UserPaint)) + { + var m = new Message + { + HWnd = Handle, + Msg = NativeInterop.WmPrintclient, + WParam = e.Graphics.GetHdc(), + LParam = (IntPtr) NativeInterop.PrfClient + }; + + DefWndProc(ref m); + + e.Graphics.ReleaseHdc(m.WParam); + } + + base.OnPaint(e); + } + + private static class NativeInterop + { + public const int WmPrintclient = 0x0318; + public const int PrfClient = 0x00000004; + + public static bool IsWinXp + { + get + { + OperatingSystem os = Environment.OSVersion; + return (os.Platform == PlatformID.Win32NT) && + ((os.Version.Major > 5) || ((os.Version.Major == 5) && (os.Version.Minor == 1))); + } + } + + public static bool IsWinVista + { + get + { + OperatingSystem os = Environment.OSVersion; + return (os.Platform == PlatformID.Win32NT) && (os.Version.Major >= 6); + } + } + + [DllImport("user32.dll")] + public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); + } + } +} \ No newline at end of file Index: Core/Common/src/Core.Common.Controls/Forms/DoubleBufferedTreeView.resx =================================================================== diff -u --- Core/Common/src/Core.Common.Controls/Forms/DoubleBufferedTreeView.resx (revision 0) +++ Core/Common/src/Core.Common.Controls/Forms/DoubleBufferedTreeView.resx (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADe + BwAAAk1TRnQBSQFMAwEBAAEFAQABBAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA + AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA + AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA + AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm + AwABmQMAAcwCAAEzAwACMwIAATMBZgIAATMBmQIAATMBzAIAATMB/wIAAWYDAAFmATMCAAJmAgABZgGZ + AgABZgHMAgABZgH/AgABmQMAAZkBMwIAAZkBZgIAApkCAAGZAcwCAAGZAf8CAAHMAwABzAEzAgABzAFm + AgABzAGZAgACzAIAAcwB/wIAAf8BZgIAAf8BmQIAAf8BzAEAATMB/wIAAf8BAAEzAQABMwEAAWYBAAEz + AQABmQEAATMBAAHMAQABMwEAAf8BAAH/ATMCAAMzAQACMwFmAQACMwGZAQACMwHMAQACMwH/AQABMwFm + AgABMwFmATMBAAEzAmYBAAEzAWYBmQEAATMBZgHMAQABMwFmAf8BAAEzAZkCAAEzAZkBMwEAATMBmQFm + AQABMwKZAQABMwGZAcwBAAEzAZkB/wEAATMBzAIAATMBzAEzAQABMwHMAWYB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AHM + ATMCAAH/AjMBAAH/ATMBZgEAAf8BMwGZAQAB/wEzAcwBAAH/ATMB/wEAAf8BZgIAAf8BZgEzAQABzAJm + AQAB/wFmAZkBAAH/AWYBzAEAAcwBZgH/AQAB/wGZAgAB/wGZATMBAAH/AZkBZgEAAf8CmQEAAf8BmQHM + AQAB/wGZAf8BAAH/AcwCAAH/AcwBMwEAAf8BzAFmAQAB/wHMAZkBAAH/AswBAAH/AcwB/wEAAv8BMwEA + AcwB/wFmAQAC/wGZAQAC/wHMAQACZgH/AQABZgH/AWYBAAFmAv8BAAH/AmYBAAH/AWYB/wEAAv8BZgEA + ASEBAAGlAQADXwEAA3cBAAOGAQADlgEAA8sBAAOyAQAD1wEAA90BAAPjAQAD6gEAA/EBAAP4AQAB8AH7 + Af8BAAGkAqABAAOAAwAB/wIAAf8DAAL/AQAB/wMAAf8BAAH/AQAC/wIAA/8BAAEEAfwDBAH8CgQwAAME + AfwBBAH8BgQB/AEEAvwwAAT8AwQC/AMEAfwCBAH8MAAGBAP8BAQC/AEEMAAHBAT8BQQwAAQEAfwBBAL8 + AQQD/AMEAfwwAAQEAfwBBAH8AQQC/AEEAfwBBAH8AgQwAAIEBPwBBAP8AQQC/AMEMAACBAf8AQQD/AME + MAADBAH8AQQB/AIEA/wBBAH8AwQwAAEEAfwEBAH8CQQwAAEEAvwEBAT8BQQwAAYEBPwDBAL8AQQwAAH8 + AwQB/AMEAfwCBAH8AQQB/AIEMAACBAH8AQQB/AUEAvwBBAH8AQQB/DAAAgQB/AIEAvwHBAH8AQQwAAFC + AU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/gQAL + + + + False + + \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/ContextMenu/TreeViewContextMenuItemFactory.cs =================================================================== diff -u -rb3db013105d10992eeefea39f5ecbdacdd57b4d4 -rd5c5751c7eee70e25699a1a03a7d78aa56dbe2ea --- Core/Common/src/Core.Common.Gui/ContextMenu/TreeViewContextMenuItemFactory.cs (.../TreeViewContextMenuItemFactory.cs) (revision b3db013105d10992eeefea39f5ecbdacdd57b4d4) +++ Core/Common/src/Core.Common.Gui/ContextMenu/TreeViewContextMenuItemFactory.cs (.../TreeViewContextMenuItemFactory.cs) (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -28,9 +28,7 @@ namespace Core.Common.Gui.ContextMenu { /// - /// This class represents a factory for creating . The - /// items the factory creates are dependent on a set for - /// the . + /// This class represents a factory for creating . /// internal class TreeViewContextMenuItemFactory { Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs =================================================================== diff -u -rb3db013105d10992eeefea39f5ecbdacdd57b4d4 -rd5c5751c7eee70e25699a1a03a7d78aa56dbe2ea --- Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs (.../TreeViewContextMenuItemFactoryTest.cs) (revision b3db013105d10992eeefea39f5ecbdacdd57b4d4) +++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs (.../TreeViewContextMenuItemFactoryTest.cs) (revision d5c5751c7eee70e25699a1a03a7d78aa56dbe2ea) @@ -7,7 +7,6 @@ using NUnit.Extensions.Forms; using NUnit.Framework; using Rhino.Mocks; -using TreeView = Core.Common.Controls.TreeView.TreeView; namespace Core.Common.Gui.Test.ContextMenu { @@ -193,12 +192,9 @@ { // Setup var treeNode = new TreeNode(); - var treeView = new TreeView(); var treeNodeInfo = new TreeNodeInfo(); var treeViewControl = new TreeViewControl(); - treeView.Nodes.Add(treeNode); - if (hasChildren) { treeNode.Nodes.Add(new TreeNode()); @@ -231,12 +227,9 @@ { // Setup var treeNode = new TreeNode(); - var treeView = new TreeView(); var treeNodeInfo = new TreeNodeInfo(); var treeViewControl = new TreeViewControl(); - treeView.Nodes.Add(treeNode); - if (hasChildren) { treeNode.Expand();