Ram Watch - Drag & Drop .wch files
This commit is contained in:
parent
05ac3119ba
commit
d8772ebf9d
|
@ -15,6 +15,7 @@ namespace BizHawk.MultiClient
|
||||||
//TODO:
|
//TODO:
|
||||||
//If signed/unsigned/hex radios selected, auto-change the value box
|
//If signed/unsigned/hex radios selected, auto-change the value box
|
||||||
//Checked signed/u/h value on RamPoke_Load and set value appopriately
|
//Checked signed/u/h value on RamPoke_Load and set value appopriately
|
||||||
|
//Validate address (hex) and value (based on s/u/h setting)
|
||||||
public Watch watch = new Watch();
|
public Watch watch = new Watch();
|
||||||
public Point location = new Point();
|
public Point location = new Point();
|
||||||
|
|
||||||
|
|
|
@ -578,6 +578,7 @@
|
||||||
//
|
//
|
||||||
// RamWatch
|
// RamWatch
|
||||||
//
|
//
|
||||||
|
this.AllowDrop = true;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(364, 424);
|
this.ClientSize = new System.Drawing.Size(364, 424);
|
||||||
|
@ -592,6 +593,8 @@
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||||
this.Text = "Ram Watch";
|
this.Text = "Ram Watch";
|
||||||
this.Load += new System.EventHandler(this.RamWatch_Load);
|
this.Load += new System.EventHandler(this.RamWatch_Load);
|
||||||
|
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.RamWatch_DragDrop);
|
||||||
|
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.RamWatch_DragEnter);
|
||||||
this.Resize += new System.EventHandler(this.RamWatch_Resize);
|
this.Resize += new System.EventHandler(this.RamWatch_Resize);
|
||||||
this.LocationChanged += new System.EventHandler(this.RamWatch_LocationChanged);
|
this.LocationChanged += new System.EventHandler(this.RamWatch_LocationChanged);
|
||||||
this.menuStrip1.ResumeLayout(false);
|
this.menuStrip1.ResumeLayout(false);
|
||||||
|
|
|
@ -17,10 +17,11 @@ namespace BizHawk.MultiClient
|
||||||
public partial class RamWatch : Form
|
public partial class RamWatch : Form
|
||||||
{
|
{
|
||||||
//TODO:
|
//TODO:
|
||||||
//TODO: Call AskSave in main client X function
|
//Call AskSave in main client X function
|
||||||
//Multiselect is enabled but only one row can be highlighted by the user
|
//Multiselect is enabled but only one row can be highlighted by the user
|
||||||
//DWORD display
|
//DWORD display
|
||||||
//On Movie UP/Down set highlighted items to be what the user had selected (in their new position)
|
//On Movie UP/Down set highlighted items to be what the user had selected (in their new position)
|
||||||
|
//DisplayWatches needs to do value display properly like updatevalues, or just run update values
|
||||||
|
|
||||||
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
||||||
int defaultHeight;
|
int defaultHeight;
|
||||||
|
@ -852,5 +853,20 @@ namespace BizHawk.MultiClient
|
||||||
EditWatch();
|
EditWatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RamWatch_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||||
|
if (filePaths[0].Contains(".wch")) //TODO: a less lazy way to check file extension?
|
||||||
|
{
|
||||||
|
LoadWatchFile(filePaths[0], false);
|
||||||
|
DisplayWatchList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RamWatch_DragEnter(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;string[] filePaths = (string[]) e.Data.GetData(DataFormats.FileDrop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue