aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-07-04 09:55:19 -0400
committerlempamo <[email protected]>2017-07-04 09:55:19 -0400
commitd6ea0813da443a0e6a56b24ed2019fb9fc384735 (patch)
tree92aa22c09204390dbf50b3e9494dacea28dcac48 /TimeHACK.Main/OS
parent59c9e070258db893745f70862c4128b97a87c9fd (diff)
downloadhistacom2-d6ea0813da443a0e6a56b24ed2019fb9fc384735.tar.gz
histacom2-d6ea0813da443a0e6a56b24ed2019fb9fc384735.tar.bz2
histacom2-d6ea0813da443a0e6a56b24ed2019fb9fc384735.zip
Fixed TreeView in the not ALEXplorer
Diffstat (limited to 'TimeHACK.Main/OS')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.Designer.cs29
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs84
2 files changed, 65 insertions, 48 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.Designer.cs
index df2bb36..11bb4d3 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.Designer.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.Designer.cs
@@ -32,7 +32,6 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassicWindowsExplorer));
this.program = new System.Windows.Forms.Panel();
this.diskView = new System.Windows.Forms.TreeView();
- this.icons = new System.Windows.Forms.ImageList(this.components);
this.MenuStrip1 = new System.Windows.Forms.MenuStrip();
this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -88,7 +87,6 @@
this.Label1 = new System.Windows.Forms.Label();
this.txtSave = new System.Windows.Forms.TextBox();
this.mainView = new System.Windows.Forms.ListView();
- this.iconsList = new System.Windows.Forms.ImageList(this.components);
this.program.SuspendLayout();
this.MenuStrip1.SuspendLayout();
this.pnlSave.SuspendLayout();
@@ -113,7 +111,7 @@
//
// diskView
//
- this.diskView.ImageList = this.icons;
+ this.diskView.ImageList = new System.Windows.Forms.ImageList();
this.diskView.Location = new System.Drawing.Point(3, 27);
this.diskView.Name = "diskView";
this.diskView.Size = new System.Drawing.Size(213, 444);
@@ -121,16 +119,6 @@
this.diskView.Visible = true;
this.diskView.DoubleClick += new System.EventHandler(this.diskView_DoubleClick);
//
- // icons
- //
- this.icons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("icons.ImageStream")));
- this.icons.TransparentColor = System.Drawing.Color.Transparent;
- this.icons.Images.SetKeyName(0, "nwnp32_1_SERVER_ICON.png");
- this.icons.Images.SetKeyName(1, "shell32_21.ico_16x16.png");
- this.icons.Images.SetKeyName(2, "blank-file-Windows95Icon.gif");
- this.icons.Images.SetKeyName(3, "WinClassicCalc.png");
- this.icons.Images.SetKeyName(4, "WinClassicComputer.png");
- //
// MenuStrip1
//
this.MenuStrip1.BackColor = System.Drawing.Color.Silver;
@@ -546,27 +534,14 @@
this.mainView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.mainView.LargeImageList = this.iconsList;
this.mainView.Location = new System.Drawing.Point(215, 27);
this.mainView.Name = "mainView";
this.mainView.Size = new System.Drawing.Size(486, 444);
- this.mainView.SmallImageList = this.iconsList;
- this.mainView.StateImageList = this.iconsList;
this.mainView.TabIndex = 10;
this.mainView.UseCompatibleStateImageBehavior = false;
this.mainView.View = System.Windows.Forms.View.List;
this.mainView.DoubleClick += new System.EventHandler(this.mainView_DoubleClick);
//
- // iconsList
- //
- this.iconsList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("iconsList.ImageStream")));
- this.iconsList.TransparentColor = System.Drawing.Color.Transparent;
- this.iconsList.Images.SetKeyName(0, "nwnp32_1_SERVER_ICON.png");
- this.iconsList.Images.SetKeyName(1, "shell32_21.ico_16x16.png");
- this.iconsList.Images.SetKeyName(2, "blank-file-Windows95Icon.gif");
- this.iconsList.Images.SetKeyName(3, "WinClassicCalc.png");
- this.iconsList.Images.SetKeyName(4, "WinClassicComputer.png");
- //
// WinClassicWindowsExplorer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -644,7 +619,5 @@
internal System.Windows.Forms.Button Button1;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.TextBox txtSave;
- internal System.Windows.Forms.ImageList icons;
- private System.Windows.Forms.ImageList iconsList;
}
}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs
index c4673ed..91b88f5 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs
@@ -16,15 +16,15 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
public partial class WinClassicWindowsExplorer : UserControl
{
- public Boolean IsFileOpenDialog = false;
- public Boolean IsFileSaveDialog = false;
- public String onlyViewExtension = "";
-
- String ToReplaceWith = ProfileDirectory;
- String currentDirectory = Path.Combine(ProfileDirectory, "folders");
- String oldLabelText;
- Int32 fileType = 6;
- String attemptedDirectory = "";
+ public bool IsFileOpenDialog = false;
+ public bool IsFileSaveDialog = false;
+ public string onlyViewExtension = "";
+
+ string ToReplaceWith = ProfileDirectory;
+ string currentDirectory = Path.Combine(ProfileDirectory, "folders/computer");
+ string oldLabelText;
+ int fileType = 6;
+ string attemptedDirectory = "";
WindowManager wm = new WindowManager();
public WinClassicWindowsExplorer()
@@ -72,10 +72,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
void RefreshAll() {
try {
// Refresh the right listview
- icons.Images.Clear();
this.mainView.Items.Clear();
- diskView.ImageList = icons;
- this.mainView.LargeImageList = icons;
// For Each drive As String In My.Computer.FileSystem.GetDirectories(GameMain.MyDocuments & "\HistacomVB\" & GameMain.SaveProfile & "\HistacomVB\Folders")
// If GetPropetiesForDir(drive)(4) = "isMyDocuments" Then
// diskView.Items.Add("", 0)
@@ -139,8 +136,8 @@ namespace TimeHACK.OS.Win95.Win95Apps
}
}
- String ReturnType(String extension) {
- String returnVal = "";
+ string ReturnType(string extension) {
+ string returnVal = "";
fileType = 1;
switch (extension) {
case ".txt":
@@ -435,13 +432,40 @@ namespace TimeHACK.OS.Win95.Win95Apps
// IsFileDialog = False
//End Sub
void WinClassicWindowsExplorer_Load(object sender, EventArgs e) {
-
- diskView.ImageList.Images[0] = Properties.Resources.Win95DesktopIcon;
- diskView.ImageList.Images[1] = Properties.Resources.Win95HardDiskIcon;
+ diskView.ImageList.Images.Add(Properties.Resources.Win95DesktopIcon);
+ diskView.ImageList.Images.Add(Properties.Resources.Win95HardDiskIcon);
+ diskView.ImageList.Images.Add(Properties.Resources.WinClassicFolderSmall);
+ diskView.ImageList.Images.Add(Properties.Resources.WinClassicOpenFolderSmall);
+ diskView.ImageList.Images.Add(Properties.Resources.Win95ControlPanelIcon);
+ diskView.ImageList.Images.Add(Properties.Resources.Win95PrintersFolder);
+ diskView.ImageList.Images.Add(Properties.Resources.Win95ComputerIcon);
+ diskView.ImageList.Images.Add(Properties.Resources.Win95NetworkIcon);
+ diskView.ImageList.Images.Add(Properties.Resources.Win95RecycleIcon);
program.BringToFront();
- TreeNode rootnode = new TreeNode("Desktop", 0, 0);
- diskView.Nodes.Add(rootnode);
- diskView.Nodes["Desktop"].Nodes.Add(new TreeNode("(C:)", 1, 1));
+ int loc = 0;
+ TreeNode[] folders = new TreeNode[new DirectoryInfo(currentDirectory).GetDirectories().Length];
+ foreach (DirectoryInfo folder in new DirectoryInfo(currentDirectory).GetDirectories())
+ {
+ if (folder.GetDirectories().Length > 0)
+ {
+ TreeNode[] tn = createSubDirNodes(folder);
+ folders[loc] = new TreeNode(folder.Name, 2, 3, tn);
+ }
+ else
+ {
+ folders[loc] = new TreeNode(folder.Name, 2, 3);
+ }
+ loc++;
+ }
+ TreeNode[] mypcarray = new TreeNode[3];
+ mypcarray[0] = new TreeNode("(C:)", 1, 1, folders);
+ mypcarray[1] = new TreeNode("Control Panel", 4, 4);
+ mypcarray[2] = new TreeNode("Printers", 5, 5);
+ TreeNode[] desktoparray = new TreeNode[3];
+ desktoparray[0] = new TreeNode("My Computer", 6, 6, mypcarray);
+ desktoparray[1] = new TreeNode("Network Neighborhood", 7, 7);
+ desktoparray[2] = new TreeNode("Recycle Bin", 8, 8);
+ diskView.Nodes.Add(new TreeNode("Desktop", 0, 0, desktoparray));
//diskView.Items.Add("My Computer", 0);
Application.DoEvents();
RefreshAll();
@@ -631,5 +655,25 @@ namespace TimeHACK.OS.Win95.Win95Apps
}
RefreshAll();
}
+
+ private TreeNode[] createSubDirNodes(DirectoryInfo folder)
+ {
+ TreeNode[] toReturn = new TreeNode[folder.GetDirectories().Length];
+ int loc = 0;
+ foreach (DirectoryInfo fold in folder.GetDirectories())
+ {
+ if (fold.GetDirectories().Length > 0)
+ {
+ TreeNode[] tn = createSubDirNodes(fold);
+ toReturn[loc] = new TreeNode(fold.Name, 2, 3, tn);
+ }
+ else
+ {
+ toReturn[loc] = new TreeNode(fold.Name, 2, 3);
+ }
+ loc++;
+ }
+ return toReturn;
+ }
}
}