Save Main window position

This commit is contained in:
andres.delikat 2011-02-18 02:10:46 +00:00
parent 9addfbd743
commit 9d6d190ad5
3 changed files with 13 additions and 0 deletions

View File

@ -8,6 +8,8 @@
public bool AutoLoadMostRecentRom = false; //TODO: eventually make a class or struct for all the auto-loads, which will include recent roms, movies, etc, as well as autoloading any modeless dialog
public RecentFiles RecentRoms = new RecentFiles(8);
public bool PauseWhenMenuActivated = true;
public int MainWndx = -1; //Negative numbers will be ignored
public int MainWndy = -1;
// Display options
public bool DisplayFPS = false;

View File

@ -963,6 +963,7 @@
this.MaximizeBox = false;
this.Name = "MainForm";
this.Text = "BizHawk";
this.Load += new System.EventHandler(this.MainForm_Load);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);

View File

@ -60,6 +60,8 @@ namespace BizHawk.MultiClient
Closing += (o, e) =>
{
CloseGame();
Global.Config.MainWndx = this.Location.X;
Global.Config.MainWndy = this.Location.Y;
ConfigService.Save("config.ini", Global.Config);
};
@ -105,6 +107,9 @@ namespace BizHawk.MultiClient
LoadRamWatch();
if (Global.Config.AutoLoadRamSearch)
LoadRamSearch();
if (Global.Config.MainWndx >= 0 && Global.Config.MainWndy >= 0)
this.Location = new Point(Global.Config.MainWndx, Global.Config.MainWndy);
}
private void PauseEmulator()
@ -1207,5 +1212,10 @@ namespace BizHawk.MultiClient
SoundConfig s = new SoundConfig();
s.ShowDialog();
}
private void MainForm_Load(object sender, EventArgs e)
{
}
}
}