bugfix in ImageBrowser

This commit is contained in:
codeimp 2007-10-31 22:16:53 +00:00
parent be95c10e99
commit 432d6362f2
2 changed files with 21 additions and 9 deletions

View file

@ -17,6 +17,7 @@ namespace CodeImp.DoomBuilder.Interface
{
components.Dispose();
}
if(graphics != null) graphics.Dispose();
base.Dispose(disposing);
}
@ -32,7 +33,6 @@ namespace CodeImp.DoomBuilder.Interface
this.rendertarget = new CodeImp.DoomBuilder.Interface.RenderTargetControl();
this.splitter.Panel1.SuspendLayout();
this.splitter.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.rendertarget)).BeginInit();
this.SuspendLayout();
//
// splitter
@ -61,7 +61,6 @@ namespace CodeImp.DoomBuilder.Interface
this.rendertarget.Name = "rendertarget";
this.rendertarget.Size = new System.Drawing.Size(518, 310);
this.rendertarget.TabIndex = 3;
this.rendertarget.TabStop = false;
//
// ImageBrowser
//
@ -74,7 +73,6 @@ namespace CodeImp.DoomBuilder.Interface
this.Size = new System.Drawing.Size(518, 346);
this.splitter.Panel1.ResumeLayout(false);
this.splitter.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.rendertarget)).EndInit();
this.ResumeLayout(false);
}

View file

@ -63,15 +63,21 @@ namespace CodeImp.DoomBuilder.Interface
// Constructor
public ImageBrowser()
{
// Make graphics device
graphics = new D3DDevice(rendertarget);
graphics.Initialize();
// Initialize
InitializeComponent();
// Make items list
items = new List<ImageBrowserItem>();
// Initialize
InitializeComponent();
rendertarget.SetBounds(0, 0, 0, 10000, BoundsSpecified.Height);
rendertarget.ClientSize = new Size(0, 10000);
}
// Destructor
~ImageBrowser()
{
// Clean up
if(graphics != null) graphics.Dispose();
}
#endregion
@ -92,6 +98,14 @@ namespace CodeImp.DoomBuilder.Interface
#region ================== Rendering
// Initialize
public void InitializeGraphics()
{
// Make graphics device
graphics = new D3DDevice(rendertarget);
graphics.Initialize();
}
// This redraws the list
public void Redraw()
{