diff options
| author | lempamo <[email protected]> | 2017-07-31 21:27:01 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-07-31 21:27:01 -0400 |
| commit | 3e66e3f863a82aba078d58bbaedb782997fad36c (patch) | |
| tree | cf26671d1c799dfbf3f9fed365f76643ef6be372 /TimeHACK.Main/OS/Win95/Win95.cs | |
| parent | 87902a4c24b0c5bbd2695cfc771e9b6419c75e16 (diff) | |
| download | histacom2-3e66e3f863a82aba078d58bbaedb782997fad36c.tar.gz histacom2-3e66e3f863a82aba078d58bbaedb782997fad36c.tar.bz2 histacom2-3e66e3f863a82aba078d58bbaedb782997fad36c.zip | |
movable icons (sort of)
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index 7e4938a..4d9d15c 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -29,6 +29,9 @@ namespace TimeHACK.OS.Win95 public bool HiddenPadamsFound = false; + ListViewItem heldDownItem; + Point heldDownPoint; + // Init the form public Windows95() { @@ -137,6 +140,7 @@ namespace TimeHACK.OS.Win95 new ListViewItem("Online Services", 1), new ListViewItem("Set Up The Microsoft Network", 4), new ListViewItem("Outlook Express", 6) }, ref desktopicons, Path.Combine(ProfileWindowsDirectory, "Desktop")); + desktopicons.AutoArrange = false; } private void fontLoad() @@ -204,6 +208,13 @@ namespace TimeHACK.OS.Win95 { rightclickbackproperties.Hide(); startmenu.Hide(); + + heldDownItem = desktopicons.GetItemAt(e.X, e.Y); + if (heldDownItem != null) + { + heldDownPoint = new Point(e.X - heldDownItem.Position.X, + e.Y - heldDownItem.Position.Y); + } } else if (e.Button == MouseButtons.Middle) @@ -578,6 +589,20 @@ namespace TimeHACK.OS.Win95 app.BringToFront(); startmenu.Hide(); } + + private void desktopicons_MouseMove(object sender, MouseEventArgs e) + { + if (heldDownItem != null) + { + heldDownItem.Position = new Point(e.Location.X - heldDownPoint.X, + e.Location.Y - heldDownPoint.Y); + } + } + + private void desktopicons_MouseUp(object sender, MouseEventArgs e) + { + heldDownItem = null; + } } public class MyRenderer : ToolStripProfessionalRenderer { |
