made texture and flat browsers resizable and maximizable

This commit is contained in:
codeimp 2009-01-23 14:41:01 +00:00
parent efa5663ca3
commit 5b1feeaa14
4 changed files with 29 additions and 33 deletions

View file

@ -121,14 +121,11 @@ namespace CodeImp.DoomBuilder.Windows
this.Controls.Add(this.apply); this.Controls.Add(this.apply);
this.Controls.Add(this.browser); this.Controls.Add(this.browser);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "FlatBrowserForm"; this.Name = "FlatBrowserForm";
this.Opacity = 0;
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Browse Flats"; this.Text = "Browse Flats";
this.Load += new System.EventHandler(this.FlatBrowserForm_Load); this.Load += new System.EventHandler(this.FlatBrowserForm_Load);
this.Activated += new System.EventHandler(this.FlatBrowserForm_Activated); this.Activated += new System.EventHandler(this.FlatBrowserForm_Activated);

View file

@ -34,7 +34,7 @@ using CodeImp.DoomBuilder.Controls;
namespace CodeImp.DoomBuilder.Windows namespace CodeImp.DoomBuilder.Windows
{ {
internal partial class FlatBrowserForm : DelayedForm internal partial class FlatBrowserForm : Form
{ {
// Variables // Variables
private string selectedname; private string selectedname;
@ -90,6 +90,18 @@ namespace CodeImp.DoomBuilder.Windows
// Keep last position and size // Keep last position and size
lastposition = this.Location; lastposition = this.Location;
lastsize = this.Size; lastsize = this.Size;
// Position window from configuration settings
this.SuspendLayout();
/*
this.Location = new Point(General.Settings.ReadSetting("browserwindow.positionx", this.Location.X),
General.Settings.ReadSetting("browserwindow.positiony", this.Location.Y));
*/
this.Size = new Size(General.Settings.ReadSetting("browserwindow.sizewidth", this.Size.Width),
General.Settings.ReadSetting("browserwindow.sizeheight", this.Size.Height));
this.WindowState = (FormWindowState)General.Settings.ReadSetting("browserwindow.windowstate", (int)FormWindowState.Normal);
if(this.WindowState == FormWindowState.Normal) this.StartPosition = FormStartPosition.CenterParent;
this.ResumeLayout(true);
} }
// Selection changed // Selection changed
@ -127,17 +139,6 @@ namespace CodeImp.DoomBuilder.Windows
// Loading // Loading
private void FlatBrowserForm_Load(object sender, EventArgs e) private void FlatBrowserForm_Load(object sender, EventArgs e)
{ {
/*
// Position window from configuration settings
this.SuspendLayout();
this.Location = new Point(General.Settings.ReadSetting("browserwindow.positionx", this.Location.X),
General.Settings.ReadSetting("browserwindow.positiony", this.Location.Y));
this.Size = new Size(General.Settings.ReadSetting("browserwindow.sizewidth", this.Size.Width),
General.Settings.ReadSetting("browserwindow.sizeheight", this.Size.Height));
this.WindowState = (FormWindowState)General.Settings.ReadSetting("browserwindow.windowstate", (int)FormWindowState.Normal);
this.ResumeLayout(true);
*/
// Normal windowstate? // Normal windowstate?
if(this.WindowState == FormWindowState.Normal) if(this.WindowState == FormWindowState.Normal)
{ {

View file

@ -121,14 +121,11 @@ namespace CodeImp.DoomBuilder.Windows
this.Controls.Add(this.apply); this.Controls.Add(this.apply);
this.Controls.Add(this.browser); this.Controls.Add(this.browser);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "TextureBrowserForm"; this.Name = "TextureBrowserForm";
this.Opacity = 0;
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Browse Textures"; this.Text = "Browse Textures";
this.Load += new System.EventHandler(this.TextureBrowserForm_Load); this.Load += new System.EventHandler(this.TextureBrowserForm_Load);
this.Activated += new System.EventHandler(this.TextureBrowserForm_Activated); this.Activated += new System.EventHandler(this.TextureBrowserForm_Activated);

View file

@ -34,7 +34,7 @@ using CodeImp.DoomBuilder.Controls;
namespace CodeImp.DoomBuilder.Windows namespace CodeImp.DoomBuilder.Windows
{ {
internal partial class TextureBrowserForm : DelayedForm internal partial class TextureBrowserForm : Form
{ {
// Variables // Variables
private string selectedname; private string selectedname;
@ -90,6 +90,18 @@ namespace CodeImp.DoomBuilder.Windows
// Keep last position and size // Keep last position and size
lastposition = this.Location; lastposition = this.Location;
lastsize = this.Size; lastsize = this.Size;
// Position window from configuration settings
this.SuspendLayout();
/*
this.Location = new Point(General.Settings.ReadSetting("browserwindow.positionx", this.Location.X),
General.Settings.ReadSetting("browserwindow.positiony", this.Location.Y));
*/
this.Size = new Size(General.Settings.ReadSetting("browserwindow.sizewidth", this.Size.Width),
General.Settings.ReadSetting("browserwindow.sizeheight", this.Size.Height));
this.WindowState = (FormWindowState)General.Settings.ReadSetting("browserwindow.windowstate", (int)FormWindowState.Normal);
if(this.WindowState == FormWindowState.Normal) this.StartPosition = FormStartPosition.CenterParent;
this.ResumeLayout(true);
} }
// Selection changed // Selection changed
@ -127,17 +139,6 @@ namespace CodeImp.DoomBuilder.Windows
// Loading // Loading
private void TextureBrowserForm_Load(object sender, EventArgs e) private void TextureBrowserForm_Load(object sender, EventArgs e)
{ {
/*
// Position window from configuration settings
this.SuspendLayout();
this.Location = new Point(General.Settings.ReadSetting("browserwindow.positionx", this.Location.X),
General.Settings.ReadSetting("browserwindow.positiony", this.Location.Y));
this.Size = new Size(General.Settings.ReadSetting("browserwindow.sizewidth", this.Size.Width),
General.Settings.ReadSetting("browserwindow.sizeheight", this.Size.Height));
this.WindowState = (FormWindowState)General.Settings.ReadSetting("browserwindow.windowstate", (int)FormWindowState.Normal);
this.ResumeLayout(true);
*/
// Normal windowstate? // Normal windowstate?
if(this.WindowState == FormWindowState.Normal) if(this.WindowState == FormWindowState.Normal)
{ {