Ram Search - Refactor saving of config settings, fix remembering of window location & size, and fix anchoring of output label

This commit is contained in:
andres.delikat 2011-02-25 02:50:57 +00:00
parent 04bee5f950
commit f0378a8313
4 changed files with 13 additions and 18 deletions

View File

@ -1081,6 +1081,8 @@ namespace BizHawk.MultiClient
}
if (!RamWatch1.IsDisposed)
RamWatch1.SaveConfigSettings();
if (!RamSearch1.IsDisposed)
RamSearch1.SaveConfigSettings();
ConfigService.Save("config.ini", Global.Config);
}
}

View File

@ -1107,8 +1107,6 @@
this.Name = "RamSearch";
this.Text = "Ram Search";
this.Load += new System.EventHandler(this.RamSearch_Load);
this.Resize += new System.EventHandler(this.RamSearch_Resize);
this.LocationChanged += new System.EventHandler(this.RamSearch_LocationChanged);
this.SearchtoolStrip1.ResumeLayout(false);
this.SearchtoolStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);

View File

@ -17,7 +17,6 @@ namespace BizHawk.MultiClient
public partial class RamSearch : Form
{
//TODO:
//Window position gets saved but doesn't load properly
//Context Menu - if highlighted items - show Highlight dependent functions
string systemID = "NULL";
@ -37,10 +36,19 @@ namespace BizHawk.MultiClient
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
int defaultHeight;
string currentSearchFile = "";
public void SaveConfigSettings()
{
Global.Config.RamSearchWndx = this.Location.X;
Global.Config.RamSearchWndy = this.Location.Y;
Global.Config.RamSearchWidth = this.Right - this.Left;
Global.Config.RamSearchHeight = this.Bottom - this.Top;
}
public RamSearch()
{
InitializeComponent();
Closing += (o, e) => SaveConfigSettings();
}
public void UpdateValues()
@ -264,18 +272,6 @@ namespace BizHawk.MultiClient
AddToRamWatch();
}
private void RamSearch_LocationChanged(object sender, EventArgs e)
{
Global.Config.RamSearchWndx = this.Location.X;
Global.Config.RamSearchWndy = this.Location.Y;
}
private void RamSearch_Resize(object sender, EventArgs e)
{
Global.Config.RamSearchWidth = this.Right - this.Left;
Global.Config.RamSearchHeight = this.Bottom - this.Top;
}
private void restoreOriginalWindowSizeToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Size = new System.Drawing.Size(defaultWidth, defaultHeight);

View File

@ -103,8 +103,7 @@ namespace BizHawk.MultiClient
WatchListView.QueryItemText += new QueryItemTextHandler(WatchListView_QueryItemText);
WatchListView.QueryItemBkColor += new QueryItemBkColorHandler(WatchListView_QueryItemBkColor);
WatchListView.VirtualMode = true;
Closing += (o, e) => SaveConfigSettings();
Closing += (o, e) => SaveConfigSettings();
}
protected override void OnClosing(CancelEventArgs e)