[ros-diffs] [gedmurphy] 35801: - Don't overcomplicate choosing directories from the settings grid - Fixes directory selection

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Sat Aug 30 14:13:02 CEST 2008


Author: gedmurphy
Date: Sat Aug 30 07:13:02 2008
New Revision: 35801

URL: http://svn.reactos.org/svn/reactos?rev=35801&view=rev
Log:
- Don't overcomplicate choosing directories from the settings grid
- Fixes directory selection

Removed:
    trunk/tools/reactosdbg/RosDBG/DirectoryChooser.Designer.cs
    trunk/tools/reactosdbg/RosDBG/DirectoryChooser.resx
Modified:
    trunk/tools/reactosdbg/RosDBG/DirectoryChooser.cs
    trunk/tools/reactosdbg/RosDBG/RosDBG.csproj
    trunk/tools/reactosdbg/RosDBG/Settings.cs

Removed: trunk/tools/reactosdbg/RosDBG/DirectoryChooser.Designer.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/DirectoryChooser.Designer.cs?rev=35800&view=auto
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/DirectoryChooser.Designer.cs [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/DirectoryChooser.Designer.cs (removed)
@@ -1,115 +1,0 @@
-namespace RosDBG
-{
-    partial class DirectoryChooser
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
-            this.DirectoryTree = new System.Windows.Forms.TreeView();
-            this.OKBtn = new System.Windows.Forms.Button();
-            this.CancelBtn = new System.Windows.Forms.Button();
-            this.splitContainer1.Panel1.SuspendLayout();
-            this.splitContainer1.Panel2.SuspendLayout();
-            this.splitContainer1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // splitContainer1
-            // 
-            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
-            this.splitContainer1.IsSplitterFixed = true;
-            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
-            this.splitContainer1.Name = "splitContainer1";
-            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
-            // 
-            // splitContainer1.Panel1
-            // 
-            this.splitContainer1.Panel1.Controls.Add(this.DirectoryTree);
-            // 
-            // splitContainer1.Panel2
-            // 
-            this.splitContainer1.Panel2.Controls.Add(this.OKBtn);
-            this.splitContainer1.Panel2.Controls.Add(this.CancelBtn);
-            this.splitContainer1.Size = new System.Drawing.Size(292, 269);
-            this.splitContainer1.SplitterDistance = 235;
-            this.splitContainer1.TabIndex = 0;
-            // 
-            // DirectoryTree
-            // 
-            this.DirectoryTree.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.DirectoryTree.Location = new System.Drawing.Point(0, 0);
-            this.DirectoryTree.Name = "DirectoryTree";
-            this.DirectoryTree.Size = new System.Drawing.Size(292, 235);
-            this.DirectoryTree.TabIndex = 0;
-            this.DirectoryTree.AfterCollapse += new System.Windows.Forms.TreeViewEventHandler(this.DirectoryTree_AfterCollapse);
-            this.DirectoryTree.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.DirectoryTree_AfterExpand);
-            // 
-            // OKBtn
-            // 
-            this.OKBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.OKBtn.Location = new System.Drawing.Point(133, 3);
-            this.OKBtn.Name = "OKBtn";
-            this.OKBtn.Size = new System.Drawing.Size(75, 23);
-            this.OKBtn.TabIndex = 1;
-            this.OKBtn.Text = "OK";
-            this.OKBtn.UseVisualStyleBackColor = true;
-            this.OKBtn.Click += new System.EventHandler(this.OKButton_Click);
-            // 
-            // CancelBtn
-            // 
-            this.CancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.CancelBtn.Location = new System.Drawing.Point(214, 3);
-            this.CancelBtn.Name = "CancelBtn";
-            this.CancelBtn.Size = new System.Drawing.Size(75, 23);
-            this.CancelBtn.TabIndex = 0;
-            this.CancelBtn.Text = "Cancel";
-            this.CancelBtn.UseVisualStyleBackColor = true;
-            this.CancelBtn.Click += new System.EventHandler(this.CancelButton_Click);
-            // 
-            // DirectoryChooser
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(292, 269);
-            this.Controls.Add(this.splitContainer1);
-            this.Name = "DirectoryChooser";
-            this.Text = "DirectoryChooser";
-            this.splitContainer1.Panel1.ResumeLayout(false);
-            this.splitContainer1.Panel2.ResumeLayout(false);
-            this.splitContainer1.ResumeLayout(false);
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.SplitContainer splitContainer1;
-        private System.Windows.Forms.TreeView DirectoryTree;
-        private System.Windows.Forms.Button OKBtn;
-        private System.Windows.Forms.Button CancelBtn;
-    }
-}

Modified: trunk/tools/reactosdbg/RosDBG/DirectoryChooser.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/DirectoryChooser.cs?rev=35801&r1=35800&r2=35801&view=diff
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/DirectoryChooser.cs [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/DirectoryChooser.cs [iso-8859-1] Sat Aug 30 07:13:02 2008
@@ -12,112 +12,6 @@
 
 namespace RosDBG
 {
-    public partial class DirectoryChooser : Form
-    {
-        Dictionary<string, TreeNode> mDirectories = new Dictionary<string, TreeNode>();
-
-        public string Value
-        {
-            get
-            {
-                TreeNode selected = DirectoryTree.SelectedNode;
-                if (selected == null)
-                    return Path.GetDirectoryName(Application.ExecutablePath);
-                else
-                    return (string)selected.Tag;
-            }
-            set
-            {
-                TreeNode tn = ShowNode(value);
-                DirectoryTree.SelectedNode = tn;
-                tn.EnsureVisible();
-            }
-        }
-
-        public DirectoryChooser()
-        {
-            InitializeComponent();
-            DirectoryTree.Nodes.Clear();
-            foreach (DriveInfo drive in DriveInfo.GetDrives())
-            {
-                ShowNode(drive.RootDirectory.FullName);
-            }
-        }
-
-        private void OKButton_Click(object sender, EventArgs e)
-        {
-            DialogResult = DialogResult.OK;
-            Close();
-        }
-
-        private void CancelButton_Click(object sender, EventArgs e)
-        {
-            DialogResult = DialogResult.Cancel;
-            Close();
-        }
-
-        void ExpandNode(TreeNode node, string dir)
-        {
-            try
-            {
-                if (node.Nodes.Count == 1 && node.Nodes[0].Text == "...")
-                {
-                    node.Nodes.Clear();
-
-                    foreach (string subdir in Directory.GetDirectories(dir))
-                    {
-                        TreeNode newNode = new TreeNode(Path.GetFileName(subdir));
-                        newNode.Tag = subdir;
-                        newNode.Nodes.Add("...");
-                        mDirectories[subdir.ToLower()] = newNode;
-                        node.Nodes.Add(newNode);
-                    }
-                }
-            }
-            catch (IOException)
-            {
-            }
-        }
-
-        TreeNode ShowNode(string dir)
-        {
-            string parentDir = Path.GetDirectoryName(dir);
-            TreeNode theNode;
-            // We reached a root
-            if (mDirectories.TryGetValue(dir.ToLower(), out theNode))
-            {
-                return theNode;
-            }
-            else if (parentDir == null)
-            {
-                theNode = new TreeNode(dir);
-                theNode.Tag = dir;
-                theNode.Nodes.Add("...");
-                mDirectories[dir.ToLower()] = theNode;
-                DirectoryTree.Nodes.Add(theNode);
-                return theNode;
-            }
-            else
-            {
-                theNode = ShowNode(parentDir);
-                ExpandNode(theNode, parentDir);
-            }
-            return ShowNode(dir);
-        }
-
-        private void DirectoryTree_AfterExpand(object sender, TreeViewEventArgs e)
-        {
-            string dir = (string)e.Node.Tag;
-            ExpandNode(e.Node, dir);
-        }
-
-        private void DirectoryTree_AfterCollapse(object sender, TreeViewEventArgs e)
-        {
-            e.Node.Nodes.Clear();
-            e.Node.Nodes.Add("...");
-        }
-    }
-
     public class DirectoryEditor : UITypeEditor
     {
         public override UITypeEditorEditStyle  GetEditStyle(ITypeDescriptorContext context)
@@ -127,10 +21,10 @@
 
         public override object EditValue(ITypeDescriptorContext typedesc, IServiceProvider provider, object value)
         {
-            DirectoryChooser chooser = new DirectoryChooser();
-            chooser.Value = (string)value;
-            if (chooser.ShowDialog() == DialogResult.OK)
-                return chooser.Value;
+            FolderBrowserDialog fbd = new FolderBrowserDialog();
+            fbd.Description = "Set path for " + typedesc.PropertyDescriptor.DisplayName;
+            if (fbd.ShowDialog() == DialogResult.OK)
+                return fbd.SelectedPath;
             else
                 return value;
         }

Removed: trunk/tools/reactosdbg/RosDBG/DirectoryChooser.resx
URL: http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/DirectoryChooser.resx?rev=35800&view=auto
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/DirectoryChooser.resx [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/DirectoryChooser.resx (removed)
@@ -1,120 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>

Modified: trunk/tools/reactosdbg/RosDBG/RosDBG.csproj
URL: http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RosDBG.csproj?rev=35801&r1=35800&r2=35801&view=diff
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/RosDBG.csproj [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/RosDBG.csproj [iso-8859-1] Sat Aug 30 07:13:02 2008
@@ -3,7 +3,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>9.0.21022</ProductVersion>
+    <ProductVersion>9.0.30729</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{FB776BFE-D2C2-465E-B713-6AD82CAE1A39}</ProjectGuid>
     <OutputType>WinExe</OutputType>
@@ -74,10 +74,6 @@
     </Compile>
     <Compile Include="DebugInfoFile.cs" />
     <Compile Include="DirectoryChooser.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="DirectoryChooser.Designer.cs">
-      <DependentUpon>DirectoryChooser.cs</DependentUpon>
     </Compile>
     <Compile Include="HighLevelInteraction.cs" />
     <Compile Include="HostWindow.cs">
@@ -131,10 +127,6 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <EmbeddedResource Include="BackTrace.resx">
       <DependentUpon>BackTrace.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <EmbeddedResource Include="DirectoryChooser.resx">
-      <DependentUpon>DirectoryChooser.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="HostWindow.resx">

Modified: trunk/tools/reactosdbg/RosDBG/Settings.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Settings.cs?rev=35801&r1=35800&r2=35801&view=diff
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] Sat Aug 30 07:13:02 2008
@@ -137,7 +137,7 @@
         public static string ComPort { get { return mProperties.Port; } }
         public static string Baudrate { get { return mProperties.Baudrate; } }
 
-        Settings()
+        public Settings()
         {
             InitializeComponent();
             mProperties.Reload();



More information about the Ros-diffs mailing list