UltimateZoneBuilder/Source/Plugins/SoundPropagationMode/BufferedTreeView.cs
MaxED 0a7bd9f636 Added Sound Propagation plugin by boris (https://github.com/biwa/soundpropagationmode).
Changes since 5bf51d0:
Large scale cleanup & refactoring.
Sound Propagation Mode: you can now click on doublesided linedefs to toggle sound blocking flag.
Sound Environment Mode: you can now click on doublesided linedefs to toggle sound zone boundary flag.
Sound Propagation Mode: reimplemented the highlighting of non-deaf things. Things are now highlighted using selection color.
Removed "Show tooltips" checkbox. Tooltips are now always enabled.
Fixed, Sound Environment Mode: thing tooltip about multiple active sound environment things was shown even when there was only one active sound environment thing.
Fixed, Sound Environment Mode: "Configure colors" toolbar button was not working because of missing action.
Fixed, cosmetic: "Configure colors" toolbar icon was missing a tooltip.
Fixed, cosmetic: display was not redrawn after changing colors using "Color configuration" window.
2015-01-23 12:36:43 +00:00

24 lines
No EOL
823 B
C#

using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
// As per http://stackoverflow.com/questions/10362988/treeview-flickering
// Gets rid of the flickering default TreeView
namespace CodeImp.DoomBuilder.SoundPropagationMode
{
public class BufferedTreeView : TreeView
{
protected override void OnHandleCreated(EventArgs e)
{
SendMessage(this.Handle, TVM_SETEXTENDEDSTYLE, (IntPtr)TVS_EX_DOUBLEBUFFER, (IntPtr)TVS_EX_DOUBLEBUFFER);
base.OnHandleCreated(e);
}
// Pinvoke:
private const int TVM_SETEXTENDEDSTYLE = 0x1100 + 44;
private const int TVM_GETEXTENDEDSTYLE = 0x1100 + 45;
private const int TVS_EX_DOUBLEBUFFER = 0x0004;
[DllImport("user32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
}
}